IterJoint Class Reference


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());

#include <ikhierarchy.h>

Inheritance diagram for IterJoint:
Inheritance graph
[legend]

List of all members.

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.
void  SetSkipSliding (bool skip)
CoreExport void  Begin (bool in_world)
CoreExport JointType  GetJointType () const
int  DofCount () const
CoreExport JointAxes  GetJointAxes () const
const Matrix3 ProximalFrame () const
const Matrix3 DistalFrame () 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 ()

Member Enumeration Documentation


Constructor & Destructor Documentation

IterJoint ( LinkChain lc ) [inline]
        : mLinkChain(lc) , mSkipSlide(false)
    {
        // Empty ctor
    }

Member Function Documentation

CoreExport void InitJointAngles ( )

Set all joint angles to the respective initial values.

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().
{ mSkipSlide = skip; }
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.
CoreExport JointType GetJointType ( ) const
Remarks:
Whether this joint is rotational or sliding.
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.
{ return mBegin == -1 ? 3: mEnd - mBegin; }
CoreExport JointAxes GetJointAxes ( ) const
Remarks:
Please refer to DofCount() for full explanation.
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.
{ return mMat0; }
const Matrix3& DistalFrame ( ) const [inline]
Remarks:
Please refer to ProximalFrame() for full explanation.
{ return mMat; }
Point3 Pivot ( ) const [inline]
Remarks:
Please refer to ProximalFrame() for full explanation.
{ return mMat0.GetTrans(); }
Point3 DistalEnd ( ) const [inline]
Remarks:
Please refer to ProximalFrame() for full explanation.
{ return mMat.GetTrans(); }
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.
CoreExport Point3 GetJointAngles ( ) const
Remarks:
Please refer to SetJointAngles() for full explanation.
CoreExport bool Next ( )
Remarks:
Use Next() to move to the next joint, until it returns false.

CoreExport void SkipSliding ( ) [protected]

IterJoint IterJoint IterJoint IterJoint IterJoint IterJoint IterJoint IterJoint IterJoint IterJoint
IterJoint IterJoint IterJoint IterJoint IterJoint IterJoint IterJoint IterJoint IterJoint IterJoint