Skip to main content

concinnity_core/components/
global_transform.rs

1// src/components/global_transform.rs
2
3/// Composed world matrix for an entity, after parent transforms are applied.
4///
5/// Runtime-only. A transform-propagation pass writes it from an entity's
6/// `Transform` and its parent chain; the renderer reads it to place draws. For
7/// a root (parentless) entity it equals `Transform::model_matrix`.
8#[derive(Debug, Clone, Copy)]
9pub struct GlobalTransform(pub [[f32; 4]; 4]);
10
11impl Default for GlobalTransform {
12    fn default() -> Self {
13        GlobalTransform([
14            [1.0, 0.0, 0.0, 0.0],
15            [0.0, 1.0, 0.0, 0.0],
16            [0.0, 0.0, 1.0, 0.0],
17            [0.0, 0.0, 0.0, 1.0],
18        ])
19    }
20}