Link Class Reference
 
 
 
Link Class Reference

This reference page is linked to from the following overview topics: Inverse Kinematics, IIKChainControl.


#include <ikhierarchy.h>

Inheritance diagram for Link:
MaxHeapOperators

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.

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 Matrix3 DofMatrix (Matrix3 &mat) const
CoreExport Matrix3  LinkMatrix (bool include_dof=true) const
CoreExport Matrix3 ApplyLinkMatrix (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

Member Enumeration Documentation


Constructor & Destructor Documentation

Link ( ) [inline]
Remarks:
Constructor.
Default Implementation:
{ }
:rigidExtend(0),dofAxis(RotZ){}
CoreExport ~Link ( )
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; }
{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.
                                           {
          return NullLink() ? true :
                (rigidExtend->GetIdentFlags() & POS_IDENT) ? true : false; }
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; }
{ 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; }
{ 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.
{ 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.
{ 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