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()
|
||||
{
|
||||
ProjectionMatrix = Matrix4x4.CreateOrthographicViewCentered(Viewport.Width, Viewport.Height);
|
||||
ViewMatrix =
|
||||
Matrix4x4.CreateTranslation(new Vector3D(-Transform.Position.X, -Transform.Position.Y, 0f))
|
||||
.ApplyRotationZ(Transform.Rotation * Math.DegreeToRadian)
|
||||
.ApplyScale(Transform.Scale.X.Max(Transform.Scale.Y))
|
||||
.ApplyScale(Zoom);
|
||||
ViewMatrix = Matrix4x4.Identity
|
||||
.ApplyScale(Transform.Scale.X.Max(Transform.Scale.Y))
|
||||
.ApplyScale(Zoom)
|
||||
.ApplyRotationZ(-Transform.Rotation * Math.DegreeToRadian)
|
||||
.ApplyTranslation(new Vector3D(-Transform.Position.X, -Transform.Position.Y, 0f));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user