CameraConstraint Class Reference

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

Inheritance diagram for CameraConstraint:

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().
 
- Public Member Functions inherited from AxisPlaneConstraint
 AxisPlaneConstraint ()
 Default constructor.
 
virtual ~AxisPlaneConstraint ()
 Virtual destructor.
 
void setTranslationConstraint (Type type, const Vec &direction)
 Simply calls setTranslationConstraintType() and setTranslationConstraintDirection().
 
void setTranslationConstraintType (Type type)
 Sets the Type() of the translationConstraintType().
 
void setTranslationConstraintDirection (const Vec &direction)
 Defines the translationConstraintDirection().
 
Type translationConstraintType () const
 Returns the translation constraint Type().
 
Vec translationConstraintDirection () const
 Returns the direction used by the translation constraint.
 
void setRotationConstraint (Type type, const Vec &direction)
 Simply calls setRotationConstraintType() and setRotationConstraintDirection().
 
void setRotationConstraintType (Type type)
 Set the Type() of the rotationConstraintType().
 
void setRotationConstraintDirection (const Vec &direction)
 Defines the rotationConstraintDirection().
 
Type rotationConstraintType () const
 Returns the rotation constraint Type().
 
Vec rotationConstraintDirection () const
 Returns the axis direction used by the rotation constraint.
 
- Public Member Functions inherited from Constraint
virtual ~Constraint ()
 Virtual destructor.
 

Additional Inherited Members

- Public Types inherited from AxisPlaneConstraint
enum  Type { FREE, AXIS, PLANE, FORBIDDEN }
 Type lists the different types of translation and rotation constraints that are available. More...
 

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 ( )
inlinevirtual

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: