Link Class Reference

#include <ikhierarchy.h>

Class 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.
+ 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. 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...
 

Member Enumeration Documentation

enum DofAxis
Enumerator
TransX 
TransY 
TransZ 
RotX 
RotY 
RotZ 
285  {
286  TransX,
287  TransY,
288  TransZ,
289  RotX,
290  RotY,
291  RotZ
292  };

Constructor & Destructor Documentation

Link ( )
inline
Remarks
Constructor.
Default Implementation:
{ }
280 :rigidExtend(0),dofAxis(RotZ){}
Remarks
Destructor.
Default Implementation:
{ if (rigidExtend) delete rigidExtend; rigidExtend = 0; }

Member Function Documentation

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; }
301 {return rigidExtend?false:true;}
bool ZeroLength ( ) const
inline
Remarks
This method checks whether the link has no length. When TRUE, it is a pure rotation matrix.
304  {
305  return NullLink() ? true :
306  (rigidExtend->GetIdentFlags() & POS_IDENT) ? true : false; }
#define POS_IDENT
Definition: matrix3.h:22
DWORD GetIdentFlags() const
Definition: matrix3.h:129
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; }
311 { return llimited?true:false; }
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; }
316 { return ulimited?true:false; }
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()
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.
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.
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.
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.
357 { llimited = s?1:0; }
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.
363 { ulimited = s?1:0; }
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
float dofValue
float initValue
Point2 limits