IDIOTT
This commit is contained in:
parent
6dddb2e895
commit
2edc7327ab
@ -27,7 +27,7 @@ public final class Utils {
|
|||||||
*/
|
*/
|
||||||
public static Tuple<Float, Float> calcRotationFromVec3d(Vec3d orig, Vec3d dest) {
|
public static Tuple<Float, Float> calcRotationFromVec3d(Vec3d orig, Vec3d dest) {
|
||||||
double yaw = Math.atan2(orig.x - dest.x, -orig.z + dest.z);
|
double yaw = Math.atan2(orig.x - dest.x, -orig.z + dest.z);
|
||||||
double dist = Math.sqrt((orig.x - dest.x) * (orig.x - dest.x) + (-orig.x + dest.x) * (-orig.z + dest.z));
|
double dist = Math.sqrt((orig.x - dest.x) * (orig.x - dest.x) + (-orig.z + dest.z) * (-orig.z + dest.z));
|
||||||
double pitch = Math.atan2(orig.y - dest.y, dist);
|
double pitch = Math.atan2(orig.y - dest.y, dist);
|
||||||
return new Tuple<>((float) (yaw * 180 / Math.PI),
|
return new Tuple<>((float) (yaw * 180 / Math.PI),
|
||||||
(float) (pitch * 180 / Math.PI));
|
(float) (pitch * 180 / Math.PI));
|
||||||
|
Loading…
Reference in New Issue
Block a user