Attempted at fixing 2D camera system.

This commit is contained in:
2019-02-24 22:44:02 -06:00
parent 5f04dfd73a
commit 051f3b04b5
9 changed files with 41 additions and 18 deletions

View File

@@ -79,7 +79,7 @@ namespace RecrownedAthenaeum.Render
{
primitiveBatch.primitiveCount = filled ? 3 : 4;
Vector2[] corners = new Vector2[4];
corners[1] = new Vector2 (width, 0);
corners[1] = new Vector2(width, 0);
corners[2] = new Vector2(width, height);
corners[3] = new Vector2(0, height);
@@ -89,16 +89,22 @@ namespace RecrownedAthenaeum.Render
for (int i = 0; i < corners.Length; i++)
{
corners[i] = Vector2.Transform(corners[i], rotMat);
corners[i].X += x;
corners[i].Y += y;
}
}
for (int i = 0; i < corners.Length; i++)
{
corners[i].X += x;
corners[i].Y += y;
}
primitiveBatch.AddVertex(corners[0], color);
primitiveBatch.AddVertex(corners[1], color);
primitiveBatch.AddVertex(corners[2], color);
primitiveBatch.AddVertex(corners[3], color);
primitiveBatch.AddVertex(corners[0], color);
primitiveBatch.Flush();
}
}
}