Class IIKControl

3DS Max Plug-In SDK

Class IIKControl

See Also: Class INode, Class Control, Class Point2, Class Point3, Class Interval, Inverse Kinematics

class IIKControl

Description:

This class is available in release 4.0 and later only.

This class represents the TM controller for IK Chains and is used for nodes that serve as IK joints. This class is closely knit together with the Class IIKChainControl and form the IK system. An interface pointer to the IKControl class can be obtained by using Animatable::GetInterface(I_IKCONTROL). See the Inverse Kinematics section for more detailed information.

Methods:

public:

Degrees of Freedom

Prototype:

virtual bool DofActive(DofAxis) const = 0;

Remarks:

This method allows you to determine which degrees of freedom are active and inactive for the translational and rotational axes.

Parameters:

DofAxis

The DOF axis to check, which is one of the following IKSys::TransX, IKSys::TransY, IKSys::TransZ, IKSys::RotX, IKSys::RotY, IKSys::RotZ.

Return Value:

TRUE if the specified DOF axis is active, otherwise FALSE.

Prototype:

virtual DofSet ActiveTrans() const = 0;

Remarks:

This method allows you to determine which degrees of freedom are active and inactive for the translational axes. The returned DofSet can be tested for IKSys::DofX, IKSys::DofX, and IKSys::DofX.

Return Value:

A DofSet structure containing the translational axes.

Prototype:

virtual DofSet ActiveRot() const = 0;

Remarks:

This method allows you to determine which degrees of freedom are active and inactive for the rotational axes. The returned DofSet can be tested for IKSys::DofX, IKSys::DofX, and IKSys::DofX.

Return Value:

A DofSet structure containing the translational axes.

Prototype:

virtual DofSet ActiveDofs() const = 0;

Remarks:

This method allows you to determine which degrees of freedom are active and inactive for the translational and rotational axes. The returned DofSet can be tested for IKSys::TransX, IKSys::TransY, IKSys::TransZ, IKSys::RotX, IKSys::RotY, IKSys::RotZ.

Return Value:

A DofSet structure containing the translational and rotational axes.

IK Chains

Prototype:

virtual INodeTab IKChains(JointType) const = 0;

Remarks:

This method returns a list of IK Chain nodes. Note that nn IK chain starts at the rotational joint of the Start Joint and ends at the sliding joint of the End Joint.

Parameters:

JointType

The joint type, either IKSys::SlidingJoint or IKSys::RotationalJoint.

Return Value:

The node table of IK Chain nodes.

Prototype:

virtual bool IKBound(TimeValue t, JointType jt) = 0;

Remarks:

The parameter that decides whether an individual degree of freedom is active is not animatable. There is an animatable variable of IK chain that decides whether the goal defined in the IK chain actually affects the joints it covers at a specific time. This method allows you to query that.

Parameters:

TimeValue t

The time at which to test the joint type.

JointType jt

The joint type, either IKSys::SlidingJoint or IKSys::RotationalJoint.

Return Value:

TRUE if bound, otherwise FALSE.

Joint Limits

Prototype:

virtual bool DofLowerLimited(DofAxis) const = 0;

Remarks:

This method allows you to check if a specific DOF axis has its lower bounds limited.

Parameters:

DofAxis

The DOF axis to check, which is one of the following IKSys::TransX, IKSys::TransY, IKSys::TransZ, IKSys::RotX, IKSys::RotY, IKSys::RotZ.

Return Value:

TRUE if limited, otherwise FALSE.

Prototype:

virtual bool DofUpperLimited(DofAxis) const = 0;

Remarks:

This method allows you to check if a specific DOF axis has its upper bounds limited.

Parameters:

DofAxis

The DOF axis to check, which is one of the following IKSys::TransX, IKSys::TransY, IKSys::TransZ, IKSys::RotX, IKSys::RotY, IKSys::RotZ.

Return Value:

TRUE if limited, otherwise FALSE.

Prototype:

virtual Point2 DofLimits(DofAxis) const = 0;

Remarks:

This method allows you to check if a specific DOF axis has its upper and lower bounds limited.

Parameters:

DofAxis

The DOF axis to check, which is one of the following IKSys::TransX, IKSys::TransY, IKSys::TransZ, IKSys::RotX, IKSys::RotY, IKSys::RotZ.

Return Value:

A Point2 where X and Y are the lower and upper limits, respectively.

Prototype:

virtual Point3 TransLowerLimits() const = 0;

Remarks:

This method allows you to retrieve the translation lower limits.

Return Value:

A Point3 where X, Y, and Z represents the actual limits.

Prototype:

virtual Point3 TransUpperLimits() const = 0;

Remarks:

This method allows you to retrieve the translation upper limits.

Return Value:

A Point3 where X, Y, and Z represents the actual limits.

Prototype:

virtual Point3 RotLowerLimits() const = 0;

Remarks:

This method allows you to retrieve the rotational lower limits.

Return Value:

A Point3 where X, Y, and Z represents the actual limits.

Prototype:

virtual Point3 RotUpperLimits() const = 0;

Remarks:

This method allows you to retrieve the rotational upper limits.

Return Value:

A Point3 where X, Y, and Z represents the actual limits.

FK Sub-Controller Access

Prototype:

virtual Control* FKSubController() const = 0;

Remarks:

This method allows you to obtain a pointer to the Forward Kinematics sub-controller. Note that the IK controller is not designed to be instanced. It is expected to have a unique node.

Prototype:

virtual INode* GetNode() const = 0;

Remarks:

This method allows you to obtain a pointer to the node that holds the Forward Kinematics TM controller.

Preferred Angles

Prototype:

virtual Point3 PrefPosition(TimeValue t, Interval& validityInterval) = 0;

Remarks:

This method allows you to retrieve the preferred angle of translation. Note that the angles are constant with regard to animation time.

Parameters:

TimeValue t

The time at which to retrieve the preferred angle.

Interval& validityInterval

The validity interval.

Return Value:

The X, Y, and Z, preferred angles.

Prototype:

virtual Point3 PrefRotation(TimeValue t, Interval& validityInterval) = 0;

Remarks:

This method allows you to retrieve the preferred angle of rotation. Note that the angles are constant with regard to animation time.

Parameters:

TimeValue t

The time at which to retrieve the preferred angle.

Interval& validityInterval

The validity interval.

Return Value:

The X, Y, and Z, preferred angles.

Prototype:

virtual void SetPrefTrans(const Point3& val, TimeValue t = 0) = 0;

Remarks:

A solver may start off the solution process with joint angles being set to special values, preferred angles. This method allows you to set the preferred angles of the translational joints.

Parameters:

const Point3& val

The preferred angles you wish to set.

TimeValue t = 0

The time at which to set them.

Prototype:

virtual void SetPrefRot(const Point3& val, TimeValue t = 0) = 0;

Remarks:

A solver may start off the solution process with joint angles being set to special values, preferred angles. This method allows you to set the preferred angles of the rotational joints.

Parameters:

const Point3& val

The preferred angles you wish to set.

TimeValue t = 0

The time at which to set them.

Prototype:

virtual void SetPrefTR(const Point3& trans, const Point3& rot, TimeValue t = 0) = 0;

Remarks:

A solver may start off the solution process with joint angles being set to special values, preferred angles. This method allows you to set the preferred angles of both the translational and rotational joints.

Parameters:

const Point3& trans

The preferred translational angles you wish to set.

const Point3& rot

The preferred rotational angles you wish to set.

TimeValue t = 0

The time at which to set them.

Joint Angles

Prototype:

virtual Point3 TransValues(TimeValue, Interval* = 0) = 0;

Remarks:

This method returns the angles of sliding joints at a specific time.

Parameters:

TimeValue

The time at which to retrieve the values.

Interval* = 0

The validity interval. If non-null the validity interval will be updated.

Prototype:

virtual Point3 RotValues(TimeValue, Interval* = 0) = 0;

Remarks:

This method returns the angles of rotational joints at a specific time.

Parameters:

TimeValue

The time at which to retrieve the values.

Interval* = 0

The validity interval. If non-null the validity interval will be updated.

Prototype:

virtual void AssignTrans(const Point3&, const Interval&) = 0;

Remarks:

This method allows you to set the angles of translational joints. Note that this method does not adjust the validity interval.

Parameters:

const Point3&

The joint angles.

const Interval&

The validity interval

Prototype:

virtual void AssignRot(const Point3&, const Interval&) = 0;

Remarks:

This method allows you to set the angles of rotational joints. Note that this method does not adjust the validity interval.

Parameters:

const Point3&

The joint angles.

const Interval&

The validity interval

Prototype:

virtual void AssignActiveTrans(const Point3&, const Interval&) = 0;

Remarks:

This method allows you to set the angles of translational joints. Note that this method will skip those degrees of freedom that are not active and that this method will not adjust the validity interval.

Parameters:

const Point3&

The joint angles.

const Interval&

The validity interval

Prototype:

virtual void AssignActiveTrans(const DofSet&, const float[], const Interval&) = 0;

Remarks:

This method allows you to set the angles of translational joints. The active DOF’s are given as the first argument of type DofSet and the new values are supplied as a float array whose size should be the same as the DofSet [DofSet::Count()].Note that this method does not adjust the validity interval.

Parameters:

const DofSet&

The degrees of freedom.

const float[]

The new angles you wish to set.

const Interval&

The validity interval

Prototype:

virtual void AssignActiveRot(const Point3&, const Interval&) = 0;

Remarks:

This method allows you to set the angles of rotational joints. Note that this method will skip those degrees of freedom that are not active and that this method does not adjust the validity interval.

Parameters:

const Point3&

The joint angles.

const Interval&

The validity interval

Prototype:

virtual void AssignActiveRot(const DofSet&, const float[], const Interval&) = 0;

Remarks:

This method allows you to set the angles of rotational joints. The active DOF’s are given as the first argument of type DofSet and the new values are supplied as a float array whose size should be the same as the DofSet [DofSet::Count()].Note that this method does not adjust the validity interval.

Parameters:

const DofSet&

The degrees of freedom.

const float[]

The new angles you wish to set.

const Interval&

The validity interval

Prototype:

virtual void SetTransValid(const Interval& valid) = 0;

Remarks:

This method allows you to set the validity interval for translational joint angles.

Parameters:

const Interval& valid

The validity interval.

Prototype:

virtual void SetRotValid(const Interval& valid) = 0;

Remarks:

This method allows you to set the validity interval for rotational joint angles.

Parameters:

const Interval& valid

The validity interval.

Prototype:

virtual void SetTRValid(const Interval& valid) = 0;

Remarks:

This method allows you to set the validity interval for both translational and rotational joint angles.

Parameters:

const Interval& valid

The validity interval.