Skip to content

Commit

Permalink
matrix rotat e
Browse files Browse the repository at this point in the history
- Add rotateTo method for non-object vectors and directions
  • Loading branch information
Jozufozu committed Feb 2, 2025
1 parent 357c116 commit 92fff51
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,16 @@ default Self rotateToFace(Direction facing) {
};
}

default Self rotateTo(float fromX, float fromY, float fromZ, float toX, float toY, float toZ) {
return rotate(new Quaternionf().rotateTo(fromX, fromY, fromZ, toX, toY, toZ));
}

default Self rotateTo(Vector3fc from, Vector3fc to) {
return rotate(new Quaternionf().rotateTo(from, to));
return rotateTo(from.x(), from.y(), from.z(), to.x(), to.y(), to.z());
}

default Self rotateTo(Direction from, Direction to) {
return rotateTo(from.getStepX(), from.getStepY(), from.getStepZ(), to.getStepX(), to.getStepY(), to.getStepZ());
}

@SuppressWarnings("unchecked")
Expand Down

0 comments on commit 92fff51

Please sign in to comment.