diff options
| author | HampusM <hampus@hampusmat.com> | 2026-08-17 15:52:01 +0200 |
|---|---|---|
| committer | HampusM <hampus@hampusmat.com> | 2026-08-17 15:52:01 +0200 |
| commit | ccfbcb490dd47cc814a64e8be00c148e2e2206a3 (patch) | |
| tree | f6a0ba50316f91531b953576334c9fce12411e7d /engine/src/data_types | |
| parent | 4c4dd2b8bfa4655acbf03967f274e76440ec9530 (diff) | |
feat(engine): replace WorldPosition & Scale components with Transform
Diffstat (limited to 'engine/src/data_types')
| -rw-r--r-- | engine/src/data_types/matrix.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/engine/src/data_types/matrix.rs b/engine/src/data_types/matrix.rs index 48796bf..3c54bb1 100644 --- a/engine/src/data_types/matrix.rs +++ b/engine/src/data_types/matrix.rs @@ -1,5 +1,6 @@ use std::ops::{Index, IndexMut, Mul}; +use crate::data_types::dimens::Dimens3; use crate::vector::{Vec3, Vec4}; #[derive(Debug, Clone)] @@ -90,11 +91,11 @@ impl Matrix<f32, 4, 4> self[CellPos { row: 3, col: 3 }] = 1.0; } - pub fn scale(&mut self, scaling: &Vec3<f32>) + pub fn scale(&mut self, scaling: &Dimens3<f32>) { - self[CellPos { row: 0, col: 0 }] = scaling.x; - self[CellPos { row: 1, col: 1 }] = scaling.y; - self[CellPos { row: 2, col: 2 }] = scaling.z; + self[CellPos { row: 0, col: 0 }] = scaling.width; + self[CellPos { row: 1, col: 1 }] = scaling.height; + self[CellPos { row: 2, col: 2 }] = scaling.depth; self[CellPos { row: 3, col: 3 }] = 1.0; } |
