tirbofish/dropbear · commit
060c236f3f92d75a8b55d31a979217fc1025d799
feature: multisampling with MSAA4
feature: increase active camera speed with mouse wheel scroll
fix: when TRS animation was run, it would rotate the entire model, making it look like it was standing on its nose
jarvis, run github actions.
Signature present but could not be verified.
Unverified
@@ -18,12 +18,18 @@ use egui::Ui; pub struct EntityTransform { local: Transform, world: Transform, + #[serde(default)] + animation: Transform, } impl EntityTransform { /// Creates a new [EntityTransform] from a local and world [Transform] pub fn new(local: Transform, world: Transform) -> Self { - Self { local, world } + Self { + local, + world, + animation: Transform::default(), + } } /// Creates a new [EntityTransform] from a world [Transform] and a default local transform. @@ -33,6 +39,7 @@ impl EntityTransform { Self { world, local: Transform::default(), + animation: Transform::default(), } } @@ -59,22 +66,26 @@ impl EntityTransform { /// Combines both transforms into one, propagating the local transform /// to the world transform and returning a uniform [Transform] pub fn sync(&self) -> Transform { - let scaled_pos = self.local.position * self.world.scale; - let rotated_pos = self.world.rotation * scaled_pos; - let position = self.world.position + rotated_pos; + let combined = self.world.matrix() * self.local.matrix() * self.animation.matrix(); + let (scale, rotation, position) = combined.to_scale_rotation_translation(); Transform { position, - rotation: self.world.rotation * self.local.rotation, - scale: self.world.scale * self.local.scale, + rotation, + scale, } }
Large diffs are not rendered by default. Showing the first 50 of 385 lines. Show full diff