render iteration
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user