Easy3D 2.5.3
CameraConstraint Class Reference

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

#include <easy3d/renderer/constraint.h>

Inheritance diagram for CameraConstraint:
AxisPlaneConstraint Constraint

Public Member Functions

 CameraConstraint (const Camera *const camera)
 
 ~CameraConstraint () override=default
 
void constrainTranslation (vec3 &translation, Frame *const frame) override
 
void constrainRotation (quat &rotation, Frame *const frame) override
 
const Cameracamera () const
 
- Public Member Functions inherited from AxisPlaneConstraint
 AxisPlaneConstraint ()
 
 ~AxisPlaneConstraint () override=default
 
void setTranslationConstraint (Type type, const vec3 &direction)
 
void setTranslationConstraintType (Type type)
 
void setTranslationConstraintDirection (const vec3 &direction)
 
Type translationConstraintType () const
 
vec3 translationConstraintDirection () const
 
void setRotationConstraint (Type type, const vec3 &direction)
 
void setRotationConstraintType (Type type)
 
void setRotationConstraintDirection (const vec3 &direction)
 
Type rotationConstraintType () const
 
vec3 rotationConstraintDirection () const
 
- Public Member Functions inherited from Constraint
virtual ~Constraint ()=default
 
virtual void constrainTranslation (vec3 &translation, Frame *const frame)
 
virtual void constrainRotation (quat &rotation, Frame *const frame)
 

Additional Inherited Members

- Public Types inherited from AxisPlaneConstraint
enum  Type { FREE , AXIS , PLANE , FORBIDDEN }
 

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

CameraConstraint ( const Camera *const  camera)
explicit

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

◆ ~CameraConstraint()

~CameraConstraint ( )
overridedefault

Virtual destructor. Empty.

Member Function Documentation

◆ camera()

const Camera * camera ( ) const
inline

Returns the associated Camera. Set using the CameraConstraint constructor.

◆ constrainRotation()

void constrainRotation ( quat rotation,
Frame *const  frame 
)
overridevirtual

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.

◆ constrainTranslation()

void constrainTranslation ( vec3 translation,
Frame *const  frame 
)
overridevirtual

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.


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