collision detection problem under extreme case.

hi, your guys.during my game-programming time have been encountering problem, collision detection problem.
such as the following case , for example. given two game object,one for “ball” that has inconstant speed to act under the wall, one for “thin wall”(line) that is static object used to block that ball. one time,suddenly, once ball’s speed approach to big cause collision detection failed,that is ball run across the wall instantly, above the wall. it’s definitely wrong. :frowning:

such as the collision detection problem, how would you solve this. thank you.

Show us connection between your collision detection and game loop. When speed becomes big, it’ll overlap detection which performed each frame call.

sorry about that。i mean collision penetration。
:slight_smile:

Simple hack solution: Halve time step, double updates per seconds. =D

Clamp speed of ball so it don’t move more than radius length each frame.

Predict it (but it’s difficult).

Why would it be difficult? Make a loop in the ball update that increments the balls radius until it reaches its destination - checking for collisions along the way.

How about line collision? Make a line from the old location to the new location. If that line intersects anything in its path, backtrack the ball and make it collide :slight_smile:

yes,but if anything(walls) more than once along with the path.what which one is really contact first, how would you determine that? :wink:

backtrack the ball, AKA bring the ball back to the original position and slowly move by its radius it until it hits something.

Search ‘swept’ circle to line collisions…

https://www.google.co.uk/webhp?sourceid=chrome-instant&ix=seb&ie=UTF-8#hl=en&sclient=psy-ab&q=swept+circle+line+collision&oq=swept+circle+line+collision&aq=f&aqi=&aql=&gs_l=serp.3...195806.201583.0.201827.17.15.1.0.0.1.96.836.15.15.0...0.0.YsAR6aI1P34&pbx=1&bav=on.2,or.r_gc.r_pw.r_cp.r_qf.,cf.osb&fp=42e46945646da5f5&ix=seb&biw=1394&bih=860

Consider all the collisions from t0 -> t1 and take the one that occurs first (this will be the line the circle hits first).

:)i think i got this. thank all you guys replying, also thank PaulCunningham guiding me the right way.