Coordinate system matrix constructions helpers.
More...
#include <CesiumGeometry/Transforms.h>
|
static glm::dmat4 | createTranslationRotationScaleMatrix (const glm::dvec3 &translation, const glm::dquat &rotation, const glm::dvec3 &scale) |
| Creates a translation-rotation-scale matrix, equivalent to translation * rotation * scale . So if a vector is multiplied with the resulting matrix, it will be first scaled, then rotated, then translated. More...
|
|
static void | computeTranslationRotationScaleFromMatrix (const glm::dmat4 &matrix, glm::dvec3 *pTranslation, glm::dquat *pRotation, glm::dvec3 *pScale) |
| Decomposes a matrix into translation, rotation, and scale components. This is the reverse of createTranslationRotationScaleMatrix. More...
|
|
static const glm::dmat4 & | getUpAxisTransform (CesiumGeometry::Axis from, CesiumGeometry::Axis to) |
| Gets a transform that converts from one up axis to another. More...
|
|
|
static const glm::dmat4 | Y_UP_TO_Z_UP |
| A matrix to convert from y-up to z-up orientation, by rotating about PI/2 around the x-axis.
|
|
static const glm::dmat4 | Z_UP_TO_Y_UP |
| A matrix to convert from z-up to y-up orientation, by rotating about -PI/2 around the x-axis.
|
|
static const glm::dmat4 | X_UP_TO_Z_UP |
| A matrix to convert from x-up to z-up orientation, by rotating about -PI/2 around the y-axis.
|
|
static const glm::dmat4 | Z_UP_TO_X_UP |
| A matrix to convert from z-up to x-up orientation, by rotating about PI/2 around the y-axis.
|
|
static const glm::dmat4 | X_UP_TO_Y_UP |
| A matrix to convert from x-up to y-up orientation, by rotating about PI/2 around the z-axis.
|
|
static const glm::dmat4 | Y_UP_TO_X_UP |
| A matrix to convert from y-up to x-up orientation, by rotating about -PI/2 around the z-axis.
|
|
Coordinate system matrix constructions helpers.
Definition at line 13 of file Transforms.h.
◆ computeTranslationRotationScaleFromMatrix()
static void CesiumGeometry::Transforms::computeTranslationRotationScaleFromMatrix |
( |
const glm::dmat4 & |
matrix, |
|
|
glm::dvec3 * |
pTranslation, |
|
|
glm::dquat * |
pRotation, |
|
|
glm::dvec3 * |
pScale |
|
) |
| |
|
static |
Decomposes a matrix into translation, rotation, and scale components. This is the reverse of createTranslationRotationScaleMatrix.
The scale may be negative (i.e. when switching from a right-handed to a left-handed system), but skew and other funny business will result in undefined behavior.
- Parameters
-
matrix | The matrix to decompose. |
pTranslation | A pointer to the vector in which to store the translation, or nullptr if the translation is not needed. |
pRotation | A pointer to the quaternion in which to store the rotation, or nullptr if the rotation is not needed. |
pScale | A pointer to the vector in which to store the scale, or nullptr if the scale is not needed. |
◆ createTranslationRotationScaleMatrix()
static glm::dmat4 CesiumGeometry::Transforms::createTranslationRotationScaleMatrix |
( |
const glm::dvec3 & |
translation, |
|
|
const glm::dquat & |
rotation, |
|
|
const glm::dvec3 & |
scale |
|
) |
| |
|
static |
Creates a translation-rotation-scale matrix, equivalent to translation * rotation * scale
. So if a vector is multiplied with the resulting matrix, it will be first scaled, then rotated, then translated.
- Parameters
-
translation | The translation. |
rotation | The rotation. |
scale | The scale. |
◆ getUpAxisTransform()
Gets a transform that converts from one up axis to another.
- Parameters
-
from | The up axis to convert from. |
to | The up axis to convert to. |
- Returns
- The up axis transform.
The documentation for this struct was generated from the following file:
- /home/runner/work/cesium-native/cesium-native/CesiumGeometry/include/CesiumGeometry/Transforms.h