Class IKSlaveControl

3DS Max Plug-In SDK

Class IKSlaveControl

See Also: Class Control, Class IKMasterControl, Class Point3, Class Quat.

class IKSlaveControl : public Control

Description:

This class is available in release 2.0 and later only.

The IK Controller requires that you use the Bones system. When you create the bones, a slave IK controller is assigned to each bone. All of the slave IK controllers in a single hierarchy are, in turn, controlled by a master IK controller. This class provides access to the slave controller parameters.

If you have a pointer to a TM controller you may test the Class_ID against IKSLAVE_CLASSID to determine if it is an IK Slave Controller.

For an example the use of this class see \MAXSDK\SAMPLES\OBJECTS\BONES.CPP.

Methods:

public:

Prototype:

virtual IKMasterControl *GetMaster()=0;

Remarks:

Returns a pointer to the IKMasterControl that manages this IK slave controller.

Prototype:

virtual void SetDOF(int which, BOOL onOff)=0;

Remarks:

Sets the specified degree of freedom to on or off.

Parameters:

int which

Specifies which degree of freedom to modify. Pass a value between 1 and 6. The first 3 DOFs are position and the next 3 are rotation.

BOOL onOff

TRUE for on; FALSE for off.

Prototype:

virtual void SetInitPos(Point3 pos)=0;

Remarks:

Sets the initial position to the value passed.

Parameters:

Point3 pos

The initial position to set.

Prototype:

virtual void SetInitRot(Point3 rot)=0;

Remarks:

Sets the initial rotation to the value passed.

Parameters:

Point3 rot

The initial rotation to set.

Prototype:

virtual void MakeEE(BOOL onOff,DWORD which,Point3 pos,Quat rot)=0;

Remarks:

For any IK solution you explicitly move one object. 3ds max uses IK calculations to move and rotate all other objects in the kinematic chain to react to the object you moved. The object that you move is the end effector. There are two types of end effectors; Position and Rotation. This method create or deletes an end effector for position or rotation or both.

Parameters:

BOOL onOff

Controls if the end effector is on or off (creates or deletes the end effector controller). TRUE to create; FALSE to delete.

DWORD which

Specifies which end effector(s) to modify. Set the low order bit for position, the second bit for rotation, or set both for position and rotation.

Point3 pos

The initial position set at time 0 for the position controller (CTRL_ABSOLUTE).

Quat rot

The initial rotation set at time 0 for the rotation controller (CTRL_ABSOLUTE).

The following function is not part of this class but is available for use:

Function:

IKSlaveControl *CreateIKSlaveControl(IKMasterControl *master,INode *slaveNode);

Remarks:

This global function creates and returns a pointer to a new IK slave controller by specifying the master controller and a node to which the slave controller is assigned.

Parameters:

IKMasterControl *master

Points to the master controller to use.

INode *slaveNode

Points to the slave node to use.