The 3D object class.
More...
#include <Object3D.hpp>
|
virtual bool | isMesh () const |
| Returns whether this 3D object is a mesh.
|
|
virtual bool | isLight () const |
| Returns whether this 3D object is a light.
|
|
Object3D & | add (Object3D &child) |
| Adds another 3D object as a child of this 3D object.
|
|
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.
|
|
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.
|
|
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.
|
|
Object3D & | updateLocalMatrix () |
| Updates the local transformation matrix of this 3D object.
|
|
Object3D & | updateModelMatrix () |
| Updates the model matrix of this 3D object.
|
|
The 3D object class.
A 3D object has a position, rotation, and scale in 3D space. It can also have a parent and children. The most common types of 3D objects are meshes and groups of meshes. Scenes, cameras, and lights are special types of 3D objects.
◆ add()
Adds another 3D object as a child of this 3D object.
- Returns
- This 3D object.
◆ isLight()
virtual bool t::Object3D::isLight |
( |
| ) |
const |
|
inlinevirtual |
Returns whether this 3D object is a light.
Used internally before casting an Object3D
to a Light
.
- Returns
false
Reimplemented in t::Light.
◆ isMesh()
virtual bool t::Object3D::isMesh |
( |
| ) |
const |
|
inlinevirtual |
Returns whether this 3D object is a mesh.
Used internally before casting an Object3D
to a Mesh
.
- Returns
false
Reimplemented in t::Mesh.
◆ rotate()
Rotates this 3D object by the specified angles around the x, y, and z axes in local space.
- Parameters
-
x | The angle, in radians, to rotate around the x axis. |
y | The angle, in radians, to rotate around the y axis. |
z | The angle, in radians, to rotate around the z axis. |
order | The order of the rotations. |
- Returns
- This 3D object.
◆ scale()
Object3D & t::Object3D::scale |
( |
double | x, |
|
|
double | y, |
|
|
double | z ) |
|
inline |
Scales this 3D object by the specified amounts along the x, y, and z axes in local space.
- Parameters
-
x | The amount to scale along the x axis. |
y | The amount to scale along the y axis. |
z | The amount to scale along the z axis. |
- Returns
- This 3D object.
◆ translate()
Object3D & t::Object3D::translate |
( |
double | x, |
|
|
double | y, |
|
|
double | z ) |
|
inline |
Translates this 3D object by the specified amounts along the x, y, and z axes in local space.
- Parameters
-
x | The amount to translate along the x axis. |
y | The amount to translate along the y axis. |
z | The amount to translate along the z axis. |
- Returns
- This 3D object.
◆ updateLocalMatrix()
Object3D & t::Object3D::updateLocalMatrix |
( |
| ) |
|
|
inline |
Updates the local transformation matrix of this 3D object.
The local transformation matrix is calculated from the local position, rotation, and scale of this 3D object.
- Returns
- This 3D object.
◆ updateModelMatrix()
Object3D & t::Object3D::updateModelMatrix |
( |
| ) |
|
|
inline |
Updates the model matrix of this 3D object.
The model matrix is calculated as \(M_pL\) where \(M_p\) is the model matrix of the parent of this 3D object and \(L\) is the local matrix of this 3D object. If this 3D object has no parent, the model matrix is the same as the local matrix.
- Returns
- This 3D object.
◆ localMatrix
Initial value:=
static Matrix4x4 identity()
Returns a identity matrix.
Definition Matrix4x4.hpp:45
The matrix of the local transformation of this 3D object.
This is calculated automatically by default during the render process from localPosition
, localRotation
, and localScale
.
◆ localPosition
Initial value:
The position of this 3D object relative to its parent.
◆ localRotation
Initial value:= EulerRotation(
0, 0, 0, EulerRotationOrder::Xyz)
The rotation of this 3D object relative to its parent.
◆ localScale
Initial value:
The scale of this 3D object relative to its parent.
◆ modelMatrix
Initial value:
The model matrix of this 3D object, transformating local space to world space.
This is calculated automatically by default during the render process.
The documentation for this class was generated from the following file: