Vulkan Schnee 0.0.1 (22840dc8)
High-performance rendering engine
Loading...
Searching...
No Matches
Engine::Ecs::TransformOperators Class Reference

Static helpers for reading and mutating Transform matrices. More...

#include <Transform.h>

Classes

struct  MatrixTransformComponent

Static Public Member Functions

static glm::vec3 getPosition (const glm::mat4 &matrix)
 Extracts the translation component from a transform matrix.
static glm::quat getRotation (const glm::mat4 &matrix)
 Extracts the rotation component from a transform matrix.
static glm::vec3 getRotationEuler (const glm::mat4 &matrix)
 Extracts the rotation component as Euler angles in degrees.
static glm::vec3 getScale (const glm::mat4 &matrix)
 Extracts the scale component from a transform matrix.
static glm::vec3 getForwardVector (const glm::mat4 &matrix)
 Returns the normalized forward vector for a transform matrix.
static glm::vec3 getUpVector (const glm::mat4 &matrix)
 Returns the normalized up vector for a transform matrix.
static glm::vec3 getRightVector (const glm::mat4 &matrix)
 Returns the normalized right vector for a transform matrix.
static void setPosition (Ecs::Transform &transform, const glm::vec3 &newPosition)
 Replaces a transform's translation while preserving rotation and scale.
static void setRotation (Ecs::Transform &transform, const glm::vec3 &newRotation)
 Replaces a transform's rotation from Euler angles in degrees.
static void setRotation (Ecs::Transform &transform, const glm::quat &newQuaternion)
 Replaces a transform's rotation from a quaternion while preserving scale.
static void setScale (Ecs::Transform &transform, const glm::vec3 &newScale)
 Replaces a transform's scale while preserving axis directions.
static void setFacing (Ecs::Transform &transform, const glm::vec3 &newFacing)
 Rotates a transform so its forward axis faces the supplied direction.

Static Private Member Functions

static MatrixTransformComponent extractComponents (const glm::mat4 &matrix)

Detailed Description

Static helpers for reading and mutating Transform matrices.

Definition at line 13 of file Transform.h.

Member Function Documentation

◆ extractComponents()

MatrixTransformComponent Engine::Ecs::TransformOperators::extractComponents ( const glm::mat4 & matrix)
staticprivate

◆ getForwardVector()

glm::vec3 Engine::Ecs::TransformOperators::getForwardVector ( const glm::mat4 & matrix)
static

Returns the normalized forward vector for a transform matrix.

◆ getPosition()

glm::vec3 Engine::Ecs::TransformOperators::getPosition ( const glm::mat4 & matrix)
static

Extracts the translation component from a transform matrix.

◆ getRightVector()

glm::vec3 Engine::Ecs::TransformOperators::getRightVector ( const glm::mat4 & matrix)
static

Returns the normalized right vector for a transform matrix.

◆ getRotation()

glm::quat Engine::Ecs::TransformOperators::getRotation ( const glm::mat4 & matrix)
static

Extracts the rotation component from a transform matrix.

◆ getRotationEuler()

glm::vec3 Engine::Ecs::TransformOperators::getRotationEuler ( const glm::mat4 & matrix)
static

Extracts the rotation component as Euler angles in degrees.

◆ getScale()

glm::vec3 Engine::Ecs::TransformOperators::getScale ( const glm::mat4 & matrix)
static

Extracts the scale component from a transform matrix.

◆ getUpVector()

glm::vec3 Engine::Ecs::TransformOperators::getUpVector ( const glm::mat4 & matrix)
static

Returns the normalized up vector for a transform matrix.

◆ setFacing()

void Engine::Ecs::TransformOperators::setFacing ( Ecs::Transform & transform,
const glm::vec3 & newFacing )
static

Rotates a transform so its forward axis faces the supplied direction.

◆ setPosition()

void Engine::Ecs::TransformOperators::setPosition ( Ecs::Transform & transform,
const glm::vec3 & newPosition )
static

Replaces a transform's translation while preserving rotation and scale.

◆ setRotation() [1/2]

void Engine::Ecs::TransformOperators::setRotation ( Ecs::Transform & transform,
const glm::quat & newQuaternion )
static

Replaces a transform's rotation from a quaternion while preserving scale.

◆ setRotation() [2/2]

void Engine::Ecs::TransformOperators::setRotation ( Ecs::Transform & transform,
const glm::vec3 & newRotation )
static

Replaces a transform's rotation from Euler angles in degrees.

◆ setScale()

void Engine::Ecs::TransformOperators::setScale ( Ecs::Transform & transform,
const glm::vec3 & newScale )
static

Replaces a transform's scale while preserving axis directions.


The documentation for this class was generated from the following file:
  • /workspace/magerbeton/gl3-vulkan/code/Engine/include/Engine/World/Transform.h