Advertisement
Corosus

faceCoord

Apr 12th, 2012
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.56 KB | None | 0 0
  1. public void faceCoord(int x, int y, int z, float f, float f1)
  2.     {
  3.         double d = x - posX;
  4.         double d2 = z - posZ;
  5.         double d1;
  6.         d1 = y - (posY + (double)getEyeHeight());
  7.        
  8.         double d3 = MathHelper.sqrt_double(d * d + d2 * d2);
  9.         float f2 = (float)((Math.atan2(d2, d) * 180D) / 3.1415927410125732D) - 90F;
  10.         float f3 = (float)(-((Math.atan2(d1, d3) * 180D) / 3.1415927410125732D));
  11.         rotationPitch = -updateRotation(rotationPitch, f3, f1);
  12.         rotationYaw = updateRotation(rotationYaw, f2, f);
  13.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement