Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
diff --git a/Source/MonoGame.Extended.Entities/Entities/TransformComponent2D.cs b/Source/MonoGame.Extended.Entities/Entities/TransformComponent2D.cs
index 9f025a1..9a25f7f 100644
--- a/Source/MonoGame.Extended.Entities/Entities/TransformComponent2D.cs
+++ b/Source/MonoGame.Extended.Entities/Entities/TransformComponent2D.cs
@@ -167,7 +168,7 @@ namespace MonoGame.Extended.Entities
if (Parent != null)
{
Parent.GetWorldMatrix(out matrix);
- Matrix2D.Multiply(ref matrix, ref localMatrix, out matrix);
+ Matrix2D.Multiply(ref localMatrix, ref matrix, out matrix);
}
else
{
@@ -177,18 +178,9 @@ namespace MonoGame.Extended.Entities
private void RecalculateLocalMatrix(out Matrix2D matrix)
{
- if (Parent != null)
- {
- var parentPosition = Parent.Position;
- matrix = Matrix2D.CreateTranslation(-parentPosition) * Matrix2D.CreateScale(_scale) *
- Matrix2D.CreateRotationZ(-_rotation) * Matrix2D.CreateTranslation(parentPosition) *
- Matrix2D.CreateTranslation(_position);
- }
- else
- {
- matrix = Matrix2D.CreateScale(_scale) * Matrix2D.CreateRotationZ(-_rotation) *
- Matrix2D.CreateTranslation(_position);
- }
+ matrix = Matrix2D.CreateScale(_scale) *
+ Matrix2D.CreateRotationZ(_rotation) *
+ Matrix2D.CreateTranslation(_position);
}
[Flags]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment