Set offset and rotation from building

This commit is contained in:
2023-11-07 13:44:29 -05:00
parent 6aff5307c7
commit fc15e9310d
+6 -2
View File
@@ -986,10 +986,14 @@ public enum BuildingManager {
Path2D.Float stencilPath = new Path2D.Float();
// Add building offset to vertices
// Add building offset and rotation to vertices
for (Vector2f vertex : meshEntry)
for (Vector2f vertex : meshEntry) {
vertex.addLocal(building.getLoc().x, building.getLoc().y);
Vector3fImmutable rotatedPoint = new Vector3fImmutable(vertex.x, 0, vertex.y);
rotatedPoint = Vector3fImmutable.rotateAroundPoint(building.getLoc(), rotatedPoint, building.getBounds().getQuaternion().angleY);
vertex.set(rotatedPoint.x, rotatedPoint.z);
}
// Move to start of path