fix: MonoGame view matrix calculation issues
This commit is contained in:
@@ -113,10 +113,10 @@ public class MonoGameCamera2D : Behaviour, ICamera2D, IFirstFrameUpdate, ILastFr
|
|||||||
public void PreDraw()
|
public void PreDraw()
|
||||||
{
|
{
|
||||||
ProjectionMatrix = Matrix4x4.CreateOrthographicViewCentered(Viewport.Width, Viewport.Height);
|
ProjectionMatrix = Matrix4x4.CreateOrthographicViewCentered(Viewport.Width, Viewport.Height);
|
||||||
ViewMatrix =
|
ViewMatrix = Matrix4x4.Identity
|
||||||
Matrix4x4.CreateTranslation(new Vector3D(-Transform.Position.X, -Transform.Position.Y, 0f))
|
.ApplyScale(Transform.Scale.X.Max(Transform.Scale.Y))
|
||||||
.ApplyRotationZ(Transform.Rotation * Math.DegreeToRadian)
|
.ApplyScale(Zoom)
|
||||||
.ApplyScale(Transform.Scale.X.Max(Transform.Scale.Y))
|
.ApplyRotationZ(-Transform.Rotation * Math.DegreeToRadian)
|
||||||
.ApplyScale(Zoom);
|
.ApplyTranslation(new Vector3D(-Transform.Position.X, -Transform.Position.Y, 0f));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user