Skip to content

Instantly share code, notes, and snippets.

@StillManic
Created October 26, 2015 05:28
Show Gist options
  • Save StillManic/5bb45a3aad5eb7982892 to your computer and use it in GitHub Desktop.
Save StillManic/5bb45a3aad5eb7982892 to your computer and use it in GitHub Desktop.
public static Matrix4f getMatrix(EnumFacing facing) {
Matrix4f ret = new Matrix4f();
switch (facing) {
case DOWN: ret = ModelRotation.X90_Y0.getMatrix(); break;
case UP: ret = ModelRotation.X270_Y0.getMatrix(); break;
case NORTH: ret = ModelRotation.X0_Y0.getMatrix(); break;
case SOUTH: ret = ModelRotation.X0_Y180.getMatrix(); break;
case WEST: ret = ModelRotation.X0_Y270.getMatrix(); break;
case EAST: ret = ModelRotation.X0_Y90.getMatrix(); break;
default: ret.setIdentity();
}
return ret;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment