Local position, rotation and scale of an entity.
More...
#include <transform.h>
|
|
glm::vec3 | position = {0.0f, 0.0f, 0.0f} |
| | Local position.
|
|
glm::quat | rotation = {1.0f, 0.0f, 0.0f, 0.0f} |
| | Local rotation.
|
|
glm::vec3 | scale = {1.0f, 1.0f, 1.0f} |
| | Local scale.
|
Local position, rotation and scale of an entity.
For pure quat/axis math, use core/math/ (rotation.h, axes.h).
◆ computeModelMatrix()
| glm::mat4 Vkm::Engine::Transform::computeModelMatrix |
( |
const Transform & | transform | ) |
|
|
inlinestatic |
Compute the model matrix from transform data.
- Parameters
-
| transform | Local TRS to compose, without intermediate matrix products. |
- Returns
- translation * rotation * scale.
◆ fromModelMatrix()
| Transform Vkm::Engine::Transform::fromModelMatrix |
( |
const glm::mat4 & | model | ) |
|
|
inlinestatic |
Recover the TRS that computeModelMatrix() would have built model from.
Exact for chains of translations, rotations and uniform scales. Shear (a non-uniformly scaled joint with a rotated child) is dropped. A zero-scaled axis returns zero scale, rotation from the surviving axes.
- Parameters
-
| model | Model matrix to decompose. |
- Returns
- Its position, rotation and scale.
◆ computeView()
| glm::mat4 Vkm::Engine::Transform::computeView |
( |
const Transform & | transform | ) |
|
|
inlinestatic |
Compute the view matrix from a transform.
- Parameters
-
| transform | Camera pose; looks along its forward (-Z). |
- Returns
- World-to-view matrix.
The documentation for this struct was generated from the following file: