math - Resolving a Circle-Circle Collision -
i writing software extends circle-rectangle collision detection (intersection) include responses collision. circle-edge , circle-rectangle rather straight-forward. circle-circle has me stumped.
for example, let 2 circles collide, 1 red , 1 green, in discrete event simulation. might have following situation:
immediately after collide have:
here rip , gip locations of circles @ previous clock tick. @ current clock tick, collision detected @ rdp , gdp. however, collision occurred between clock ticks when 2 circles @ rcp , gcp. @ clock tick, red circle moves rvy downward , rvx rightward; green circle moves gvy downward , gvx leftward. rvy not equal gvy; nor rvx equal gvx.
the collision occurs when distance between circle centers less or equal sum of circles' radii, is, in preceding figure, d <= ( rr + gr ). @ collision d < ( rr + gr ), need position dps cps before adjusting circles' velocity components. in case of d == ( rr + gr ), no repositioning required since dps @ cps.
this problem: how make move cps. authors have suggested one-half of penetration, given p in following figure, applied.
to me plain wrong. assumes velocity vectors of 2 circles equal that, in example, not case. think penetration has computation how eludes me. know problem can recast problem of right similar triangles in want solve gcdy , gcdx.
the collision modeled elastic, , math exchange of inertia in place. issue position circles @ collision.
if you're looking basic reference on inelastic collisions circular objects, pool hall lessons: fast, accurate collision detection between circles or spheres joe van den heuvel , miles jackson easy follow.
from least formal formal, here follow references on craft of implementing programming underpins solution question (collision responses).
- brian beckman & charles torre the physics in games - real-time simulation explained
- chris hecker, physics, part 3: collision response, game developer 1997
- david baraff, physically based modeling: principles , practice, online siggraph '97 course notes, of particular relevance slides rigid body simulations.
you're going have accept approximations - beckman demonstrates in video simple cases, isn't possible analytically predict occur, worse because simulating continuous system discrete steps.
Comments
Post a Comment