Interface to IK constraint data.
Synopsis
#include <AlConstraint.h>
class AlConstraint : public AlObject , public AlAnimatable
virtual ~AlConstraint();
virtual statusCode deleteObject();
virtual AlObjectType type() const;
virtual AlAnimatable* asAnimatablePtr( void );
AlConstraint* next( void ) const;
boolean on() const;
double weight() const;
boolean isUVConstraint() const;
statusCode uv( double[2] ) const;
statusCode setOn( boolean );
statusCode setWeight( double );
statusCode setUV( double[2] );
AlDagNode* sourceNode( void ) const;
AlDagNode* destinationNode( void ) const;
Description
The AlConstraint class allows access to the IK constraint information on an AlJoint.
(See the discussion of skeletons, joints, constraints, ik, and so on, in the printed reference manuals for a full description.)
Briefly, the constraint data constrains the joint node to another object. The constraint can be a point constraint, an orientation
constraint, or an aim constraint.
This is the base class for constraints. Point, orientation, and aim constraints are derived from this class.
AlConstraint::~AlConstraint()
Description
Destructor for the AlConstraint wrapper.
statusCode AlConstraint::deleteObject()
Description
Destructor for AlConstraint.
Return Codes
sSuccess - the constraint was deleted
sInvalidObject - the constraint was invalid
sFailure - the constraint could not be deleted
AlObjectType AlConstraint::type() const
Description
Returns the class identifier kConstraintType;
AlConstraint* AlConstraint::next() const
Description
Returns the next constraint after this one. If no constraint follows, NULL is returned.
boolean AlConstraint::on() const
Description
Indicates whether this constraint is active or not.
Return Values
TRUE - this constraint is active
FALSE - this constraint is not active
double AlConstraint::weight() const
Description
Returns the weight on this constraint. The weight will be between 0.0 and 100.0 inclusive (or -1 on error).
boolean AlConstraint::isUVConstraint() const
Description
This method returns TRUE if the constraint is an uv constraint.
statusCode AlConstraint::uv(double uv[2]) const
Description
This method returns uv values of the uv constraint.
Arguments
> uv[2] - the u and v parameter of the constraint. If the dest node is a curve, only uv[0] is valid.
Return Codes
sSuccess - the uv or u parameter(s) were returned
sInvalidArgument - the uv was NULL
sInvalidObject - this constraint is invalid or is not a uv constraint
sFailure - this constraint is not a uv constraint.
AlDagNode* AlConstraint::sourceNode( void ) const
Description
Returns the AlDagNode that the constraint is on.
AlDagNode* AlConstraint::destinationNode( void ) const
Description
Returns the AlDagNode that the source node is constrained to.
statusCode AlConstraint::setOn( boolean onOff )
Description
Turns the effect of the constraint on or off.
Arguments
< onOff - TRUE turns the effect on, FALSE turns it off
Return Codes
sSuccess - effect set
sInvalidObject - object invalid
statusCode AlConstraint::setWeight( double weight )
Description
Sets the weight of the constraint. The weight must be between 0.0 and 100.0 inclusive. If the weight is outside this range
it will be clipped.
Arguments
< weight - the percentage effect of this constraint
Return Codes
sSuccess - weight set
sInvalidObject - object invalid
statusCode AlConstraint::setUV(double uv[2])
Description
Sets the constraint’s uv values.
Arguments
< uv[2] - the u and v parameter for the constraint.
Return Codes
sSuccess - the uv or u parameter(s) were set
sInvalidArgument - the uv was NULL
sInvalidObject - this constraint is invalid or is not a uv constraint
sFailure - this constraint is not a uv constraint