Apply rolling to the player's model when flying

This commit is contained in:
Sollace 2021-08-18 20:13:22 +02:00
parent 90c89f89c1
commit 8081d4c1a6

View file

@ -73,6 +73,16 @@ public class WorldRenderDelegate {
matrices.translate(x, y + owner.getHeight() / 2, z);
matrices.multiply(Vec3f.POSITIVE_X.getDegreesQuaternion(roll));
matrices.multiply(Vec3f.POSITIVE_Y.getDegreesQuaternion(roll));
if (pony instanceof Pony) {
roll = ((Pony)pony).getCamera().calculateRoll();
matrices.multiply(Vec3f.NEGATIVE_Y.getDegreesQuaternion(yaw));
matrices.multiply(Vec3f.POSITIVE_Z.getDegreesQuaternion(roll));
matrices.multiply(Vec3f.POSITIVE_Y.getDegreesQuaternion(yaw));
}
matrices.translate(-x, -y - owner.getHeight() / 2, -z);
if (negative) {