Class LinkChain
Description:
This class is only available in release 5 or later.
This class abstracts the data structure that the IK system pass to the plugin solver. With it, an IK problem becomes a pure mathematical one to the plugin solver.
A LinkChain starts with a rootLink, followed by a number of 1D link. The rootLink has a whole rotation (c.f. class RootLink in ikHierarch.h), as represented by Euler angles of order XYZ, rotXYZ. These angles may be marked as active or not. The RootLink exposes the whole rotation to allow the solver to handle the start joint specially.
The next 1D link is to be pivoted and aligned at the reference frame that is offset from the rotation of the RootLink by "rigidExtend”.
Methods:
Prototype:
Matrix3 parentMatrix
Remarks:
This LinkChain is originally cut off from a transformation space quantified by this matrix. Specifically, it is the matrix that accumulates all transformations from the root of the world to the position component of the start joint.
Prototype:
unsigned LinkCount() const
Remarks:
The number of 1D links following the rootLink.
Prototype:
const Link& LinkOf(unsigned i) const
Remarks:
The i-th 1D link. The next link is pivoted and aligned at
LinkOf(i).LinkMatrix(true) * LinkOf(i-1).LinkMatrix(true) ... * LinkOf(0).LinkMatrix(true) * rootLink.LinkMatrix(true)
This is the extremity after the i-th link. The position of the end effector, in particular, is the extremity of the last link.
Prototype:
Link& LinkOf(unsigned i)
Remarks:
Please refer to the above entry for full explanation.
Prototype:
int PreBone(unsigned i) const
Remarks:
A 1D link comprises a degree of freedom, which can be rotational or prismatic (sliding), and an offset transfromation, "rigidExtend". If the length of "rigidExtend" is zero, the next 1D link comes from same joint of this link. PreBone(i) returns the first link that precedes the i-th link that has non-zero "rigidExtend." In other words, LinkOf(PreBone(i) + 1) starts a new joint that includes i-th link as one of its degrees of freedom. PreBone(i) is always less then i.
Prototype:
unsigned Bone(unsigned i) const
Remarks:
Bone(i) returns the first index, j, such that j >= i and LinkOf(j).ZeroLength() false. This is the last link of the bone that includes i-th link as a degree of freedom.
Prototype:
BaseInterface* GetIKGoal()
Remarks:
Returns an interface pointer to the goal. The actual type of goal can be queried from the interface. (They are documented separately.)
Prototype:
void SetIKGoal(BaseInterface*)
Remarks:
They are used to set and release the goal. The plugin solver should not worried about it. The IK system will use them to the set and release the goal.
Prototype:
void ReleaseIKGoal()
Remarks:
Please refer to SetIKGoal() for full explanation.