Created
April 28, 2017 15:14
-
-
Save johngirvin/a60ae7f164d3490ff79f902cf2759eab to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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