MCPcopy Create free account
hub / github.com/DGVPSH/SlackOpen / getRotations

Method getRotations

src/main/java/cc/slack/utils/other/MathUtil.java:23–32  ·  view source on GitHub ↗
(double x, double y, double z)

Source from the content-addressed store, hash-verified

21 }
22
23 public static float[] getRotations(double x, double y, double z) {
24 Vec3 lookVec = mc.thePlayer.getPositionEyes(1.0F);
25 double dx = lookVec.xCoord - x;
26 double dz = lookVec.zCoord - z;
27 double dy = lookVec.yCoord - y;
28 double dist = Math.sqrt(dx * dx + dz * dz);
29 double yaw = Math.toDegrees(Math.atan2(dz, dx));
30 double pitch = Math.toDegrees(Math.atan2(dy, dist));
31 return new float[]{(float)yaw + 90.0F, (float)pitch};
32 }
33
34 public static double getRandomInRange(double min, double max) {
35 if (min == max)

Callers

nothing calls this directly

Calls 1

getPositionEyesMethod · 0.80

Tested by

no test coverage detected