### proscene

# Class PSCameraConstraint

- `PSAxisPlaneConstraint`
- - `proscene.PSCameraConstraint`

`public class PSCameraConstraint`
`extends PSAxisPlaneConstraint`

A PSAxisPlaneConstraint defined in the camera coordinate system.

The `translationConstraintDirection()` and `rotationConstraintDirection()` are expressed in the associated `camera()` coordinate system.

  ## Constructor Summary
  `PSCameraConstraint(PSCamera cam)` Creates a PSCameraConstraint, whose constrained directions are defined in the `camera()` coordinate system.

  ## Method Summary
  `PSCamera` | `camera()` Returns the associated PSCamera.
  `PSQuaternion` | `constrainRotation(PSQuaternion rotation, PSFrame frame)` When `rotationConstraintType()` is of type AXIS, constrain `rotation` to be a rotation around an axis whose direction is defined in the `camera()` coordinate system by `rotationConstraintDirection()`.
  `PVector` | `constrainTranslation(PVector translation, PSFrame frame)` Depending on `translationConstraintType()`, `constrain` translation to be along an axis or limited to a plane defined in the `camera()` coordinate system by `translationConstraintDirection()`.

## Constructor Details

### PSCameraConstraint

    public PSCameraConstraint(PSCamera cam)

> Creates a PSCameraConstraint, whose constrained directions are defined in the `camera()` coordinate system.

## Method Details

### camera

    public PSCamera camera()

> Returns the associated PSCamera. Set using the PSCameraConstraint constructor.

### constrainRotation

    public PSQuaternion constrainRotation(PSQuaternion rotation,
                                          PSFrame frame)

> When `rotationConstraintType()` is of type AXIS, constrain `rotation` to be a rotation around an axis whose direction is defined in the `camera()` coordinate system by `rotationConstraintDirection()`.

### constrainTranslation

    public PVector constrainTranslation(PVector translation,
                                        PSFrame frame)

> Depending on `translationConstraintType()`, `constrain` translation to be along an axis or limited to a plane defined in the `camera()` coordinate system by `translationConstraintDirection()`.

processing library glgraphics by Andres Colubri. (c) 2008