Add fudge factors for the collision check on portal exit
authornemo
Fri, 08 Jul 2011 12:18:27 -0400
changeset 5402 c49a84b04d22
parent 5400 1b81dc7d238b
child 5404 d95cb8f8bd91
child 5405 5b17e1b3e0d5
Add fudge factors for the collision check on portal exit
hedgewars/GSHandlers.inc
--- a/hedgewars/GSHandlers.inc	Thu Jul 07 08:09:12 2011 -0400
+++ b/hedgewars/GSHandlers.inc	Fri Jul 08 12:18:27 2011 -0400
@@ -3756,13 +3756,19 @@
            or (iterator^.Y < Gear^.Y - r)
            or (iterator^.Y > Gear^.Y + r) then
             continue;
-
+(*
+Square check causes fail on many innocent cases. the 3/4s and 1.5 fudge factors... help.
+Might still need to remove this section
+*)
         //Will if fit through?
         //set r to be portal distance
-        r := Int2hwFloat(Gear^.Radius +1);
-
-        o_x := hwRound(conPortal^.X + conPortal^.dX);
-        o_y := hwRound(conPortal^.Y + conPortal^.dY);
+        r := Int2hwFloat(Gear^.Radius * 3 div 4);
+        o_x := hwRound(conPortal^.X + (conPortal^.dX*_1_5));
+        o_y := hwRound(conPortal^.Y + (conPortal^.dY*_1_5));
+        //r := Int2hwFloat(Gear^.Radius +1);
+
+        //o_x := hwRound(conPortal^.X + conPortal^.dX);
+        //o_y := hwRound(conPortal^.Y + conPortal^.dY);
         r_x := hwRound(conPortal^.X+r*conPortal^.dX);
         r_y := hwRound(conPortal^.Y+r*conPortal^.dY);
         rr_x := hwRound(conPortal^.X+r*conPortal^.dX*2);