Use from_scale_rotation_translation

This commit is contained in:
Aleksander 2024-01-30 21:20:39 +01:00
parent 1815da2d2d
commit cc7b3d8fae
1 changed files with 4 additions and 4 deletions

View File

@ -91,13 +91,13 @@ impl OverlayState {
pub fn auto_movement(&mut self, app: &mut AppState) {
if let Some(parent) = self.parent_transform(app) {
self.transform = parent
* Affine3A::from_translation(self.spawn_point.into())
* Affine3A::from_quat(
* Affine3A::from_scale_rotation_translation(
Vec3::ONE * self.spawn_scale,
self.spawn_rotation
* Quat::from_rotation_x(f32::to_radians(-180.0))
* Quat::from_rotation_z(f32::to_radians(180.0)),
)
* Affine3A::from_scale(Vec3::ONE * self.spawn_scale);
self.spawn_point.into(),
);
self.dirty = true;
}