Class ILookAtConstRotation

3DS Max Plug-In SDK

Class ILookAtConstRotation

See Also: Class Control, Class FPMixinInterface.

class ILookAtConstRotation : public Control , public FPMixinInterface

Description:

This class is available in release 4.0 and later only.

This class is an interface to the LookAt Constraint rotation controller. You can obtain a pointer to the list control interface using; GetILookAtConstInterface(cd). This macro will return (ILookAtConstRotation*)(CD)->GetFPInterface(LOOKAT_CONSTRAINT_INTERFACE).

LOOKAT_ROT_PBLOCK_REF may be used to access the look-at controller's references:

All methods of this class are Implemented by the System.

Methods:

public:

Prototype:

virtual INode* GetTarget(int targetNumber)=0;

Remarks:

This method will return a pointer to a node of one of the Look-At nodes that the Look-At constraint controller targets, specified by targetNumber.

Parameters:

int targetNumber

The node number in the Look-At target list to be obtained.

Prototype:

virtual BOOL SetTarget(INode *target, int targetNumber)=0;

Remarks:

Sets one of the Look-At nodes that the Look-At constraint controller targets, specified by targetNumber. If targetNumber is greater than the number of targets in the current list, it returns a FALSE. In this case use the function AppendTarget.

Parameters:

INode *node

Points to the node to follow.

int targetNumber

The node number in the Look-At target list to be set.

Return Value:

TRUE if success; FALSE otherwise.

Prototype:

virtual float GetTargetWeight(int targetNumber)=0;

Remarks:

Gets the weight of one of the Look-At nodes that the Look-At constraint controller targets, specified by targetNumber.

Parameters:

int targetNumber

The node number in the Look-At target list whose weight is to be obtained.

Prototype:

virtual BOOL SetTargetWeight(float weight, int targetNumber)=0;

Remarks:

Sets the weight of one of the Look-At nodes that the Look-At constraint controller follows, specified by targetNumber.

Parameters:

float weight

The weight to set.

targetNumber

The node number in the Look-At target list whose weight is to be set.

Return Value:

TRUE if there is more than one Look-At targets in the list and you are trying to set weight, FALSE otherwise.

Prototype:

virtual BOOL AppendTarget(INode *target, float weight=50.0)=0;

Remarks:

Appends the current Look-At target list by one and appends the current Look-At target weightlist by one.

Parameters:

INode *target

The node that is to be appended to the current Look-At target list.

float weight=50.0

This is the weight that is to be assigned to the newly appended Look-At target. The default weight is 50.0.

Return Value:

TRUE if the target was appended, otherwise FALSE.

Prototype:

virtual int GetNumTargets()=0;

Remarks:

Returns the number of nodes in the list of nodes to look at.

Prototype:

virtual BOOL GetRelative()=0;

Remarks:

Gets the relative/absolute mode corresponding to the "Keep Initial Offset" checkbox in the UI.

Prototype:

virtual BOOL GetVLisAbs()=0;

Remarks:

Gets the ViewLine relative/absolute mode corresponding to the "Keep ViewLine Length Absolute" checkbox in the UI. When Viewline Length is absolute, the "ViewLine Length" spinner sets the length of the ViewLine. A negative length implies that starting from the source object the line travels opposite to the direction of the target object. The source/target distance has no effect on the ViewLine length in this mode. If the "Keep ViewLine Length Absolute" checkbox is unchecked, the ViewLine length is determined from the spinner value, which is interpreted as a percentage of the source/target distance.

Return Value:

TRUE if the ViewLine length is absolute, FALSE otherwise.

Prototype:

virtual void SetVLisAbs(BOOL rel)=0;

Remarks:

Sets the relative/absolute mode corresponding to the "Keep ViewLine Length Absolute" checkbox in the UI.

Parameters:

BOOL rel

TRUE if "Keep ViewLine Length Absolute" is active (checked), FALSE otherwise.

Prototype:

virtual BOOL GetUpnodeWorld()=0;

Remarks:

Returns TRUE if the "World" checkbox is on; FALSE if off.

Prototype:

virtual BOOL GetStoUPAxisFlip()=0;

Remarks:

Returns TRUE if the "selected" axis flip checkbox is on; FALSE if off.

Prototype:

virtual BOOL GetTargetAxisFlip()=0;

Remarks:

Returns TRUE if the "source" axis flip checkbox is on; FALSE if off.

Prototype:

virtual BOOL Get_SetOrientation()=0;

Remarks:

Returns TRUE if the orientation flag is set, FALSE if off.

Prototype:

virtual int GetTargetAxis()=0;

Remarks:

Gets the selection corresponding to the "Select LookAt Axis" button in the UI. Obtains which of the source axes is required to coincide with the target axis.

Return Value:

(0) if the target axis coincides with the x axis of the source object. (1) if the target axis coincides with the y axis of the source object. (2) if the target axis coincides with the z axis of the source object.

Prototype:

virtual int GetUpNodeAxis()=0;

Remarks:

Gets the selection corresponding to the "Source/Upnode Alignment: Aligned to UpNode Axis:" radiobutton in the UI. Obtains which of the upnode axes is required to align with a specified source axis.

Return Value:

(0) if the upnode x axis coincides with a specified source object. (1) if the upnode y axis coincides with a specified source object. (2) if the upnode z axis coincides with a specified source object.

Prototype:

virtual int Get_StoUPAxis()=0;

Remarks:

Gets the selection corresponding to the "Source/Upnode Alignment: Aligned to UpNode Axis:" radiobutton in the UI. Obtains which of the source axes is required to align with a specified upnode axis.

Return Value:

(0) if the source x axis coincides with a specified upnode axis. (1) if the source y axis coincides with a specified upnode axis. (2) if the source z axis coincides with a specified upnode axis.

Prototype:

virtual void SetRelative(BOOL rel)=0;

Remarks:

This method allows you to set the "relative" flag.

Parameters:

BOOL rel

TRUE to set the relative flag, otherwise FALSE.

Prototype:

virtual void SetUpnodeWorld(BOOL uw)=0;

Remarks:

This method allows you to set the "World" flag.

Parameters:

BOOL uw

TRUE to set the world flag, otherwise false.

Prototype:

virtual void SetTargetAxisFlip(BOOL rel)=0;

Remarks:

This method allows you to set the "source" flip axis flag.

Parameters:

BOOL rel

TRUE to set the source flip axis flag, otherwise FALSE.

Prototype:

virtual void SetStoUPAxisFlip(BOOL rel)=0;

Remarks:

This method allows you to set the "selected" axis flip flag.

Parameters:

BOOL rel

TRUE to set the selected axis flip flag, otherwise FALSE.

Prototype:

virtual void Set_SetOrientation(BOOL rel)=0;

Remarks:

This method allows you to set the orientation flag.

Parameters:

BOOL rel

TRUE to set the orientation flag, otherwise FALSE.

Prototype:

virtual void Set_Reset_Orientation()=0;

Remarks:

Resets to zero the amount of orientation offset, effected through the "Set Orientation" feature.

Prototype:

virtual void SetTargetAxis(int axis)=0;

Remarks:

Sets the selection corresponding to the "Set Orientation" button in the UI. Specifies which of the source axes is required to coincide with the target axis.

Parameters:

int axis

(0) if TargetAxis coincides with the X axis of the source object. (1) if TargetAxis coincides with the Y axis of the source object. (2) if TargetAxis coincides with the Z axis of the source object

Prototype:

virtual void SetUpNodeAxis(int axis)=0;

Remarks:

Sets the selection corresponding to the "Source/Upnode Alignment: Aligned to UpNode Axis:" radiobutton in the UI. Specifies which of the upnode axes is required to align with a specified source axis.

Parameters:

int axis

(0) if the upnode X axis coincides with a specified source axis. (1) if the upnode Y axis coincides with a specified source axis. (2) if the upnode Z axis coincides with a specified source axis.

Prototype:

virtual void Set_StoUPAxis(int axis)=0;

Remarks:

Sets the selection corresponding to the "Source/Upnode Alignment: Aligned to UpNode Axis:" radiobutton in the UI. Specifies which of the source axes is required to align with a specified upnode axis.

Parameters:

int axis

(0) if the source X axis coincides with a specified upnode axis. (1) if the source Y axis coincides with a specified upnode axis. (2) if the source Z axis coincides with a specified upnode axis.

Prototype:

virtual void DeleteTarget(int targetNumber)=0;

Remarks:

This method allows you to delete a specified target.

Parameters:

int targetNumber

The zero based node number in the list of nodes the controller looks at.