SOFA API  1a4bb3e7
Open source framework for multi-physics simuation
qglviewer::CameraConstraint Class Reference

#include <QGLViewer/constraint.h>

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

Inheritance diagram for qglviewer::CameraConstraint:

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.

Public Member Functions

 CameraConstraint (const Camera *const camera)
 Creates a CameraConstraint, whose constrained directions are defined in the camera coordinate system. More...
 
virtual ~CameraConstraint ()
 Virtual destructor. More...
 
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(). More...
 
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(). More...
 
const Cameracamera () const
 Returns the associated Camera. More...
 
- Public Member Functions inherited from qglviewer::AxisPlaneConstraint
 AxisPlaneConstraint ()
 Default constructor. More...
 
virtual ~AxisPlaneConstraint ()
 Virtual destructor. More...
 
void setTranslationConstraint (Type type, const Vec &direction)
 Simply calls setTranslationConstraintType() and setTranslationConstraintDirection(). More...
 
void setTranslationConstraintType (Type type)
 Sets the Type() of the translationConstraintType(). More...
 
void setTranslationConstraintDirection (const Vec &direction)
 Defines the translationConstraintDirection(). More...
 
Type translationConstraintType () const
 Returns the translation constraint Type(). More...
 
Vec translationConstraintDirection () const
 Returns the direction used by the translation constraint. More...
 
void setRotationConstraint (Type type, const Vec &direction)
 Simply calls setRotationConstraintType() and setRotationConstraintDirection(). More...
 
void setRotationConstraintType (Type type)
 Set the Type() of the rotationConstraintType(). More...
 
void setRotationConstraintDirection (const Vec &direction)
 Defines the rotationConstraintDirection(). More...
 
Type rotationConstraintType () const
 Returns the rotation constraint Type(). More...
 
Vec rotationConstraintDirection () const
 Returns the axis direction used by the rotation constraint. More...
 
- Public Member Functions inherited from qglviewer::Constraint
virtual ~Constraint ()
 Virtual destructor. More...
 

Constructor details

◆ CameraConstraint()

CameraConstraint::CameraConstraint ( const Camera *const  camera)
explicit

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

◆ ~CameraConstraint()

virtual qglviewer::CameraConstraint::~CameraConstraint ( )
inlinevirtual

Virtual destructor.

Empty.

Function details

◆ camera()

const Camera* qglviewer::CameraConstraint::camera ( ) const
inline

Returns the associated Camera.

Set using the CameraConstraint constructor.

◆ constrainRotation()

void CameraConstraint::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 qglviewer::AxisPlaneConstraint.

◆ constrainTranslation()

void CameraConstraint::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 qglviewer::AxisPlaneConstraint.