public abstract class Constraint extends Object
This class defines the interface for the constraint that can be applied to a Frame to
limit its motion. Use Frame.setConstraint(Constraint)
to associate a Constraint to a Frame (default is a null
Frame.constraint()
.
Constructor and Description |
---|
Constraint() |
Modifier and Type | Method and Description |
---|---|
Rotation |
constrainRotation(Rotation rotation,
Frame frame)
Filters the rotation applied to the
frame . |
Vec |
constrainTranslation(Vec translation,
Frame frame)
Filters the translation applied to the Frame.
|
public Vec constrainTranslation(Vec translation, Frame frame)
Overload this method in your own Constraint class to define a new translation
constraint. frame
is the Frame to which is applied the translation. You
should refrain from directly changing its value in the constraint. Use its
Frame.position()
and update the translation
accordingly instead.
translation
is expressed in the local Frame coordinate system. Use
Frame.inverseTransformOf(Vec)
to express it in the
world coordinate system if needed.
public Rotation constrainRotation(Rotation rotation, Frame frame)
frame
. This default implementation is
empty (no filtering).
Overload this method in your own Constraint class to define a new rotation
constraint. See constrainTranslation(Vec, Frame)
for details.
Use Frame.inverseTransformOf(Vec)
on the
rotation
Quat.axis()
to express
rotation
in the world coordinate system if needed.
Processing Library proscene by Jean Pierre Charalambos. (c) 2014-2017 National University of Colombia