Changed Rotation from Euler to Quaternion (TransformComponent)

This commit is contained in:
Simon Lübeß
2021-09-03 16:44:50 +02:00
parent d555a80d8d
commit ff4cd48f1e
3 changed files with 72 additions and 18 deletions
+2 -3
View File
@@ -16,7 +16,7 @@ namespace GlitchyEngine.World
private static void UpdateEntity(Entity entity, TransformComponent* transform, EcsWorld world)
{
// Todo: this probably needs a rewrite as it may scale poorly with deep hierarchies!
// Todo: test scaling with deep hierarchies!
// transform was updated this frame -> skip
if(transform.Frame == _frame)
@@ -28,8 +28,7 @@ namespace GlitchyEngine.World
if(transform.IsDirty)
{
transform.LocalTransform = .Translation(transform.Position) * .RotationX(transform.Rotation.X) *
.RotationY(transform.Rotation.Y) * .RotationZ(transform.Rotation.Z) * .Scaling(transform.Scale);
transform.LocalTransform = .Translation(transform.Position) * .RotationQuaternion(transform.Rotation) * .Scaling(transform.Scale);
transform.IsDirty = false;