Flint Engine
Modular C++20 2D game engine powered by SDL3
Loading...
Searching...
No Matches
Flint::Transform Struct Reference

Holds the 2-D transform components for a game object. More...

#include <flint/math/transform.h>

+ Collaboration diagram for Flint::Transform:

Public Attributes

Vec2f position {0.f, 0.f}
 
float rotation = 0.f
 
Vec2f scale {1.f, 1.f}
 
Vec2f origin {0.f, 0.f}
 

Detailed Description

Holds the 2-D transform components for a game object.

Combines position, rotation, scale, and a local pivot (origin) into a single plain-data struct. Pass to buildModelMatrix() to produce the corresponding GPU matrix.

Definition at line 14 of file transform.h.

Member Data Documentation

◆ origin

Vec2f Flint::Transform::origin {0.f, 0.f}

Local pivot point (subtracted before rotation).

Definition at line 18 of file transform.h.

◆ position

Vec2f Flint::Transform::position {0.f, 0.f}

World-space translation.

Definition at line 15 of file transform.h.

◆ rotation

float Flint::Transform::rotation = 0.f

Rotation angle in radians (counter-clockwise).

Definition at line 16 of file transform.h.

◆ scale

Vec2f Flint::Transform::scale {1.f, 1.f}

Per-axis scale factors.

Definition at line 17 of file transform.h.


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