Class IIKChainControl
See Also: : Class IKCmdOps, Class IKChainActions
Description:
This class is only available in release 5 or later.
The interface class to TM controller that the IK chain node employs. Suppose node is an IK chain node, following code obtains the interface pointer
IIKChainControl* ikchain = (IIKChainControl*) node->GetTMController()->GetInterface(I_IKChainControl);
From this pointer, we can get all properties pertinent to an IK Chain.
Methods:
Prototype:
virtual INode* StartJoint() const
Remarks:
The start joint, end joint of the chain, and the node to that this IK chain controller belongs.
Prototype:
virtual INode* EndJoint() const
Remarks:
Please refer to StartJoint().
Prototype:
virtual INode* GetNode() const
Remarks:
Please refer to StartJoint().
Prototype:
virtual Point3 ChainNormal(TimeValue t, Interval& valid)
Remarks:
Preferred angles are used to start the IK iteration. Hence, the pose when joint angles assume the preferred angles is also called the Initial Pose in the context of IK. It is animatable, meaning that at different time, IK may start iteration from different poses.
Let's call the plane that the joints of an IK chain the (IK) solver plane. InitPlane() and InitEEAxis() returns the normal to the solver plane and the axis from the start joint to the end joint (end-effector axis) at the initial (preferred angle) pose, at time of input argument. They are represented in the parent space of the start joint. ChainNormal() returns the normal in the object space, as
InitPlane() == ChainNormal() * startIKCont->PrefRotation()
where
startIKCont = (IIKControl*)StartJoint()->GetController()->GetInterface(I_IKControl);
Furthermore, ChainNormal() takes as an input argument a validity interval that will be intersected by the validity interval of the chain normal.
Prototype:
virtual Point3 InitPlane(TimeValue)
Remarks:
Please refer to ChainNormal().
Prototype:
virtual Point3 InitEEAxis(TimeValue)
Remarks:
Please refer to ChainNormal().
Prototype:
virtual float InitChainLength(TimeValue)
Remarks:
Please refer to ChainNormal().
Prototype:
virtual float SwivelAngle(TimeValue t, Interval& valid)
The swivel angle at time. The validity interval, valid, will be intersected.
Prototype:
virtual const IKSys::ZeroPlaneMap* DefaultZeroPlaneMap(TimeValue)
The zero plane is the plane that, at each "start joint to end joint" axis, is used as a reference plane with regard to that the swivel angle is defined. The zero plane map maps an axis to a plane normal. The IK system offers as a possible default via DefaultZeroPlaneMap().
Prototype:
virtual SAParentSpace SwivelAngleParent() const
Whether the zero plane is defined in the parent space of the start joint, kSAInStartJoint, or in the space of the IK goal, kSAInGoal.
Prototype:
virtual Solver() const
The solver that is assigned to this chain.
Prototype:
virtual bool SolverEnabled(TimeValue, Interval& valid)
Whether the solver is enabled (IK mode) or not (FK mode).
Prototype:
virtual bool CanAutoEnable() const
When the chain is in the FK mode, IK can still be invoked when the goal is moved interactively if CanAutoEnabled() is true. It is a PB2 parameter of index kAutoEnable. It is not animatable.
Prototype:
virtual bool AutoEnableSet() const
It is a transient state that is alive only at the time when joint angles are to be updated. Being true means that the Enabled state of the chain is off the IK is turned on by interactive manipulation.
Prototype:
virtual bool Valid() const
Whether this chain is a valid one. It is valid if it is assigned a proper IK solver and it has valid start joint and end joint.
Prototype:
virtual Interface_ID GoalInterfaceID()
What IK goal interface this chain is prepaired for. For now, there are two interfaces: HI IK goal (IHIIKGoal) and Spline IK goal (ISplineIKGoal). An IK chain will admit of plugin solvers that support this goal interface (IKSolver::ExpectGoal()).
Prototype:
virtual BaseInterface* AcquireGoal(TimeValue, Interval& valid, const Matrix3& parent_of_start_joint)
It returns an interface to the goal at the time. Validity interval is reconciled. The parent matrix of the start joint is also returned in the third argument.