SolarSim
Loading...
Searching...
No Matches
solarsim::TransformComponent Struct Reference

Defines spatial properties and provides model matrix calculation. More...

#include <transform_component.hpp>

Public Member Functions

glm::mat4 getModelMatrix () const
 Computes the model transformation matrix.

Data Fields

glm::vec3 position {0.0f}
glm::quat rotation {1.0f, 0.0f, 0.0f, 0.0f}
glm::vec3 scale {1.0f}
glm::mat4 modelMatrix
bool dirty = true

Detailed Description

Defines spatial properties and provides model matrix calculation.

Member Function Documentation

◆ getModelMatrix()

glm::mat4 solarsim::TransformComponent::getModelMatrix ( ) const
inline

Computes the model transformation matrix.

Returns
glm::mat4 The composed model matrix (translation * rotation * scale)
Note
Only recalculates when dirty flag is set
Warning
Modifying position, rotation, or scale does NOT currently set dirty=true automatically

Field Documentation

◆ dirty

bool solarsim::TransformComponent::dirty = true
mutable

Flag indication if matrix needs recalculation

◆ modelMatrix

glm::mat4 solarsim::TransformComponent::modelMatrix
mutable

Cached tranformation matrix (set via getModelMatrix below)

◆ position

glm::vec3 solarsim::TransformComponent::position {0.0f}

World space position vector

◆ rotation

glm::quat solarsim::TransformComponent::rotation {1.0f, 0.0f, 0.0f, 0.0f}

Orientation as a quaternion

◆ scale

glm::vec3 solarsim::TransformComponent::scale {1.0f}

Scaling factors


The documentation for this struct was generated from the following file: