Jump to content

  • Log In with Google      Sign In   
  • Create Account


LilBudyWizer

Member Since 16 Dec 1999
Offline Last Active Mar 23 2014 03:26 AM
-----

#4842799 Sticky FPS Ellipsoid-Polygon Collision Detection

Posted by LilBudyWizer on 31 July 2011 - 04:45 AM

You cannot move closer than 1 to the wall, but if you are already closer than 1 then you can't move more than 1 away. If there's as an opposing wall the same is true for it. If you are further than 1 from the opposing wall and less than 1 away from the near wall then you are stuck between two planes 1-d wide where d is the distance between the two walls. If they are reasonably far apart you can move parallel to the wall. If they were, say, a nanometer apart you likely couldn't move. Why? Because you can't steer precisely enough. You have to be within a tiny fraction of a degree of exactly parallel to move.

If you move the player away from the wall, but not far enough it's the same effect. Moving them one little nanometer too little means they effectively can't move at all. Why would you move them one little nanometer too little? Precision error. It should have been move them a millimeter plus what you calculated. That way if you calculate to move them 0.999999999m away rather than 1.000000000m away it doesn't really matter because you'll move them 1.000999999m away and they aren't stuck moving between two planes 0.000000001m apart. That does not solve your problem with edge collision detection though, it just masks it. They should have never been so close they needed to be moved to start with.

Is that number too big? Too small? How would I know? If that's a time it could be a microsecond or a nanosecond depending upon whether 1.0 is a second or a millisecond, or it could be century for all I know. There is a minimum e such that x-e != x. The scale of e depends upon the scale of x. This is floating point, there is no right value. Rather what there is are points in your calculation where you can say you only need a limited precision in real world units. If you only need to be within a mm then subtract 1 mm. It's crude, it works. If 1m is as close as they can get to that object then it doesn't matter if they are stopped at 1.001m. They can't tell a 0.01% differance without instrumentation. Use a value down to the micrometer and then use a sliding vector that's not quite orthogonal and you can end up a micrometer too close and now you're stuck.


PARTNERS