Browse Source

Set offset and rotation from building

hull4
MagicBot 1 year ago
parent
commit
3e50782979
  1. 2
      src/engine/gameManager/BuildingManager.java

2
src/engine/gameManager/BuildingManager.java

@ -989,7 +989,7 @@ public enum BuildingManager {
// Add building offset and rotation 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); vertex.addLocal(building.getLoc().x, building.getLoc().z);
Vector3fImmutable rotatedPoint = new Vector3fImmutable(vertex.x, 0, vertex.y); Vector3fImmutable rotatedPoint = new Vector3fImmutable(vertex.x, 0, vertex.y);
rotatedPoint = Vector3fImmutable.rotateAroundPoint(building.getLoc(), rotatedPoint, building.getBounds().getQuaternion().angleY); rotatedPoint = Vector3fImmutable.rotateAroundPoint(building.getLoc(), rotatedPoint, building.getBounds().getQuaternion().angleY);
vertex.set(rotatedPoint.x, rotatedPoint.z); vertex.set(rotatedPoint.x, rotatedPoint.z);

Loading…
Cancel
Save