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

## proscene
Class PSAxisPlaneConstraint

    java.lang.Object
      proscene.PSConstraint
          proscene.PSAxisPlaneConstraint

Direct Known Subclasses:
  PSCameraConstraint, PSLocalConstraint, PSWorldConstraint

    public class PSAxisPlaneConstraint

extends PSConstraint

An abstract class for PSFrame PSConstraints defined by an axis or a plane.

PSAxisPlaneConstraint is an interface for (translation and/or rotation) PSConstraint 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: PSLocalConstraint, PSWorldConstraint and PSCameraConstraint differ by the coordinate system in which this direction is expressed.

Nested Class Summary
`static class` | `PSAxisPlaneConstraint.Type` Type lists the different types of translation and rotation constraints that are available.

Constructor Summary
`PSAxisPlaneConstraint()` Default constructor.

Method Summary
`processing.core.PVector` | `rotationConstraintDirection()` Returns the axis direction used by the rotation constraint.
`PSAxisPlaneConstraint.Type` | `rotationConstraintType()` Returns the rotation constraint Type.
`void` | `setRotationConstraint(PSAxisPlaneConstraint.Type type, processing.core.PVector direction)` Simply calls `setRotationConstraintType(Type)` and `setRotationConstraintDirection(PVector)`.
`void` | `setRotationConstraintDirection(processing.core.PVector direction)` Defines the `rotationConstraintDirection()`.
`void` | `setRotationConstraintType(PSAxisPlaneConstraint.Type type)` Set the Type of the `rotationConstraintType()`.
`void` | `setTranslationConstraint(PSAxisPlaneConstraint.Type type, processing.core.PVector direction)` Simply calls `setTranslationConstraintType(Type)` and `setTranslationConstraintDirection(PVector)`.
`void` | `setTranslationConstraintDirection(processing.core.PVector direction)` Defines the `translationConstraintDirection()`.
`void` | `setTranslationConstraintType(PSAxisPlaneConstraint.Type type)` Sets the Type() of the `translationConstraintType()`.
`processing.core.PVector` | `translationConstraintDirection()` Returns the direction used by the translation constraint.
`PSAxisPlaneConstraint.Type` | `translationConstraintType()` Returns the translation constraint Type.

Methods inherited from class proscene.PSConstraint
`constrainRotation, constrainTranslation`

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

Constructor Detail

### PSAxisPlaneConstraint

    public PSAxisPlaneConstraint()

  Default constructor.

  `translationConstraintType()` and `rotationConstraintType()` are set to `PSAxisPlaneConstraint.Type.FREE`. `translationConstraintDirection()` and `rotationConstraintDirection()` are set to (0,0,0).

Method Detail

### translationConstraintType

    public PSAxisPlaneConstraint.Type translationConstraintType()

  Returns the translation constraint Type.

  Depending on this value, the PSFrame will freely translate (`PSAxisPlaneConstraint.Type.FREE`), will only be able to translate along an axis direction (`PSAxisPlaneConstraint.Type.AXIS`), will be forced to stay into a plane (`PSAxisPlaneConstraint.Type.PLANE`) or will not able to translate at all (`PSAxisPlaneConstraint.Type.FORBIDDEN`).

  Use `PSFrame.setPosition(PVector)` to define the position of the constrained PSFrame before it gets constrained.

### translationConstraintDirection

    public processing.core.PVector translationConstraintDirection()

  Returns the direction used by the translation constraint.

  It represents the axis direction (`PSAxisPlaneConstraint.Type.AXIS`) or the plane normal (`PSAxisPlaneConstraint.Type.PLANE`) depending on the `translationConstraintType()`. It is undefined for (`PSAxisPlaneConstraint.Type.FREE`) or (`PSAxisPlaneConstraint.Type.FORBIDDEN`).

  The PSAxisPlaneConstraint derived classes express this direction in different coordinate system (camera for PSCameraConstraint, local for PSLocalConstraint, and world for PSWorldConstraint). This value can be modified with `setRotationConstraintDirection(PVector)`.

### rotationConstraintType

    public PSAxisPlaneConstraint.Type rotationConstraintType()

  Returns the rotation constraint Type.

### rotationConstraintDirection

    public processing.core.PVector rotationConstraintDirection()

  Returns the axis direction used by the rotation constraint.

  This direction is defined only when `rotationConstraintType()` is `PSAxisPlaneConstraint.Type.AXIS`.

  The PSAxisPlaneConstraint derived classes express this direction in different coordinate system (camera for PSCameraConstraint, local for PSLocalConstraint, and world for PSWorldConstraint). This value can be modified with `setRotationConstraintDirection(PVector)`.

### setTranslationConstraint

    public void setTranslationConstraint(PSAxisPlaneConstraint.Type type,
                                         processing.core.PVector direction)

  Simply calls `setTranslationConstraintType(Type)` and `setTranslationConstraintDirection(PVector)`.

### setTranslationConstraintDirection

    public void setTranslationConstraintDirection(processing.core.PVector direction)

  Defines the `translationConstraintDirection()`. The coordinate system where `direction` is expressed depends on your class implementation.

### setRotationConstraint

    public void setRotationConstraint(PSAxisPlaneConstraint.Type type,
                                      processing.core.PVector direction)

  Simply calls `setRotationConstraintType(Type)` and `setRotationConstraintDirection(PVector)`.

### setRotationConstraintDirection

    public void setRotationConstraintDirection(processing.core.PVector direction)

  Defines the `rotationConstraintDirection()`. The coordinate system where `direction` is expressed depends on your class implementation.

### setTranslationConstraintType

    public void setTranslationConstraintType(PSAxisPlaneConstraint.Type type)

  Sets the Type() of the `translationConstraintType()`. Default is `PSAxisPlaneConstraint.Type.FREE`

### setRotationConstraintType

    public void setRotationConstraintType(PSAxisPlaneConstraint.Type type)

  Set the Type of the `rotationConstraintType()`. Default is `PSAxisPlaneConstraint.Type.FREE`.

  Depending on this value, the PSFrame will freely rotate (`PSAxisPlaneConstraint.Type.FREE`), will only be able to rotate around an axis (`PSAxisPlaneConstraint.Type.AXIS`), or will not able to rotate at all `PSAxisPlaneConstraint.Type.FORBIDDEN`.

  Use `PSFrame.setOrientation(PSQuaternion)` to define the orientation of the constrained PSFrame before it gets constrained.

  Attention: An `PSAxisPlaneConstraint.Type.PLANE` Type is not meaningful for rotational constraints and will be ignored.

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