forked from MagicBane/Server
Rotation slot location by building rotation.
This commit is contained in:
@@ -917,8 +917,14 @@ public class Mob extends AbstractIntelligenceAgent {
|
|||||||
slotLocation = BuildingManager.getSlotLocation(building, slot);
|
slotLocation = BuildingManager.getSlotLocation(building, slot);
|
||||||
|
|
||||||
this.bindLoc = building.getLoc().add(slotLocation);
|
this.bindLoc = building.getLoc().add(slotLocation);
|
||||||
this.loc = building.getLoc().add(slotLocation);
|
|
||||||
this.endLoc = bindLoc;
|
// Rotate slot position by the building rotation
|
||||||
|
|
||||||
|
Vector3fImmutable.rotateAroundPoint(building.getLoc(), this.bindLoc, -building.getBounds().getQuaternion().angleY);
|
||||||
|
|
||||||
|
this.loc = new Vector3fImmutable(bindLoc);
|
||||||
|
this.endLoc = new Vector3fImmutable(bindLoc);
|
||||||
|
;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -361,7 +361,12 @@ public class NPC extends AbstractCharacter {
|
|||||||
slotLocation = BuildingManager.getSlotLocation(building, slot);
|
slotLocation = BuildingManager.getSlotLocation(building, slot);
|
||||||
|
|
||||||
this.bindLoc = building.getLoc().add(slotLocation);
|
this.bindLoc = building.getLoc().add(slotLocation);
|
||||||
this.loc = building.getLoc().add(slotLocation);
|
|
||||||
|
// Rotate slot position by the building rotation
|
||||||
|
|
||||||
|
Vector3fImmutable.rotateAroundPoint(building.getLoc(), this.bindLoc, -building.getBounds().getQuaternion().angleY);
|
||||||
|
|
||||||
|
this.loc = new Vector3fImmutable(bindLoc);
|
||||||
|
|
||||||
// Configure region and floor/level for this NPC
|
// Configure region and floor/level for this NPC
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user