Browse Source

Set offset and rotation from building

hull4
MagicBot 1 year ago
parent
commit
fc15e9310d
  1. 8
      src/engine/gameManager/BuildingManager.java

8
src/engine/gameManager/BuildingManager.java

@ -986,10 +986,14 @@ public enum BuildingManager { @@ -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

Loading…
Cancel
Save