AlIKHandle

Interface to Inverse Kinematics Handles.

Synopsis

#include <AlIKHandle.h>
class AlIKHandle : public AlObject , public AlAnimatable
AlIKHandle( void );
virtual ~AlIKHandle();
virtual statusCode deleteObject();
virtual AlObject* copyWrapper() const;
virtual AlObjectType type() const;
statusCode createSingle( AlJoint*, AlJoint* );
statusCode createMulti( AlJoint*, AlJoint*,
AlIKHandleGoalType );
statusCode createSpline (AlJoint*, AlJoint*, AlCurveNode*, AlIKHandle*);
boolean on( void ) const;
AlIKHandleSolverType solverType( void ) const;
AlIKHandleGoalType goalType( void ) const;
double weight( void ) const;
AlIKHandleRotationOrder rotationOrder( void ) const;
boolean worldOrientation( void ) const;
statusCode restRotation( double[3] ) const;
AlJoint* root( void ) const;
AlJoint* endEffector( void ) const;
AlDagNode* rootNode( void ) const;
AlDagNode* endEffectorNode( void ) const;
AlIKHandlePositionType positionType( void ) const;
AlIKHandleTwistType twistType( void ) const;
AlCurveNode* curveNode( void ) const;
boolean oneJointHandle( void ) const;
boolean touchRootHandle( void ) const;
AlIKHandlePositionType splineChainPosition( double* ) const;
AlIKHandleTwistType splineChainTwist( double* ) const;
double splineChainRoll( void ) const;
statusCode setOn( boolean );
statusCode setGoalType( AlIKHandleGoalType );
statusCode setWeight( double );
statusCode setRotationOrder( AlIKHandleRotationOrder );
statusCode setWorldOrientation( boolean );
statusCode setRestRotation( const double[3] );
statusCode setPositionType( AlIKHandlePositionType );
statusCode setTwistType ( AlIKHandleTwistType );
AlIKHandleNode* handleNode( void ) const;

Description

A skeleton is a collection of joint dag nodes that have no particularly special behavior until IK handles are applied to them. In order to use inverse kinematics in Alias, you must create IK handles that define paths along skeletons to be constrained by IK.

An IK handle is defined by two joints. The end effector is the point on the skeleton that is free to move, and the root is the anchor point on the skeleton. When the end effector is moved, the rotations on all joints leading up to the root are constrained to provide an appropriate IK solution.

The IK handle also specifies the solver that will be used. There are two kinds of IK solvers in Alias. The single-chain solver is analytic and always produces a unique solution. The multi-chain solver is iterative, and the solution depends on the starting state.

Furthermore, single-chain handles are never allowed to overlap other IK handles, except for the root of one handle meeting the end effector of another. Multi-chain handles, on the other hand, are allowed to interfere with one another, the result being a best-possible IK solution.

Single-chain IK handles are always position handles - the rotations of the joints above the end-effector, and below or at the root, are transformed to meet the position of the end-effector.

Multi-solver IK handles can be position or orientation goals or both. An orientation goal will try to match the orientation of the bone immediately above the end-effector to the orientation of the IK handle.

Also, multi-solver IK handles have weights. When several multi-solver IK handles overlap, the weights on these handles are used to determine the relative effect each solution has on the overall rotation of the joints in the affected skeleton.

SUMMARY

AlIKHandle::~AlIKHandle()

Description:

Deletes an AlIKHandle wrapper object.

AlObject *AlIKHandle::copyWrapper() const

Description:

Object wrapper duplicator for AlIKHandle.

AlObjectType AlIKHandle::type() const

Description:

Returns the class identifier kIKHandleType;

statusCode AlIKHandle::deleteObject( void )

Description:

Deletes the actual handle corresponding to this AlIKHandle.

statusCode AlIKHandle::createSingle( AlJoint* root, AlJoint* end )

Description:

Builds a new single chain IK handle, given the root and end effector joints. Single chain IK handles are always position handles.

Arguments:

< root - The root joint of the handle.

< end - The end effector joint of the handle.

Return codes:

sSuccess - successful completion.

sInvalidArgument - one of root or end was not valid.

sFailure - the request could not be completed.

statusCode AlIKHandle::createMulti(AlJoint* root, AlJoint* end, AlIKHandleGoalType goal )

Description:

Builds a new multi IK handle, given the root and end effector nodes and the goal type of the handle. Returns a statusCode indicating whether the IK handle was successfully constructed.

Arguments:

< root - The root joint of the handle.

< end - The end effector joint of the handle.

< tp - The solver type for the handle: kSingleChain or kMultiSolver.

< goal - What kind of goal to give this handle: kPositionGoal, kOrientationGoal, or kBothGoal (position and orientation).

Return codes:

sSuccess - successful completion.

sInvalidArgument - one of root or end was not valid.

sFailure - the request could not be completed.

statusCode AlIKHandle::createSpline(AlJoint* root, AlJoint* end, AlCurveNode* curve, AlIKHandle*& rHandle)

Description:

Build a new master spline handle, given the root and end joints, also the curve to be matched with. The rHandle must be a NULL AlIKHandle pointer which may be set with an associated one-joint spline handle for 'this' handle.

A root spline handle EQUALS a one-joint handle. It can only be created when a master spline handle is created. (I.E., it can not be created separately).

A one-joint spline handle can be set to different position types defined by AlIKHandlePositionType.

A master spline handle can be set to different twist types defined by AlIKHandleTwistType.

This function creates spline handle(s) in default position type (kParameter) and twist type (kTwist_Linear). They can be changed later by setPositionType() and setTwistType().

Arguments:

< root - The root joint of the handle.

< end - The end joint of the handle.

< curve - The target of the handle.

< rHandle - A reference for an empty AlIKHandle pointer

When return code is sSuccess:

> rHandle - may or may not be set. If set, the rHandle is a pointer to a created root spline handle.

Return codes:

sSuccess - successful completion.

sInvalidArgument - one of root or end was not valid.

sFailure - the request could not be completed.

boolean AlIKHandle::on( void ) const

Description:

Returns whether this IK handle is currently enabled.

AlIKHandleSolverType AlIKHandle::solverType( void ) const

Description:

Returns the IK algorithm being used on this handle, multi solver or single chain. If the object is invalid, single chain will be returned.

AlIKHandleGoalType AlIKHandle::goalType( void ) const

Description:

Returns the goal type of this AlIKHandle: kPositionGoal, kOrientationGoal, or kBothGoal.

double AlIKHandle::weight( void ) const

Description:

Returns the weight on this IK handle. If the AlIKHandle is invalid, or not a multi-handle, -1 is returned.

AlIKHandleRotationOrder AlIKHandle::rotationOrder( void ) const

Description:

Returns the rotation order applied to this IK handle. This method only applies to single-chain IK handles.

boolean AlIKHandle::worldOrientation( void ) const

Description:

Returns true if this single-chain IK handle controls its rotate_plane in world space. If this IK handle is not a single-chain handle or controls its rotate-plane in local space, false is returned.

statusCode AlIKHandle::restRotation( double restRot[3] ) const

Description:

Gets the rest rotation of the single-chain IK handle.

Arguments:

> restRot - rest rotation of the single-chain ik handle.

Return codes:

sSuccess - if successful.

sInvalidArgument - if the restRot is null.

sInvalidObject - invalid ik handle.

AlJoint* AlIKHandle::root( void ) const

Description:

Gets the root AlJoint in the chain referenced by this IK handle.

AlJoint* AlIKHandle::endEffector( void ) const

Description:

Gets the end effector AlJoint in the chain referenced by this IK handle.

AlDagNode* AlIKHandle::rootNode( void ) const

Description:

Gets the AlDagNode corresponding to the root AlJoint in the chain referenced by this IK handle.

AlDagNode* AlIKHandle::endEffectorNode( void ) const

Description:

Gets the AlDagNode corresponding to the end-effector AlJoint in the chain referenced by this IK handle.

AlIKHandlePositionType AlIKHandle::positionType( void ) const

Description:

Returns the position type of this AlIKHandle. This method only applies to spline handles.

AlIKHandleTwistType AlIKHandle::twistType( void ) const

Description:

Returns the twist type of this AlIKHandle. This method only applies to spline handles.

AlCurveNode* AlIKHandle::curveNode( void ) const

Description:

Gets the curve node AlCurveNode defined by this spline handle. This function only applies tospline handles.

boolean AlIKHandle::oneJointHandle( void ) const

Description:

Returns TRUE if this IK handle is a spline handle and is one joint handle.

boolean AlIKHandle::touchRootHandle( void ) const

Description:

Return TRUE if this handle is a spline handle and directly under a one-joint spline handle.

AlIKHandlePositionType AlIKHandle::splineChainPosition(double* pos) const

Description:

Return spline chain position in curve space.

AlIKHandleTwistType AlIKHandle::splineChainTwist(double *twist) const

Description:

Return spline handle twist angle and type.

double AlIKHandle::splineChainRoll() const

Description:

Return roll angle of a spline handle.

statusCode AlIKHandle::setOn( boolean f )

Description:

Sets whether this IK handle is currently on.

statusCode AlIKHandle::setGoalType( AlIKHandleGoalType tp )

Description:

Sets the goal type of this IK handle to kPositionGoal, kOrientationGoal or kBothGoal. This method can only be used on multi handles.

statusCode AlIKHandle::setWeight( double d )

Description:

Sets the weight of this AlIKHandle to the passed-in value. Note that this can only be done for AlIKHandles that have solver type set to kMultiSolver.

statusCode AlIKHandle::setRotationOrder( AlIKHandleRotationOrder ro )

Description:

Sets the rotation order of this IK handle to the passed-in value. This method only applies to single-chain IK handles.

statusCode AlIKHandle::setWorldOrientation( boolean set )

Description:

If set is TRUE, sets this single-chain IK handle to control its rotate-plane in world space. Otherwise, the rotate-plane is controlled in local space. This method only applies to single-chain IK handles.

statusCode AlIKHandle::setRestRotation( const double restRot[3] )

Description:

Sets the single-chain ik handle with a new rest rotation.

Arguments:

< restRot - rest rotation for this single-chain ik handle.

Return codes:

sSuccess - if successful.

sInvalidArgument - if restRot is null.

sInvalidObject - invalid single-chain ik handle.

statusCode AlIKHandle::setPositionType( AlIKHandlePositionType type )

Description:

Sets this spline handle's position type. This method only applies to root spline handles (one-joint handles).

statusCode AlIKHandle::setTwistType( AlIKHandleTwistType type )

Description:

Sets this spline handle's twist type. This method only applies to master spline handles.





aliasdocs@aw.sgi.com
Copyright © 1996, Alias|Wavefront, a Silicon Graphics Company. All rights reserved.