mirror of
https://github.com/Jozufozu/Flywheel.git
synced 2025-02-10 12:15:03 +01:00
matrix rotat e
- Add rotateTo method for non-object vectors and directions
This commit is contained in:
parent
357c116286
commit
92fff518cd
1 changed files with 9 additions and 1 deletions
|
@ -99,8 +99,16 @@ public interface Rotate<Self extends Rotate<Self>> {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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) {
|
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")
|
@SuppressWarnings("unchecked")
|
||||||
|
|
Loading…
Reference in a new issue