render iteration

This commit is contained in:
Jonas H
2026-02-08 14:06:35 +01:00
parent 2422106725
commit 82c3e1e3b0
67 changed files with 6381 additions and 1564 deletions

View File

@@ -22,6 +22,16 @@ impl Transform
Self::IDENTITY.translated(position)
}
pub fn from_matrix(matrix: Mat4) -> Self
{
let (scale, rotation, position) = matrix.to_scale_rotation_translation();
Self {
position,
rotation,
scale,
}
}
pub fn to_matrix(&self) -> Mat4
{
Mat4::from_scale_rotation_translation(self.scale, self.rotation, self.position)