public abstract class AxisPlaneConstraint extends Constraint
AxisPlaneConstraint is an interface for (translation and/or rotation) Constraint that
are defined by a direction. translationConstraintType()
and
rotationConstraintType()
define how this direction should be interpreted: as
an axis or as a plane normal.
The three implementations of this class: LocalConstraint, WorldConstraint and EyeConstraint differ by the coordinate system in which this direction is expressed.
Modifier and Type | Class and Description |
---|---|
static class |
AxisPlaneConstraint.Type
Type lists the different types of translation and rotation constraints that are
available.
|
Constructor and Description |
---|
AxisPlaneConstraint()
Default constructor.
|
constrainRotation, constrainTranslation
public AxisPlaneConstraint()
translationConstraintType()
and rotationConstraintType()
are set to
AxisPlaneConstraint.Type.FREE
. translationConstraintDirection()
and
rotationConstraintDirection()
are set to (0,0,0).
public AxisPlaneConstraint.Type translationConstraintType()
Depending on this value, the Frame will freely translate (AxisPlaneConstraint.Type.FREE
), will
only be able to translate along an axis direction ( AxisPlaneConstraint.Type.AXIS
), will be
forced to stay into a plane (AxisPlaneConstraint.Type.PLANE
) or will not able to translate at
all (AxisPlaneConstraint.Type.FORBIDDEN
).
Use Frame.setPosition(Vec)
to define the position of
the constrained Frame before it gets constrained.
public Vec translationConstraintDirection()
It represents the axis direction (AxisPlaneConstraint.Type.AXIS
) or the plane normal (
AxisPlaneConstraint.Type.PLANE
) depending on the translationConstraintType()
. It is
undefined for (AxisPlaneConstraint.Type.FREE
) or (AxisPlaneConstraint.Type.FORBIDDEN
).
The AxisPlaneConstraint derived classes express this direction in different
coordinate system (eye for EyeConstraint, local for LocalConstraint, and world for
WorldConstraint). This value can be modified with
setRotationConstraintDirection(Vec)
.
public AxisPlaneConstraint.Type rotationConstraintType()
public Vec rotationConstraintDirection()
This direction is defined only when rotationConstraintType()
is
AxisPlaneConstraint.Type.AXIS
.
The AxisPlaneConstraint derived classes express this direction in different
coordinate system (eye for EyeConstraint, local for LocalConstraint, and world for
WorldConstraint). This value can be modified with
setRotationConstraintDirection(Vec)
.
public void setTranslationConstraint(AxisPlaneConstraint.Type type, Vec direction)
setTranslationConstraintType(Type)
and
setTranslationConstraintDirection(Vec)
.public void setTranslationConstraintDirection(Vec direction)
translationConstraintDirection()
. The coordinate system where
direction
is expressed depends on your class implementation.public void setRotationConstraint(AxisPlaneConstraint.Type type, Vec direction)
setRotationConstraintType(Type)
and
setRotationConstraintDirection(Vec)
.public void setRotationConstraintDirection(Vec direction)
rotationConstraintDirection()
. The coordinate system where
direction
is expressed depends on your class implementation.public void setTranslationConstraintType(AxisPlaneConstraint.Type type)
translationConstraintType()
. Default is
AxisPlaneConstraint.Type.FREE
public void setRotationConstraintType(AxisPlaneConstraint.Type type)
rotationConstraintType()
. Default is AxisPlaneConstraint.Type.FREE
.
Depending on this value, the Frame will freely rotate (AxisPlaneConstraint.Type.FREE
), will only
be able to rotate around an axis (AxisPlaneConstraint.Type.AXIS
), or will not able to rotate at
all AxisPlaneConstraint.Type.FORBIDDEN
.
Use Frame.setOrientation(Rotation)
to define the
orientation of the constrained Frame before it gets constrained.
Attention: An AxisPlaneConstraint.Type.PLANE
Type is not meaningful for rotational
constraints and will be ignored.
Processing Library proscene by Jean Pierre Charalambos. (c) 2014-2017 National University of Colombia