@Test public void rotateMixed() { Rotation rotation = Rotation.rotate(Yaw.CLOCKWISE_180, Pitch.CLOCKWISE_90, Roll.CLOCKWISE_90); Quat4f rot = rotation.getQuat4f(); Vector3f dir = QuaternionUtil.quatRotate(rot, Side.FRONT.toDirection().getVector3f(), new Vector3f()); assertEquals(Direction.inDirection(dir).toSide(), rotation.rotate(Side.FRONT)); }
@Test public void rotateSideRoll() { Rotation rotation = Rotation.rotate(Roll.CLOCKWISE_90); Quat4f rot = rotation.getQuat4f(); Vector3f dir = QuaternionUtil.quatRotate(rot, Side.TOP.toDirection().getVector3f(), 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)); }