cornedor

Untitled

Aug 25th, 2013
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var pa = mouseY - a.y1 - ((a.y2 - a.y1)/(a.x2 - a.x1)) * (mouseX - a.x1);
  2. var pb = mouseY - a.y2 - ((a.y3 - a.y2)/(a.x3 - a.x2)) * (mouseX - a.x2);
  3. var pc = mouseY - a.y3 - ((a.y4 - a.y3)/(a.x4 - a.x3)) * (mouseX - a.x3);
  4. var pd = mouseY - a.y4 - ((a.y1 - a.y4)/(a.x1 - a.x4)) * (mouseX - a.x4);
  5.  
  6. var ba = (playerPlane.getRotation() > Math.PI*0.5 && playerPlane.getRotation() < Math.PI*1.5);
  7. var bb = (playerPlane.getRotation() > 0 && playerPlane.getRotation() < Math.PI);
  8.  
  9. var ia = (ba && pa < 0) || (!ba && pa > 0);
  10. var ib = (bb && pb < 0) || (!bb && pb > 0);
  11. var ic = !((ba && pc < 0) || (!ba && pc > 0));
  12. var id = !((bb && pd < 0) || (!bb && pd > 0));
  13.  
  14. l.innerHTML = ia && ib && ic && id;
Advertisement
Add Comment
Please, Sign In to add comment