use of org.joml.Quaternionfc in project Terasology by MovingBlocks.
the class RotationTest method testRotateSideYaw.
@Test
public void testRotateSideYaw() {
Rotation rotation = Rotation.rotate(Yaw.CLOCKWISE_90);
Quaternionfc rot = rotation.orientation();
Vector3f dir = rot.transform(Side.FRONT.toDirection().asVector3f(), new Vector3f());
assertEquals(Direction.inDirection(dir).toSide(), rotation.rotate(Side.FRONT));
assertEquals(Side.LEFT, Rotation.rotate(Yaw.CLOCKWISE_90).rotate(Side.FRONT));
assertEquals(Side.TOP, Rotation.rotate(Yaw.CLOCKWISE_90).rotate(Side.TOP));
}
use of org.joml.Quaternionfc in project Terasology by MovingBlocks.
the class RotationTest method testRotateMixed.
@Test
public void testRotateMixed() {
Rotation rotation = Rotation.rotate(Yaw.CLOCKWISE_180, Pitch.CLOCKWISE_90, Roll.CLOCKWISE_90);
Quaternionfc rot = rotation.orientation();
Vector3f dir = rot.transform(Side.FRONT.toDirection().asVector3f(), new Vector3f());
assertEquals(Direction.inDirection(dir).toSide(), rotation.rotate(Side.FRONT));
}
use of org.joml.Quaternionfc in project Terasology by MovingBlocks.
the class RotationTest method testRotateSideRoll.
@Test
public void testRotateSideRoll() {
Rotation rotation = Rotation.rotate(Roll.CLOCKWISE_90);
Quaternionfc rot = rotation.orientation();
Vector3f dir = rot.transform(Side.TOP.toDirection().asVector3f(), new Vector3f());
assertEquals(Direction.inDirection(dir).toSide(), rotation.rotate(Side.TOP));
assertEquals(Side.LEFT, Rotation.rotate(Roll.CLOCKWISE_90).rotate(Side.TOP));
assertEquals(Side.FRONT, Rotation.rotate(Roll.CLOCKWISE_90).rotate(Side.FRONT));
}
use of org.joml.Quaternionfc in project Terasology by MovingBlocks.
the class RotationTest method testRotateSidePitch.
@Test
public void testRotateSidePitch() {
Rotation rotation = Rotation.rotate(Pitch.CLOCKWISE_90);
Quaternionfc rot = rotation.orientation();
Vector3f dir = rot.transform(Side.FRONT.toDirection().asVector3f(), new Vector3f());
assertEquals(Direction.inDirection(dir).toSide(), rotation.rotate(Side.FRONT));
assertEquals(Side.TOP, Rotation.rotate(Pitch.CLOCKWISE_90).rotate(Side.FRONT));
assertEquals(Side.RIGHT, Rotation.rotate(Pitch.CLOCKWISE_90).rotate(Side.RIGHT));
}
Aggregations