3ds Max C++ API Reference
IIKChainControl Class Referenceabstract

#include <iiksys.h>

+ 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...
 
static UtilExport voidaligned_malloc (size_t size, size_t alignment)
 Allocates memory on a specified alignment boundary. More...
 
static UtilExport voidaligned_realloc (void *ptr, size_t size, size_t alignment)
 Reallocates memory on a specified alignment boundary. More...
 
static UtilExport void aligned_free (void *ptr)
 Frees a block of memory that was allocated with aligned_malloc/aligned_realloc. More...
 

Detailed 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);
Definition: iiksys.h:161
From this pointer, we can get all properties pertinent to an IK Chain.

Member Enumeration Documentation

◆ IIKChainControlReferenceIndex

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  };
@ kStartJointRef
Definition: iiksys.h:170
@ kPBlockRef
Definition: iiksys.h:166
@ kGoalTMRef
Definition: iiksys.h:167
@ kOwningNodeRef
Definition: iiksys.h:171
@ kEnableRef
Definition: iiksys.h:169
@ kEndJointRef
Definition: iiksys.h:168
@ kLastRef
Definition: iiksys.h:172

◆ IIKChainControlParameterBlockIndex

Enumerator
kParamBlock 
kNumParamBlocks 
176  {
177  kParamBlock,
179  };
@ kNumParamBlocks
Definition: iiksys.h:178
@ kParamBlock
Definition: iiksys.h:177

◆ IIKChainControlParameterIndex

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  };
@ kAutoEnable
Definition: iiksys.h:186
@ kSwivel
Definition: iiksys.h:187
@ kSAParent
Definition: iiksys.h:202
@ kSolverName
Definition: iiksys.h:185
@ kVHDisplay
Definition: iiksys.h:195
@ kGoalSize
Definition: iiksys.h:194
@ kPosThresh
Definition: iiksys.h:188
@ kEEDisplay
Definition: iiksys.h:191
@ kEndJoint
Definition: iiksys.h:184
@ kSolverDisplay
Definition: iiksys.h:198
@ kVHLength
Definition: iiksys.h:197
@ kLastHIIKParam
Definition: iiksys.h:203
@ kGoalDisplay
Definition: iiksys.h:193
@ kAutoSnap
Definition: iiksys.h:199
@ kStartJoint
Definition: iiksys.h:183
@ kVHTarget
Definition: iiksys.h:201
@ kIteration
Definition: iiksys.h:190
@ kRotThresh
Definition: iiksys.h:189
@ kVHUseTarget
Definition: iiksys.h:200
@ kVHSize
Definition: iiksys.h:196
@ kEESize
Definition: iiksys.h:192

◆ SAParentSpace

Enumerator
kSAInGoal 
kSAInStartJoint 
286  {
287  kSAInGoal,
289  };
@ kSAInGoal
Definition: iiksys.h:287
@ kSAInStartJoint
Definition: iiksys.h:288

Member Function Documentation

◆ TwistHStartAngle()

virtual float TwistHStartAngle ( TimeValue  ,
Interval  
)
pure virtual

◆ TwistHEndAngle()

virtual float TwistHEndAngle ( TimeValue  ,
Interval  
)
pure virtual

◆ StartJoint()

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.

◆ EndJoint()

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

◆ GetNode()

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

◆ ChainNormal()

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.

◆ InitPlane()

virtual Point3 InitPlane ( TimeValue  t)
pure virtual
Remarks
Please refer to ChainNormal().

◆ InitEEAxis()

virtual Point3 InitEEAxis ( TimeValue  t)
pure virtual
Remarks
Please refer to ChainNormal().

◆ InitChainLength()

virtual float InitChainLength ( TimeValue  t)
pure virtual
Remarks
Please refer to ChainNormal().

◆ SwivelAngle()

virtual float SwivelAngle ( TimeValue  ,
Interval  
)
pure virtual

The swivel angle at time.

The validity interval, valid, will be intersected.

◆ DefaultZeroPlaneMap()

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

◆ SwivelAngleParent()

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.



◆ Solver()

virtual IKSolver* Solver ( ) const
pure virtual

The solver that is assigned to this chain.



◆ SolverEnabled()

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

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



◆ CanAutoEnable()

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.

◆ AutoEnableSet()

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.

◆ Valid()

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.

◆ GoalInterfaceID()

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

◆ AcquireGoal()

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.