CameraConstraint Class Reference

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

Inheritance diagram for CameraConstraint:

List of all members.

Public Member Functions

 CameraConstraint (const Camera *const camera)
 Creates a CameraConstraint, whose constrained directions are defined in the camera coordinate system.
virtual ~CameraConstraint ()
 Virtual destructor.
const Cameracamera () const
 Returns the associated Camera.
virtual void constrainRotation (Quaternion &rotation, Frame *const frame)
 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().
virtual void constrainTranslation (Vec &translation, Frame *const frame)
 Depending on translationConstraintType(), constrain translation to be along an axis or limited to a plane defined in the camera() coordinate system by translationConstraintDirection().

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.

Definition at line 319 of file constraint.h.


Constructor & Destructor Documentation

CameraConstraint ( const Camera *const  camera) [explicit]

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

Definition at line 235 of file constraint.cpp.

virtual ~CameraConstraint ( ) [inline, virtual]

Virtual destructor.

Empty.

Definition at line 324 of file constraint.h.


Member Function Documentation

const Camera* camera ( ) const [inline]

Returns the associated Camera.

Set using the CameraConstraint constructor.

Definition at line 330 of file constraint.h.

Referenced by CameraConstraint::constrainRotation(), and CameraConstraint::constrainTranslation().

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.

Definition at line 270 of file constraint.cpp.

References CameraConstraint::camera(), Vec::projectOnAxis(), AxisPlaneConstraint::rotationConstraintDirection(), AxisPlaneConstraint::rotationConstraintType(), and Frame::transformOf().

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

The documentation for this class was generated from the following files: