Better Rotation

This commit is contained in:
Brady
2018-09-25 09:39:59 -05:00
parent 9d3392c25c
commit c94ac6e26c
7 changed files with 155 additions and 19 deletions

View File

@@ -69,9 +69,9 @@ public final class LookBehavior extends Behavior implements ILookBehavior, Helpe
switch (event.getState()) {
case PRE: {
if (this.force) {
player().rotationYaw = this.target.getFirst();
player().rotationYaw = this.target.getYaw();
float oldPitch = player().rotationPitch;
float desiredPitch = this.target.getSecond();
float desiredPitch = this.target.getPitch();
player().rotationPitch = desiredPitch;
if (desiredPitch == oldPitch) {
nudgeToLevel();
@@ -79,7 +79,7 @@ public final class LookBehavior extends Behavior implements ILookBehavior, Helpe
this.target = null;
} else if (silent) {
this.lastYaw = player().rotationYaw;
player().rotationYaw = this.target.getFirst();
player().rotationYaw = this.target.getYaw();
}
break;
}
@@ -101,7 +101,7 @@ public final class LookBehavior extends Behavior implements ILookBehavior, Helpe
switch (event.getState()) {
case PRE:
this.lastYaw = player().rotationYaw;
player().rotationYaw = this.target.getFirst();
player().rotationYaw = this.target.getYaw();
break;
case POST:
player().rotationYaw = this.lastYaw;