BREAKING CHANGE: 4x4 matrices are now column major

This commit is contained in:
2026-01-27 23:45:50 +03:00
parent 9294df8a19
commit 08f32f96e4
3 changed files with 54 additions and 52 deletions

View File

@@ -45,18 +45,10 @@ public class MonoGameTriangleBatch : Behaviour, ITriangleBatch, IFirstFrameUpdat
public void Begin(Matrix4x4? view = null, Matrix4x4? projection = null)
{
if (view != null)
this.view = view.Value.ToXnaMatrix();
else
this.view = Matrix.Identity;
Viewport viewport = graphicsDevice.Viewport;
if (projection != null)
this.projection = projection.Value.ToXnaMatrix();
else
{
Viewport viewport = graphicsDevice.Viewport;
this.projection = Matrix.CreateOrthographicOffCenter(viewport.X, viewport.Width, viewport.Height, viewport.Y, 0, 1);
}
this.view = (view ?? Matrix4x4.Identity).Transposed.ToXnaMatrix();
this.projection = (projection ?? Matrix4x4.CreateOrthographicViewCentered(viewport.Width, viewport.Height)).Transposed.ToXnaMatrix();
}
public void End() => Flush();