3ds Max C++ API Reference
IterJoint Class Reference

#include <ikhierarchy.h>

+ Inheritance diagram for IterJoint:

Classes

struct  JointAxes
 

Public Types

enum  JointType { SlidingJoint , RotationalJoint }
 

Public Member Functions

 IterJoint (LinkChain &lc)
 
CoreExport void InitJointAngles ()
 Set all joint angles to the respective initial values. More...
 
void SetSkipSliding (bool skip)
 
CoreExport void Begin (bool in_world)
 
CoreExport JointType GetJointType () const
 
int DofCount () const
 
CoreExport JointAxes GetJointAxes () const
 
const Matrix3ProximalFrame () const
 
const Matrix3DistalFrame () const
 
Point3 Pivot () const
 
Point3 DistalEnd () const
 
CoreExport void SetJointAngles (const Point3 &)
 
CoreExport Point3 GetJointAngles () const
 
CoreExport bool Next ()
 

Protected Member Functions

CoreExport void SkipSliding ()
 

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.

LinkChain breaks joints, except for the root joint, of several degrees of freedom into 1 degree of freedom link. Sometimes, joints are more convenient. This is a helper class that helps to iterate over a LinkChain on the basis of joints. Suppose linkChain is a LinkChain, following code demonstrates how to iterate over joints.

IterJoint iter(linkChain);
iter.Begin(false); // The first pivot starts at (0,0,0). To start from linkChain.parentMatrix, use iter.Begin(true).
do
{
Point3 pivot_of_this_joint = iter.Pivot();
Point3 pivot_of_next_joint = iter.DistalEnd();
...
} while (iter.Next());
IterJoint(LinkChain &lc)
Definition: ikhierarchy.h:579
Definition: point3.h:56

Member Enumeration Documentation

◆ JointType

enum JointType
Enumerator
SlidingJoint 
RotationalJoint 
574  {
575  SlidingJoint,
577  };
@ SlidingJoint
Definition: ikhierarchy.h:575
@ RotationalJoint
Definition: ikhierarchy.h:576

Constructor & Destructor Documentation

◆ IterJoint()

IterJoint ( LinkChain lc)
inline
580  : mLinkChain(lc) , mSkipSlide(false)
581  {
582  // Empty ctor
583  }

Member Function Documentation

◆ InitJointAngles()

CoreExport void InitJointAngles ( )

Set all joint angles to the respective initial values.

◆ SetSkipSliding()

void SetSkipSliding ( bool  skip)
inline
Remarks
If a solver overrides "<b>bool IKSolver::UseSlidingJoint()</b>" to return false, the IK system will not include sliding joints in the LinkChain passed to the solver. If the LinkChain may include sliding joint, this method informs the iterator to skip, or not to skip, the sliding joint. It should be called before Begin().
595 { mSkipSlide = skip; }

◆ Begin()

CoreExport void Begin ( bool  in_world)
Remarks
Use Begin() to begin the iteration. The argument tells whether the pivot of the first joint starts at (0,0,0), if "in_world" is false, or at LinkChain::parentMatrix of the LinkChain that iterator works on.

◆ GetJointType()

CoreExport JointType GetJointType ( ) const
Remarks
Whether this joint is rotational or sliding.

◆ DofCount()

int DofCount ( ) const
inline
Remarks
The degrees of freedom of this joint and the axes of each degrees of freedom. JointAxes is string of chars. For 3-dof joint of order XYZ, for example, the JointAxes would be "xyz". For 2-dof XZ joint, it would be "_xz". Leading underscores are used to fill up the string to 3 chars long.
611 { return mBegin == -1 ? 3: mEnd - mBegin; }

◆ GetJointAxes()

CoreExport JointAxes GetJointAxes ( ) const
Remarks
Please refer to DofCount() for full explanation.

◆ ProximalFrame()

const Matrix3& ProximalFrame ( ) const
inline
Remarks
The proximal frame is the starting reference frame that this joint is aligned with. The distal frame is to be aligned with the proximal frame of the next joint.

Pivot() is the position of the proximal frame, and DistalEnd() is the position of the distal frame. The distance between is the length of the bone.
622 { return mMat0; }

◆ DistalFrame()

const Matrix3& DistalFrame ( ) const
inline
Remarks
Please refer to ProximalFrame() for full explanation.
626 { return mMat; }

◆ Pivot()

Point3 Pivot ( ) const
inline
Remarks
Please refer to ProximalFrame() for full explanation.
630 { return mMat0.GetTrans(); }
const Point3 & GetTrans() const

◆ DistalEnd()

Point3 DistalEnd ( ) const
inline
Remarks
Please refer to ProximalFrame() for full explanation.
634 { return mMat.GetTrans(); }

◆ SetJointAngles()

CoreExport void SetJointAngles ( const Point3 )
Remarks
Set and get joint angles. angles.x, angles.y, angles.z, correspond to the joint angles with regard to x-, y-, and z-axis. If the joint does not contain y-axis, for example, angles.y is not significant.

◆ GetJointAngles()

CoreExport Point3 GetJointAngles ( ) const
Remarks
Please refer to SetJointAngles() for full explanation.

◆ Next()

CoreExport bool Next ( )
Remarks
Use Next() to move to the next joint, until it returns false.

◆ SkipSliding()

CoreExport void SkipSliding ( )
protected