3ds Max C++ API Reference
Loading...
Searching...
No Matches
RootLink Class Reference

#include <ikhierarchy.h>

+ Inheritance diagram for RootLink:

Public Member Functions

 RootLink ()
 
bool GetActive (unsigned i) const
 
bool GetLLimited (unsigned i) const
 
bool GetULimited (unsigned i) const
 
CoreExport Matrix3RotateByAxis (Matrix3 &mat, unsigned i) const
 
CoreExport Matrix3 LinkMatrix (bool include_rot) const
 
CoreExport Matrix3ApplyLinkMatrix (Matrix3 &mat, bool include_rot) const
 
CoreExport void SetActive (unsigned i, bool s)
 
CoreExport void SetLLimited (unsigned i, bool s)
 
CoreExport void SetULimited (unsigned i, bool s)
 

Public Attributes

Point3 rotXYZ
 
Point3 initXYZ
 
Point3 llimits
 
Point3 ulimits
 
Matrix3 rigidExtend
 

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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
static UtilExport voidoperator new[] (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate arrays of objects.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
static UtilExport voidoperator new (size_t size, void *placement_ptr)
 Placement new operator.
 
static UtilExport void operator delete (void *ptr, void *placement_ptr)
 Placement delete operator.
 
static UtilExport voidaligned_malloc (size_t size, size_t alignment)
 Allocates memory on a specified alignment boundary.
 
static UtilExport voidaligned_realloc (void *ptr, size_t size, size_t alignment)
 Reallocates memory on a specified alignment boundary.
 
static UtilExport void aligned_free (void *ptr)
 Frees a block of memory that was allocated with aligned_malloc/aligned_realloc.
 

Detailed Description

See also
Class LinkChain, Class Link, Class Matrix3, Class Point3, Inverse Kinematics

Description:
A RootLink consists of a rotation plus a rigidExtend. It transforms like this:

To_Coordinate_Frame = rigidExtend * rotXYZ * From_Coordinate_Frame

where rotXYZ = Rot_x(rotXYZ[0]) * Rot_y(rotXYZ[1]) * Rot_z(rotXYZ[2]).

Note that not all the x, y, and z, are degrees of freedom. Only Active() ones are. We put the whole rotation here so that some solver may choose to use it as a full rotation and then clamp the result to the permissible range.
Data Members:
Point3 rotXYZ;

The xyz rotation.

Point3 initXYZ;

Corresponds to the PrefRotation() of the Start Joint.

Point3 llimits;

The lower limits.

Point3 ulimits;

The upper limits.

Matrix3 rigidExtend;

The rigid extents.

private:

unsigned flags;

The root link flags.

Constructor & Destructor Documentation

◆ RootLink()

RootLink ( )
inline
Remarks
Constructor.
Default Implementation:
{ }
128:flags(7){} // x,y,z, are all active. No joint limits.

Member Function Documentation

◆ GetActive()

bool GetActive ( unsigned  i) const
inline
Remarks
This method informs the Solver whether a particular component is active.
Parameters:
unsigned i

The component, 0 through 3 for x, y, and z, respectively.
Returns
TRUE if the specified component is active, otherwise FALSE.
Default Implementation:
{ return flags&(1<<i)?true:false; }
142{ return flags&(1<<i)?true:false;}

◆ GetLLimited()

bool GetLLimited ( unsigned  i) const
inline
Remarks
This method informs the Solver whether a particular component has its lower limits active.
Parameters:
unsigned i

The component, 0 through 3 for x, y, and z, respectively.
Returns
TRUE if the specified component is active, otherwise FALSE.
Default Implementation:
{ return flags&(1<<(i+3))?true:false; }
151{ return flags&(1<<(i+3))?true:false;}

◆ GetULimited()

bool GetULimited ( unsigned  i) const
inline
Remarks
This method informs the Solver whether a particular component has its upper limits active.
Parameters:
unsigned i

The component, 0 through 3 for x, y, and z, respectively.
Returns
TRUE if the specified component is active, otherwise FALSE.
Default Implementation:
{ return flags&(1<<(i+6))?true:false; }
160{ return flags&(1<<(i+6))?true:false;}

◆ RotateByAxis()

CoreExport Matrix3 & RotateByAxis ( Matrix3 mat,
unsigned  i 
) const
Remarks
This method will pre-apply the rotation about the x, y, or z axis. Therefore, starting with the identity matrix mat,

ApplyLinkMatrix(

RotateByAxis(

RotateByAxis(

RotateByAxis(mat, 2),

1),

0),

false)

should equal to LinkMatrix(true).
Parameters:
unsigned i

The component, 0 through 3 for x, y, and z, respectively.

◆ LinkMatrix()

CoreExport Matrix3 LinkMatrix ( bool  include_rot) const
Remarks
This method returns the link matrix just defined if the argument is TRUE.
Parameters:
bool include_rot

TRUE to return the link matrix, FALSE to return RigidExtend.
Returns
The link matrix, otherwise it simply returns RigidExtend.

◆ ApplyLinkMatrix()

CoreExport Matrix3 & ApplyLinkMatrix ( Matrix3 mat,
bool  include_rot 
) const
Remarks
This methods applies the LinkMatrix() to the input matrix, or mat = mat * LinkMatrix(include_rot)
Parameters:
Matrix3& mat

The input matrix.

bool include_rot

When applying the DOF part, or rotation part, to a matrix, this will take place one at a time by calling RootLink::RotateByAxis(). If you want to apply the whole link, while already having applied the rotation part, you would need to set this flag to FALSE.
Returns
The reference to the input matrix, mat.

◆ SetActive()

CoreExport void SetActive ( unsigned  i,
bool  s 
)
Remarks
This method allows you to activate or deactivate a particular component.
Parameters:
unsigned i

The component, 0 through 3 for x, y, and z, respectively.

bool s

TRUE to activate, FALSE to deactivate.

◆ SetLLimited()

CoreExport void SetLLimited ( unsigned  i,
bool  s 
)
Remarks
This method allows you to activate or deactivate a particular component's lower limits.
Parameters:
unsigned i

The component, 0 through 3 for x, y, and z, respectively.

bool s

TRUE to activate, FALSE to deactivate.

◆ SetULimited()

CoreExport void SetULimited ( unsigned  i,
bool  s 
)
Remarks
This method allows you to activate or deactivate a particular component's upper limits.
Parameters:
unsigned i

The component, 0 through 3 for x, y, and z, respectively.

bool s

TRUE to activate, FALSE to deactivate.

Member Data Documentation

◆ rotXYZ

Point3 rotXYZ

◆ initXYZ

Point3 initXYZ

◆ llimits

Point3 llimits

◆ ulimits

Point3 ulimits

◆ rigidExtend

Matrix3 rigidExtend