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

#include <ikhierarchy.h>

+ Inheritance diagram for Link:

Public Types

enum  DofAxis {
  TransX , TransY , TransZ , RotX ,
  RotY , RotZ
}
 

Public Member Functions

 Link ()
 
CoreExport ~Link ()
 
bool NullLink () const
 
bool ZeroLength () const
 
bool LLimited () const
 
bool ULimited () const
 
CoreExport Matrix3 DofMatrix () const
 
CoreExport Matrix3DofMatrix (Matrix3 &mat) const
 
CoreExport Matrix3 LinkMatrix (bool include_dof=true) const
 
CoreExport Matrix3ApplyLinkMatrix (Matrix3 &mat, bool include_dof=true) const
 
void SetLLimited (bool s)
 
void SetULimited (bool s)
 
CoreExport void SetRigidExtend (const Matrix3 &mat)
 

Public Attributes

DofAxis dofAxis
 
float dofValue
 
float initValue
 
Point2 limits
 

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 RootLink, Class Matrix3, Class Point3, Inverse Kinematics

Description:
This class represents a single link in the link chain. A Link is a single degree of freedom rotation followed by a rigidExtend. The DOF axis is specified by dofAxis. It is always active.
Data Members:
DofAxis dofAxis;

The variable part of a Link is of one degree of freedom. It can be translational or rotational. One of the following; TransX, TransY, TransZ, RotX, RotY, or RotZ.

float dofValue;

The current value with regard to the degree of freedom.

float initValue;

The initial value.

Point2 limits;

The constrained lower and upper limits. [0] for the lower limit and [1] for the upper limit.

private:

Matrix3 rigidExtend;

The rigid extents.

byte llimited : 1;

Lower limit flag.

byte ulimited : 1;

Upper limit flag.

Member Enumeration Documentation

◆ DofAxis

enum DofAxis
Enumerator
TransX 
TransY 
TransZ 
RotX 
RotY 
RotZ 
288 {
289 TransX,
290 TransY,
291 TransZ,
292 RotX,
293 RotY,
294 RotZ
295 };

Constructor & Destructor Documentation

◆ Link()

Link ( )
inline
Remarks
Constructor.
Default Implementation:
{ }
283:rigidExtend(0),dofAxis(RotZ){}

◆ ~Link()

Remarks
Destructor.
Default Implementation:
{ if (rigidExtend) delete rigidExtend; rigidExtend = 0; }

Member Function Documentation

◆ NullLink()

bool NullLink ( ) const
inline
Remarks
This method checks whether the link is a null-link. When TRUE, the rigid extend is logically an identity matrix.
Default Implementation:
{ return rigidExtend?false:true; }
304{return rigidExtend?false:true;}

◆ ZeroLength()

bool ZeroLength ( ) const
inline
Remarks
This method checks whether the link has no length. When TRUE, it is a pure rotation matrix.
307 {
308 return NullLink() ? true :
309 (rigidExtend->GetIdentFlags() & POS_IDENT) ? true : false; }
uint32_t GetIdentFlags() const
#define POS_IDENT
Definition: matrix3.h:34

◆ LLimited()

bool LLimited ( ) const
inline
Remarks
This method checks whether the degree of freedom is further constrained by lower limits. TRUE if constrained, otherwise FALSE.
Default Implementation:
{ return llimited?true:false; }
314{ return llimited?true:false; }

◆ ULimited()

bool ULimited ( ) const
inline
Remarks
This method checks whether the degree of freedom is further constrained by upper limits. TRUE if constrained, otherwise FALSE.
Default Implementation:
{ return ulimited?true:false; }
319{ return ulimited?true:false; }

◆ DofMatrix() [1/2]

CoreExport Matrix3 DofMatrix ( ) const
Remarks
This mehod returns the matrix contribution by the degrees of freedom. Either it is a pure rotation or a pure translation, of one axis. The following identity holds;

LinkMatrix(true) == LinkMatrix(false) * DofMatrix()

◆ DofMatrix() [2/2]

CoreExport Matrix3 & DofMatrix ( Matrix3 mat) const
Remarks
This method allows you to apply a matrix, mat, by the DofMatrix() so that mat = mat * DofMatrix().
Parameters:
Matrix3& mat

The matrix to multiply by the DOF matrix.
Returns
A reference to the matrix argument.

◆ LinkMatrix()

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

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_dof = true 
) const
Remarks
This methods applies the LinkMatrix() to the input matrix.
Parameters:
Matrix3& mat

The input matrix.

bool include_dof = true

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.

◆ SetLLimited()

void SetLLimited ( bool  s)
inline
Remarks
This method allows you to activate or deactivate the lower limits.
Parameters:
bool s

TRUE to activate, FALSE to deactivate.
360{ llimited = s?1:0; }

◆ SetULimited()

void SetULimited ( bool  s)
inline
Remarks
This method allows you to activate or deactivate the upper limits.
Parameters:
bool s

TRUE to activate, FALSE to deactivate.
366{ ulimited = s?1:0; }

◆ SetRigidExtend()

CoreExport void SetRigidExtend ( const Matrix3 mat)
Remarks
This method allows you to set the RigidEtend matrix.
Parameters:
const Matrix3& mat

The rigid extend matrix you wish to set.

Member Data Documentation

◆ dofAxis

DofAxis dofAxis

◆ dofValue

float dofValue

◆ initValue

float initValue

◆ limits

Point2 limits