Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void faceCoord(int x, int y, int z, float f, float f1)
- {
- double d = x - posX;
- double d2 = z - posZ;
- double d1;
- d1 = y - (posY + (double)getEyeHeight());
- double d3 = MathHelper.sqrt_double(d * d + d2 * d2);
- float f2 = (float)((Math.atan2(d2, d) * 180D) / 3.1415927410125732D) - 90F;
- float f3 = (float)(-((Math.atan2(d1, d3) * 180D) / 3.1415927410125732D));
- rotationPitch = -updateRotation(rotationPitch, f3, f1);
- rotationYaw = updateRotation(rotationYaw, f2, f);
- }
Advertisement
Add Comment
Please, Sign In to add comment