Easy3D 2.5.3
WorldConstraint Class Reference

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

#include <easy3d/renderer/constraint.h>

Inheritance diagram for WorldConstraint:
AxisPlaneConstraint Constraint

Public Member Functions

 ~WorldConstraint () override=default
 
void constrainTranslation (vec3 &translation, Frame *const frame) override
 
void constrainRotation (quat &rotation, Frame *const frame) override
 
- 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 world coordinate system.

The translationConstraintDirection() and rotationConstraintDirection() are expressed in world coordinate system.

See the constrainedFrame and multiView examples for an illustration.

Constructor & Destructor Documentation

◆ ~WorldConstraint()

~WorldConstraint ( )
overridedefault

Virtual destructor. Empty.

Member Function Documentation

◆ 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 world 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 world coordinate system by translationConstraintDirection().

Reimplemented from AxisPlaneConstraint.


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