3ds Max C++ API Reference
LinkChain Class Reference

#include <ikhierarchy.h>

+ Inheritance diagram for LinkChain:

Public Member Functions

 LinkChain ()
 
CoreExport LinkChain (unsigned lc)
 
virtual CoreExport ~LinkChain ()
 
virtual voidGetInterface (ULONG i) const
 
const LinkLinkOf (unsigned i) const
 
LinkLinkOf (unsigned i)
 
unsigned LinkCount () const
 
CoreExport int PreBone (unsigned i) const
 
CoreExport unsigned Bone (unsigned i) const
 
BaseInterfaceGetIKGoal ()
 
void SetIKGoal (BaseInterface *ikgoal)
 
CoreExport void ReleaseIKGoal ()
 

Public Attributes

Matrix3 parentMatrix
 
RootLink rootLink
 

Protected Member Functions

CoreExport void SetLinkCount (unsigned lc)
 

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

Description:
This class is only available in release 5 or later.

This class abstracts the data structure that the IK system pass to the plugin solver. With it, an IK problem becomes a pure mathematical one to the plugin solver.

A LinkChain starts with a rootLink, followed by a number of 1D link. The rootLink has a whole rotation (c.f. class RootLink in ikHierarch.h), as represented by Euler angles of order XYZ, rotXYZ. These angles may be marked as active or not. The RootLink exposes the whole rotation to allow the solver to handle the start joint specially.

The next 1D link is to be pivoted and aligned at the reference frame that is offset from the rotation of the RootLink by "rigidExtend".

Constructor & Destructor Documentation

◆ LinkChain() [1/2]

LinkChain ( )
inline
452 :links(0),linkCount(0) {}

◆ LinkChain() [2/2]

CoreExport LinkChain ( unsigned  lc)

◆ ~LinkChain()

virtual CoreExport ~LinkChain ( )
virtual

Member Function Documentation

◆ GetInterface()

virtual void* GetInterface ( ULONG  i) const
inlinevirtual
455 { UNUSED_PARAM(i); return NULL; }
#define UNUSED_PARAM(x)
Definition: BuildWarnings.h:18
#define NULL
Definition: autoptr.h:18

◆ LinkOf() [1/2]

const Link& LinkOf ( unsigned  i) const
inline
Remarks
The i-th 1D link. The next link is pivoted and aligned at

LinkOf(i).LinkMatrix(true) * LinkOf(i-1).LinkMatrix(true) ... * LinkOf(0).LinkMatrix(true) * rootLink.LinkMatrix(true)

This is the extremity after the i-th link. The position of the end effector, in particular, is the extremity of the last link.
468 {return links[i];}

◆ LinkOf() [2/2]

Link& LinkOf ( unsigned  i)
inline
Remarks
Please refer to the above entry for full explanation.

471 {return links[i];}

◆ LinkCount()

unsigned LinkCount ( ) const
inline
Remarks
The number of 1D links following the rootLink.

474 { return linkCount; }

◆ PreBone()

CoreExport int PreBone ( unsigned  i) const
Remarks
A 1D link comprises a degree of freedom, which can be rotational or prismatic (sliding), and an offset transfromation, "rigidExtend". If the length of "rigidExtend" is zero, the next 1D link comes from same joint of this link. PreBone(i) returns the first link that precedes the i-th link that has non-zero "rigidExtend." In other words, LinkOf(PreBone(i) + 1) starts a new joint that includes i-th link as one of its degrees of freedom. PreBone(i) is always less then i.

◆ Bone()

CoreExport unsigned Bone ( unsigned  i) const
Remarks
Bone(i) returns the first index, j, such that j >= i and LinkOf(j).ZeroLength() false. This is the last link of the bone that includes i-th link as a degree of freedom.

◆ GetIKGoal()

BaseInterface* GetIKGoal ( )
inline
Remarks
Returns an interface pointer to the goal. The actual type of goal can be queried from the interface. (They are documented separately.)

494 { return ikGoal; }

◆ SetIKGoal()

void SetIKGoal ( BaseInterface ikgoal)
inline
Remarks
They are used to set and release the goal. The plugin solver should not worried about it. The IK system will use them to the set and release the goal.

499 { ikGoal = ikgoal; }

◆ ReleaseIKGoal()

CoreExport void ReleaseIKGoal ( )
Remarks
Please refer to SetIKGoal() for full explanation.

◆ SetLinkCount()

CoreExport void SetLinkCount ( unsigned  lc)
protected

Member Data Documentation

◆ parentMatrix

Matrix3 parentMatrix
Remarks
This LinkChain is originally cut off from a transformation space quantified by this matrix. Specifically, it is the matrix that accumulates all transformations from the root of the world to the position component of the start joint.

◆ rootLink

RootLink rootLink