From: Chris B. <chr...@gm...> - 2007-02-22 17:26:11
|
On 21/02/07, Andr=E1s =C1cs <a....@in...> wrote: > I am making a 2D gravity shooter, and not > sure how to integrate pixel-perfect collision > (a terrain) into a simulation. > I read that a collider could be plugged into ode. > How can this be done? I assume you have a collision detector that detects ODE geoms penetrating your terrain? If so, all you need to do is to call this collider to generate contacts, then convert them into ode.Contact instances, then for each of those create an ode.ContactJoint and attach it to the penetrating Geom. But that's relatively easy, the hard part is writing the collision detector. If you don't have one, you'll need to figure out how to detect contacts and contact direction etc. between whatever terrain model you're using and each ODE Geom. |