|
cat3d
A tiny OpenGL 3D engine library written in and for C++.
|
Transformation class to manage 3D space transforms. More...
#include <transform.hpp>
Public Member Functions | |
| void | reset () |
| Resets the transform back to the identity matrix. | |
| glm::mat4 | to_mat4 () const |
| Convert the transform to a GLM matrix. More... | |
| void | set_pos (glm::vec3 p) |
| Set the transform's position. More... | |
| glm::vec3 | get_pos () const |
| Get the transform's position. More... | |
| transform & | move (glm::vec3 p) |
| Translate the transform through space. More... | |
| void | set_rotation (glm::vec3 angles) |
| Set the transform's rotation. More... | |
| glm::vec3 | get_rotation () const |
| Get the transform's rotation. More... | |
| transform & | rotate (glm::vec3 angles) |
| Rotate by the given euler angle displacement. More... | |
| void | set_scale (glm::vec3 s) |
| Set the transform's scale. More... | |
| glm::vec3 | get_scale () const |
| Get the transform's scale. More... | |
| transform & | scale (glm::vec3 s) |
| Scale the transform. More... | |
| transform | operator* (const transform &other) const |
| Combine two transforms. More... | |
| transform & | operator*= (const transform &other) |
| Combine another transform with this one. More... | |
Static Public Attributes | |
| static const transform | identity |
| A copy of the identity matrix. | |
Transformation class to manage 3D space transforms.
| glm::vec3 cat3d::util::transform::get_pos | ( | ) | const |
Get the transform's position.
| glm::vec3 cat3d::util::transform::get_rotation | ( | ) | const |
Get the transform's rotation.
| glm::vec3 cat3d::util::transform::get_scale | ( | ) | const |
Get the transform's scale.
| transform& cat3d::util::transform::move | ( | glm::vec3 | p | ) |
Translate the transform through space.
| p | The displacement to move |
Combine two transforms.
| other |
Combine another transform with this one.
| other |
| transform& cat3d::util::transform::rotate | ( | glm::vec3 | angles | ) |
Rotate by the given euler angle displacement.
| angles | Euler angles to rotate by |
| transform& cat3d::util::transform::scale | ( | glm::vec3 | s | ) |
Scale the transform.
| s |
| void cat3d::util::transform::set_pos | ( | glm::vec3 | p | ) |
Set the transform's position.
| p |
| void cat3d::util::transform::set_rotation | ( | glm::vec3 | angles | ) |
Set the transform's rotation.
| angles | Euler angles to rotate |
| void cat3d::util::transform::set_scale | ( | glm::vec3 | s | ) |
Set the transform's scale.
| s |
| glm::mat4 cat3d::util::transform::to_mat4 | ( | ) | const |
Convert the transform to a GLM matrix.