Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## codeanticode.proscene
Class PSConstraint

    java.lang.Object
      codeanticode.proscene.PSConstraint

Direct Known Subclasses:
  PSAxisPlaneConstraint

    public class PSConstraint

extends java.lang.Object

An interface class for Frame constraints.

This class defines the interface for the PSConstraints that can be applied to a PSFrame to limit its motion. Use `proscene.PSFrame#setConstraint(PSConstraint)` to associate a PSConstraint to a PSFrame (default is a `null` `proscene.PSFrame#constraint()`.

Constructor Summary
`PSConstraint()`

Method Summary
`PSQuaternion` | `constrainRotation(PSQuaternion rotation, PSFrame frame)` Filters the rotation applied to the `frame`.
`processing.core.PVector` | `constrainTranslation(processing.core.PVector translation, PSFrame frame)` Filters the translation applied to the PSframe.

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### PSConstraint

    public PSConstraint()

Method Detail

### constrainTranslation

    public processing.core.PVector constrainTranslation(processing.core.PVector translation,
                                                        PSFrame frame)

  Filters the translation applied to the PSframe. This default implementation is empty (no filtering).

  Overload this method in your own PSConstraint class to define a new translation constraint. `frame` is the PSFrame to which is applied the translation. Use its `proscene.PSFrame#position()` and update the translation accordingly instead.

  `translation` is expressed in the local PSFrame coordinate system. Use `proscene.PSFrame#inverseTransformOf(PVector)` to express it in the world coordinate system if needed.

### constrainRotation

    public PSQuaternion constrainRotation(PSQuaternion rotation,
                                          PSFrame frame)

  Filters the rotation applied to the `frame`. This default implementation is empty (no filtering).

  Overload this method in your own PSConstraint class to define a new rotation constraint. See `constrainTranslation(PVector, PSFrame)` for details.

  Use `proscene.PSFrame#inverseTransformOf(PVector)` on the `rotation` `proscene.PSQuaternion#axis()` to express `rotation` in the world coordinate system if needed.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

processing library glgraphics by Andres Colubri. (c) 2008