IIKChainControl Class Reference

#include <iiksys.h>

Class Description

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.

+ Inheritance diagram for IIKChainControl:

Public Types

enum  IIKChainControlReferenceIndex {
  kPBlockRef = 0, kGoalTMRef, kEndJointRef, kEnableRef,
  kStartJointRef, kOwningNodeRef, kLastRef
}
 
enum  IIKChainControlParameterBlockIndex { kParamBlock, kNumParamBlocks }
 
enum  IIKChainControlParameterIndex {
  kStartJoint, kEndJoint, kSolverName, kAutoEnable,
  kSwivel, kPosThresh, kRotThresh, kIteration,
  kEEDisplay, kEESize, kGoalDisplay, kGoalSize,
  kVHDisplay, kVHSize, kVHLength, kSolverDisplay,
  kAutoSnap, kVHUseTarget, kVHTarget, kSAParent,
  kLastHIIKParam
}
 
enum  SplineIKParams {
  kPickShape = kLastHIIKParam, kTwistHStartDisplay, kTwistHEndDisplay, kTwistHStartSize,
  kTwistHEndSize, kTwistHStartLength, kTwistHEndLength, kTwistHStartAngle,
  kTwistHEndAngle, kAutoSplineCreate, kSplineTypeChoice, kSplineKnotCount,
  kCreateHelper, kLinktoRootNode, kHelpersize, kHelperCentermarker,
  kHelperAxisTripod, kHelperCross, kHelperBox, kHelperScreensize,
  kHelperDrawontop, kUpnode, kUseUpnode, kLastSplineIKParam
}
 
enum  SAParentSpace { kSAInGoal, kSAInStartJoint }
 

Public Member Functions

virtual float TwistHStartAngle (TimeValue, Interval &)=0
 
virtual float TwistHEndAngle (TimeValue, Interval &)=0
 
virtual INodeStartJoint () const =0
 
virtual INodeEndJoint () const =0
 
virtual INodeGetNode () const =0
 
virtual Point3 ChainNormal (TimeValue t, Interval &valid)=0
 
virtual Point3 InitPlane (TimeValue t)=0
 
virtual Point3 InitEEAxis (TimeValue t)=0
 
virtual float InitChainLength (TimeValue t)=0
 
virtual float SwivelAngle (TimeValue, Interval &)=0
 The swivel angle at time. More...
 
virtual const IKSys::ZeroPlaneMapDefaultZeroPlaneMap (TimeValue t)=0
 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. More...
 
virtual SAParentSpace SwivelAngleParent () const =0
 Whether the zero plane is defined in the parent space of the start joint, kSAInStartJoint, or in the space of the IK goal, kSAInGoal. More...
 
virtual IKSolverSolver () const =0
 The solver that is assigned to this chain. More...
 
virtual bool SolverEnabled (TimeValue, Interval *=0)=0
 Whether the solver is enabled (IK mode) or not (FK mode). More...
 
virtual bool CanAutoEnable () const =0
 When the chain is in the FK mode, IK can still be invoked when the goal is moved interactively if CanAutoEnabled() is true. More...
 
virtual bool AutoEnableSet () const =0
 It is a transient state that is alive only at the time when joint angles are to be updated. More...
 
virtual bool Valid () const =0
 Whether this chain is a valid one. More...
 
virtual Interface_ID GoalInterfaceID () const =0
 What IK goal interface this chain is prepaired for. More...
 
virtual BaseInterfaceAcquireGoal (TimeValue, Interval &, const Matrix3 &parent_of_start_joint)=0
 It returns an interface to the goal at the time. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from MaxHeapOperators
static UtilExport voidoperator new (size_t size)
 Standard new operator used to allocate objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e)
 Standard new operator used to allocate objects if there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate objects that takes the type of memory, filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate arrays of objects. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport void operator delete (void *ptr)
 Standard delete operator used to deallocate an object If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an object If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an object that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, void *placement_ptr)
 Placement new operator. More...
 
static UtilExport void operator delete (void *ptr, void *placement_ptr)
 Placement delete operator. More...
 

Member Enumeration Documentation

Enumerator
kPBlockRef 
kGoalTMRef 
kEndJointRef 
kEnableRef 
kStartJointRef 
kOwningNodeRef 
kLastRef 
165  {
166  kPBlockRef = 0, // ParamBlock
167  kGoalTMRef, // Matrix3 controller
168  kEndJointRef, // INode
169  kEnableRef, // Bool (float) controller
170  kStartJointRef, // INode
171  kOwningNodeRef, // Reference on a NodeMonitor that holds an indirect reference on the owning Node
172  kLastRef
173  };
Definition: iiksys.h:166
Definition: iiksys.h:169
Definition: iiksys.h:170
Definition: iiksys.h:171
Definition: iiksys.h:172
Definition: iiksys.h:167
Definition: iiksys.h:168
Enumerator
kParamBlock 
kNumParamBlocks 
176  {
177  kParamBlock,
179  };
Definition: iiksys.h:178
Definition: iiksys.h:177
Enumerator
kStartJoint 
kEndJoint 
kSolverName 
kAutoEnable 
kSwivel 
kPosThresh 
kRotThresh 
kIteration 
kEEDisplay 
kEESize 
kGoalDisplay 
kGoalSize 
kVHDisplay 
kVHSize 
kVHLength 
kSolverDisplay 
kAutoSnap 
kVHUseTarget 
kVHTarget 
kSAParent 
kLastHIIKParam 
182  {
183  kStartJoint, // INode, referenced by kStartJointRef
184  kEndJoint, // INode, referenced by kEndJointRef
185  kSolverName, // String
186  kAutoEnable, // BOOL
187  kSwivel, // Angle
188  kPosThresh, // Float
189  kRotThresh, // Float
190  kIteration, // Integer
191  kEEDisplay, // BOOL
192  kEESize, // Float
193  kGoalDisplay, // BOOL
194  kGoalSize, // Float
195  kVHDisplay, // BOOL
196  kVHSize, // Float
197  kVHLength, // Float
198  kSolverDisplay, // BOOL
199  kAutoSnap, // BOOL
200  kVHUseTarget, // BOOL
201  kVHTarget, // INode
202  kSAParent, // RadioBtn_Index
204  };
Definition: iiksys.h:191
Definition: iiksys.h:192
Definition: iiksys.h:199
Definition: iiksys.h:188
Definition: iiksys.h:189
Definition: iiksys.h:190
Definition: iiksys.h:185
Definition: iiksys.h:186
Definition: iiksys.h:202
Definition: iiksys.h:184
Definition: iiksys.h:187
Definition: iiksys.h:197
Definition: iiksys.h:183
Definition: iiksys.h:200
Definition: iiksys.h:203
Definition: iiksys.h:201
Definition: iiksys.h:194
Definition: iiksys.h:195
Definition: iiksys.h:196
Definition: iiksys.h:193
Definition: iiksys.h:198
Enumerator
kSAInGoal 
kSAInStartJoint 
286  {
287  kSAInGoal,
289  };
Definition: iiksys.h:288
Definition: iiksys.h:287

Member Function Documentation

virtual float TwistHStartAngle ( TimeValue  ,
Interval  
)
pure virtual
virtual float TwistHEndAngle ( TimeValue  ,
Interval  
)
pure virtual
virtual INode* StartJoint ( ) const
pure virtual
Remarks
The start joint, end joint of the chain, and the node to that this IK chain controller belongs.

virtual INode* EndJoint ( ) const
pure virtual
Remarks
Please refer to StartJoint().

virtual INode* GetNode ( ) const
pure virtual
Remarks
Please refer to StartJoint().

virtual Point3 ChainNormal ( TimeValue  t,
Interval valid 
)
pure virtual
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.

virtual Point3 InitPlane ( TimeValue  t)
pure virtual
Remarks
Please refer to ChainNormal().
virtual Point3 InitEEAxis ( TimeValue  t)
pure virtual
Remarks
Please refer to ChainNormal().
virtual float InitChainLength ( TimeValue  t)
pure virtual
Remarks
Please refer to ChainNormal().
virtual float SwivelAngle ( TimeValue  ,
Interval  
)
pure virtual

The swivel angle at time.

The validity interval, valid, will be intersected.

virtual const IKSys::ZeroPlaneMap* DefaultZeroPlaneMap ( TimeValue  t)
pure virtual

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().

virtual SAParentSpace SwivelAngleParent ( ) const
pure virtual

Whether the zero plane is defined in the parent space of the start joint, kSAInStartJoint, or in the space of the IK goal, kSAInGoal.



virtual IKSolver* Solver ( ) const
pure virtual

The solver that is assigned to this chain.



virtual bool SolverEnabled ( TimeValue  ,
Interval = 0 
)
pure virtual

Whether the solver is enabled (IK mode) or not (FK mode).



virtual bool CanAutoEnable ( ) const
pure virtual

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.

virtual bool AutoEnableSet ( ) const
pure virtual

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.

virtual bool Valid ( ) const
pure virtual

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.

virtual Interface_ID GoalInterfaceID ( ) const
pure virtual

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()).

virtual BaseInterface* AcquireGoal ( TimeValue  ,
Interval ,
const Matrix3 parent_of_start_joint 
)
pure virtual

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.