39#ifndef EASY3D_RENDERER_CONSTRAINT_H
40#define EASY3D_RENDERER_CONSTRAINT_H
42#include <easy3d/core/types.h>
243 enum Type { FREE, AXIS, PLANE, FORBIDDEN };
257 translationConstraintType_ = type;
284 return translationConstraintDir_;
316 Type translationConstraintType_;
317 Type rotationConstraintType_;
319 vec3 translationConstraintDir_;
320 vec3 rotationConstraintDir_;
381 const Camera *
const camera_;
An abstract class for Frame Constraints defined by an axis or a plane.
Definition: constraint.h:201
void setTranslationConstraintType(Type type)
Definition: constraint.h:256
AxisPlaneConstraint()
Definition: constraint.cpp:72
~AxisPlaneConstraint() override=default
Type translationConstraintType() const
Definition: constraint.h:271
Type
Definition: constraint.h:243
void setRotationConstraintDirection(const vec3 &direction)
Definition: constraint.cpp:111
vec3 translationConstraintDirection() const
Definition: constraint.h:283
void constrainTranslation(vec3 &translation, Frame *const frame) override
Definition: constraint.h:248
void setRotationConstraintType(Type type)
Definition: constraint.cpp:138
void setRotationConstraint(Type type, const vec3 &direction)
Definition: constraint.cpp:103
void setTranslationConstraint(Type type, const vec3 &direction)
Definition: constraint.cpp:79
Type rotationConstraintType() const
Definition: constraint.h:301
void setTranslationConstraintDirection(const vec3 &direction)
Definition: constraint.cpp:86
void constrainRotation(quat &rotation, Frame *const frame) override
Definition: constraint.h:291
vec3 rotationConstraintDirection() const
Definition: constraint.h:311
An AxisPlaneConstraint defined in the camera coordinate system.
Definition: constraint.h:367
CameraConstraint(const Camera *const camera)
Definition: constraint.cpp:258
const Camera * camera() const
Definition: constraint.h:378
void constrainTranslation(vec3 &translation, Frame *const frame) override
Definition: constraint.cpp:264
~CameraConstraint() override=default
void constrainRotation(quat &rotation, Frame *const frame) override
Definition: constraint.cpp:291
A perspective or orthographic camera.
Definition: camera.h:116
An interface class for Frame constraints.
Definition: constraint.h:140
virtual void constrainTranslation(vec3 &translation, Frame *const frame)
Definition: constraint.h:157
virtual void constrainRotation(quat &rotation, Frame *const frame)
Definition: constraint.h:169
virtual ~Constraint()=default
The Frame class represents a coordinate system, defined by a position and an orientation.
Definition: frame.h:152
An AxisPlaneConstraint defined in the Frame local coordinate system.
Definition: constraint.h:331
~LocalConstraint() override=default
void constrainTranslation(vec3 &translation, Frame *const frame) override
Definition: constraint.cpp:155
void constrainRotation(quat &rotation, Frame *const frame) override
Definition: constraint.cpp:178
An AxisPlaneConstraint defined in the world coordinate system.
Definition: constraint.h:349
void constrainTranslation(vec3 &translation, Frame *const frame) override
Definition: constraint.cpp:202
~WorldConstraint() override=default
void constrainRotation(quat &rotation, Frame *const frame) override
Definition: constraint.cpp:233
Definition: collider.cpp:182