Inherited by qglviewer::AxisPlaneConstraint, and qglviewer::TriangleSetConstraint.
Public Methods | |
virtual | ~Constraint () |
virtual void | constrainTranslation (qglviewer::Vec &, Frame *const) |
virtual void | constrainRotation (qglviewer::Quaternion &, Frame *const) |
The different constraints that can be applied to a Frame to limit its motion must all derive from this class. A frame can have its constrain defined with Frame::setConstraint().
constrainTranslation() and constrainRotation() can be overloaded to specify the constraint behavior. They take the motion and the applied frame as parameters. The translation (resp. rotation) should be modified according to the constraint.
A frame can be moved with constraints using Frame::translate() and Frame::rotate(). It will result in the following pseudo-code for an imposed translation T
and rotation Q
:
constraint()->constrainTranslation( T , this ); t += T; constraint()->constrainRotation ( Q , this ); q *= Q;
Default behavior (Constraint base class) implements no constraint.
|
Virtual empty destructor. |
|
Default un-constrained rotation function. Desired rotation is expressed in local frame coordinate system. Try the
Overload this function in your own Constraint class to define a new rotationnal constraint. The frame which is applied a constrained rotation is given as a parameter. It is not defined Reimplemented in qglviewer::AxisPlaneConstraint. |
|
Default un-constrained translation function. Desired translation is expressed in local frame coordinate system. Try the
Overload this function in your own Constraint class to define a new translation constraint. The frame which is applied a constrained translation is given as a parameter. It is not defined Reimplemented in qglviewer::AxisPlaneConstraint. |