Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var pa = mouseY - a.y1 - ((a.y2 - a.y1)/(a.x2 - a.x1)) * (mouseX - a.x1);
- var pb = mouseY - a.y2 - ((a.y3 - a.y2)/(a.x3 - a.x2)) * (mouseX - a.x2);
- var pc = mouseY - a.y3 - ((a.y4 - a.y3)/(a.x4 - a.x3)) * (mouseX - a.x3);
- var pd = mouseY - a.y4 - ((a.y1 - a.y4)/(a.x1 - a.x4)) * (mouseX - a.x4);
- var ba = (playerPlane.getRotation() > Math.PI*0.5 && playerPlane.getRotation() < Math.PI*1.5);
- var bb = (playerPlane.getRotation() > 0 && playerPlane.getRotation() < Math.PI);
- var ia = (ba && pa < 0) || (!ba && pa > 0);
- var ib = (bb && pb < 0) || (!bb && pb > 0);
- var ic = !((ba && pc < 0) || (!ba && pc > 0));
- var id = !((bb && pd < 0) || (!bb && pd > 0));
- l.innerHTML = ia && ib && ic && id;
Advertisement
Add Comment
Please, Sign In to add comment