AlConstraint

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 AlConstraint* asConstraintPtr();
virtual AlAnimatable* asAnimatablePtr( void );
AlConstraint* next( void ) const;
boolean on() const;
double weight() const;
statusCode setOn( boolean );
statusCode setWeight( double );
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, contraints, ik, etc. 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.

Summary

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::asConstraintPtr()

Description

This virtual function returns a non-null pointer to itself, indicating that it is safe to cast to an object of this class.

AlConstraint* AlConstraint::next() const

Description

This method returns the next constraint after this one. If no constraint follows, NULL is returned.

boolean AlConstraint::on() const

Description

This method indicates whether this constraint is active or not.

Return codes

TRUE - this constraint is active.

FALSE - this constraint is not active.

double AlConstraint::weight() const

Description

This method returns the weight on this constraint. The weight will be between 0.0 and 100.0 inclusive (or -1 on error).

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

Turn 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

Set 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





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