mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2025-07-02 16:05:29 +00:00
make RotationUtil#rotateVector return vector
This commit is contained in:
parent
cd4ccc993b
commit
56651a6307
@ -16,11 +16,11 @@ public final class RotationUtil {
|
||||
|
||||
/**
|
||||
* Rotate and mirror a coordinate pair.
|
||||
*
|
||||
* @param orig Vector to rotate.
|
||||
* @param orig Vector to rotate.
|
||||
* @param r Rotation
|
||||
* @return
|
||||
*/
|
||||
public static void rotateVector(Vector2 orig, Rotation r) {
|
||||
public static Vector2 rotateVector(Vector2 orig, Rotation r) {
|
||||
Vector2 copy = orig.clone();
|
||||
switch(r) {
|
||||
case CW_90 -> copy.setX(orig.getZ()).setZ(-orig.getX());
|
||||
@ -29,6 +29,7 @@ public final class RotationUtil {
|
||||
}
|
||||
orig.setX(copy.getX());
|
||||
orig.setZ(copy.getZ());
|
||||
return orig;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user