SteamWar/FightSystem
Archiviert
13
1

Add Pitch/Yaw Vector Fix

Dieser Commit ist enthalten in:
jojo 2020-05-23 12:50:55 +02:00
Ursprung c54ddbb60a
Commit c1d62e5e37

Datei anzeigen

@ -268,14 +268,14 @@ public class Config {
Vector v1 = TeamBlueSpawn.toVector().subtract(TeamRedSpawn.toVector()); Vector v1 = TeamBlueSpawn.toVector().subtract(TeamRedSpawn.toVector());
double pitch = Math.toDegrees(v1.angle(v1.clone().setY(0))); double pitch = Math.toDegrees(v1.angle(v1.clone().setY(0)));
double yaw = Math.toDegrees(v1.clone().setY(0).angle(new Vector(0, 0, -1))); double yaw = Math.toDegrees(v1.clone().setY(0).angle(new Vector(0, 0, 1)));
double pitchInverted = pitch * -1; double pitchInverted = pitch * -1;
double yawInverted = yaw + 180; double yawInverted = yaw + 180;
TeamBlueSpawn.setYaw((float) yaw); TeamBlueSpawn.setYaw((float) yawInverted);
TeamBlueSpawn.setPitch((float) pitch); TeamBlueSpawn.setPitch((float) pitch);
TeamRedSpawn.setYaw((float) yawInverted); TeamRedSpawn.setYaw((float) yaw);
TeamRedSpawn.setPitch((float) pitchInverted); TeamRedSpawn.setPitch((float) pitchInverted);
SpecSpawn = new Location(world, SpecSpawn = new Location(world,