1#include "math/EulerRotation.hpp"
2#include "math/Matrix4x4.hpp"
3#include "math/Vector3.hpp"
28 std::optional<std::reference_wrapper<Object3D>>
parent;
35 0, 0, 0, EulerRotationOrder::Xyz);
51 std::vector<std::reference_wrapper<Object3D>>
61 virtual bool isMesh()
const {
return false; }
70 virtual bool isLight()
const {
return false; }
98 this->localPosition +=
Vector3(x, y, z);
113 this->localRotation.
copy(this->localRotation +
128 this->localScale *=
Vector3(x, y, z);
The Euler rotation class.
Definition EulerRotation.hpp:17
EulerRotation & copy(const EulerRotation &source)
Copies another Euler rotation into this Euler rotation.
Definition EulerRotation.hpp:42
The matrix class.
Definition Matrix4x4.hpp:35
static Matrix4x4 fromTranslation(const Vector3 &distance)
Returns a translation matrix for the specified translation for post-multiplication ( where is the h...
Definition Matrix4x4.hpp:79
static Matrix4x4 identity()
Returns a identity matrix.
Definition Matrix4x4.hpp:45
static Matrix4x4 fromRotation(const EulerRotation &angle)
Returns a rotation matrix for the specified rotation for post-multiplication ( where is the homogen...
Definition Matrix4x4.hpp:99
static Matrix4x4 fromScale(const Vector3 &scaleFactor)
Returns a scale matrix for the specified scale factor.
Definition Matrix4x4.hpp:133
Matrix4x4 & copy(const Matrix4x4 &source)
Copies the elements of another matrix into this matrix.
Definition Matrix4x4.hpp:189
The 3D object class.
Definition Object3D.hpp:24
Vector3 localPosition
The position of this 3D object relative to its parent.
Definition Object3D.hpp:32
virtual bool isLight() const
Returns whether this 3D object is a light.
Definition Object3D.hpp:70
Vector3 up
The vector pointing to the up direction in object space.
Definition Object3D.hpp:30
Object3D & rotate(double x, double y, double z, EulerRotationOrder order)
Rotates this 3D object by the specified angles around the x, y, and z axes in local space.
Definition Object3D.hpp:112
Matrix4x4 modelMatrix
The model matrix of this 3D object, transformating local space to world space.
Definition Object3D.hpp:46
Vector3 localScale
The scale of this 3D object relative to its parent.
Definition Object3D.hpp:37
Matrix4x4 localMatrix
The matrix of the local transformation of this 3D object.
Definition Object3D.hpp:39
std::optional< std::reference_wrapper< Object3D > > parent
The parent of this 3D object.
Definition Object3D.hpp:28
Object3D & scale(double x, double y, double z)
Scales this 3D object by the specified amounts along the x, y, and z axes in local space.
Definition Object3D.hpp:127
virtual bool isMesh() const
Returns whether this 3D object is a mesh.
Definition Object3D.hpp:61
Object3D & updateLocalMatrix()
Updates the local transformation matrix of this 3D object.
Definition Object3D.hpp:144
Object3D & add(Object3D &child)
Adds another 3D object as a child of this 3D object.
Definition Object3D.hpp:77
std::vector< std::reference_wrapper< Object3D > > children
The children of this 3D object.
Definition Object3D.hpp:52
Object3D & translate(double x, double y, double z)
Translates this 3D object by the specified amounts along the x, y, and z axes in local space.
Definition Object3D.hpp:97
Object3D & updateModelMatrix()
Updates the model matrix of this 3D object.
Definition Object3D.hpp:163
EulerRotation localRotation
The rotation of this 3D object relative to its parent.
Definition Object3D.hpp:34
The 3D vector class.
Definition Vector3.hpp:20
#define DEFAULT_UP
The default up direction.
Definition constants.hpp:50
The t software 3D graphics library namespace.
Definition algorithms.hpp:12
EulerRotationOrder
The Euler rotation order.
Definition constants.hpp:19