39#ifndef EASY3D_RENDERER_FRAME_H
40#define EASY3D_RENDERER_FRAME_H
42#include <easy3d/core/types.h>
43#include "easy3d/util/signal.h"
44#include <easy3d/renderer/constraint.h>
488 const Frame *referenceFrame_;
An interface class for Frame constraints.
Definition constraint.h:140
The Frame class represents a coordinate system, defined by a position and an orientation.
Definition frame.h:78
void translate(vec3 &t)
Translates the Frame.
void translate(const vec3 &t)
Translates the Frame.
void projectOnLine(const vec3 &origin, const vec3 &direction)
Projects the Frame on a line.
mat4 worldMatrix() const
Returns the world transformation matrix of the Frame.
Frame worldInverse() const
Returns the inverse of the Frame's world transformation.
Definition frame.h:474
void rotateAroundPoint(const quat &rotation, const vec3 &point)
Rotates the Frame around a point.
void rotate(quat &q)
Rotates the Frame.
quat orientation() const
Returns the orientation of the Frame.
vec3 inverseCoordinatesOf(const vec3 &src) const
Transforms a 3D point from the Frame's coordinate system to the world coordinate system.
void setPositionWithConstraint(vec3 &position)
Sets the position of the Frame with constraint.
void setTranslation(const vec3 &translation)
Sets the translation of the Frame.
Definition frame.h:169
vec3 localInverseCoordinatesOf(const vec3 &src) const
Transforms a 3D point from the Frame's local coordinate system to the world coordinate system.
const Frame * referenceFrame() const
Returns the reference Frame.
Definition frame.h:241
Frame(const vec3 &position, const quat &orientation)
Constructor with position and orientation.
void setTranslationAndRotation(const vec3 &translation, const quat &rotation)
Sets the translation and rotation of the Frame.
void setOrientationWithConstraint(quat &orientation)
Sets the orientation of the Frame with constraint.
void setPositionAndOrientationWithConstraint(vec3 &position, quat &orientation)
Sets the position and orientation of the Frame with constraint.
void setFromMatrix(const mat4 &m)
Sets the Frame from a transformation matrix.
Frame inverse() const
Returns the inverse of the Frame.
vec3 coordinatesOfFrom(const vec3 &src, const Frame *const from) const
Transforms a 3D point from another Frame's coordinate system to the Frame's coordinate system.
Constraint * constraint() const
Returns the current constraint applied to the Frame.
Definition frame.h:424
vec3 localCoordinatesOf(const vec3 &src) const
Transforms a 3D point to the Frame's local coordinate system.
Frame(const Frame &frame)
Copy constructor.
void alignWithFrame(const Frame *const frame, bool move=false, float threshold=0.0f)
Aligns the Frame with another Frame.
vec3 coordinatesOfIn(const vec3 &src, const Frame *const in) const
Transforms a 3D point to another Frame's coordinate system.
void setRotationWithConstraint(quat &rotation)
Sets the rotation of the Frame with constraint.
void setRotation(const quat &rotation)
Sets the rotation of the Frame.
Definition frame.h:185
void setPositionAndOrientation(const vec3 &position, const quat &orientation)
Sets the position and orientation of the Frame.
void setTranslationWithConstraint(vec3 &translation)
Sets the translation of the Frame with constraint.
vec3 coordinatesOf(const vec3 &src) const
Transforms a 3D point to the Frame's coordinate system.
Frame()
Default constructor.
vec3 localInverseTransformOf(const vec3 &src) const
Transforms a 3D vector from the Frame's local coordinate system to the world coordinate system.
vec3 position() const
Returns the position of the Frame.
vec3 translation() const
Returns the translation of the Frame.
Definition frame.h:213
vec3 transformOf(const vec3 &src) const
Transforms a 3D vector to the Frame's coordinate system.
void setOrientation(const quat &orientation)
Sets the orientation of the Frame.
void setTranslationAndRotationWithConstraint(vec3 &translation, quat &rotation)
Sets the translation and rotation of the Frame with constraint.
mat4 matrix() const
Returns the transformation matrix of the Frame.
void setReferenceFrame(const Frame *refFrame)
Sets the reference Frame.
vec3 inverseTransformOf(const vec3 &src) const
Transforms a 3D vector from the Frame's coordinate system to the world coordinate system.
vec3 transformOfFrom(const vec3 &src, const Frame *const from) const
Transforms a 3D vector from another Frame's coordinate system to the Frame's coordinate system.
void setPosition(const vec3 &position)
Sets the position of the Frame.
Signal modified
Signal emitted when the Frame is modified.
Definition frame.h:491
void setConstraint(Constraint *const constraint)
Sets the constraint attached to the Frame.
Definition frame.h:431
bool settingAsReferenceFrameWillCreateALoop(const Frame *const frame) const
Checks if setting the reference Frame will create a loop.
Frame & operator=(const Frame &frame)
Assignment operator.
void rotateAroundPoint(quat &rotation, const vec3 &point)
Rotates the Frame around a point.
quat rotation() const
Returns the rotation of the Frame.
Definition frame.h:220
vec3 transformOfIn(const vec3 &src, const Frame *const in) const
Transforms a 3D vector to another Frame's coordinate system.
void rotate(const quat &q)
Rotates the Frame.
vec3 localTransformOf(const vec3 &src) const
Transforms a 3D vector to the Frame's local coordinate system.
A light-weight implementation of the simple signal-slot mechanism.
Definition signal.h:54
Definition collider.cpp:182
Vec< 3, float > vec3
A 3D point/vector of float type.
Definition types.h:44
Quat< float > quat
A quaternion of float type.
Definition types.h:85
Mat4< float > mat4
A 4 by 4 matrix of float type.
Definition types.h:67