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