# CameraConstraint Class Reference

An AxisPlaneConstraint defined in the camera coordinate system. More...

List of all members.

## Public Member Functions
| CameraConstraint (const Camera *const camera)
virtual | ~CameraConstraint ()
virtual void | constrainTranslation (Vec &translation, Frame *const frame)
virtual void | constrainRotation (Quaternion &rotation, Frame *const frame)
const Camera * | camera () const

## Detailed Description

An AxisPlaneConstraint defined in the camera coordinate system.

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

See the constrainedFrame and constrainedCamera examples for an illustration.

## Constructor & Destructor Documentation

CameraConstraint | ( | const Camera *const | camera | ) | `[explicit]`

Creates a CameraConstraint, whose constrained directions are defined in the `camera` coordinate system.

virtual ~CameraConstraint | ( |  | ) | `[virtual]`

Virtual destructor. Empty.

## Member Function Documentation

const Camera* camera | ( |  | ) | const

Returns the associated Camera. Set using the CameraConstraint constructor.

void constrainRotation | ( | Quaternion & | rotation,
|  | Frame *const | frame |
| ) |  |  | `[virtual]`

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

Reimplemented from AxisPlaneConstraint.

void constrainTranslation | ( | Vec & | translation,
|  | Frame *const | frame |
| ) |  |  | `[virtual]`

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

Reimplemented from AxisPlaneConstraint.