Ideas on Merging Collision Contacts

ekt

05-12-2006 23:56:45

there are times when it would be useful to postpone the contact creation. tipically if you want do some post processing/contact merging

how do you see this fitting in OgreODE? I'd imagine somthing like this:

  1. Geometry::collide should not call dJointCreateContact. OgreODE could simply fill a list of 'gathered potential contacts'[/*:m]
  2. The calling client would then process this list removing unwanted contacts or changing them (normal, depth etc)[/*:m]
  3. Finally the client would submit the modified list to OgreODE for dJointCreateContact[/*:m][/list:u]

    I can't see a way of doing it without changing OgreODE internally and i would like to hear something from the bosses :)

    here a thread on the ode mailing list where i got the advice on merging contacts (which would solve my real problem):
    http://q12.org/pipermail/ode/2006-May/018670.html
    http://q12.org/pipermail/ode/2006-May/018674.html
    http://q12.org/pipermail/ode/2006-May/018677.html

tuan kuranes

06-12-2006 14:42:35

Seems a bit specialized to go inside OgreOde Core...

But I added a way to do that in OgreODE CVS :

Use Collision Listener to register contact in a list client-side. Your listener add contact in a list each time called and return false to prevent ogreode creating contacts.

Then in OgreOde with a client_side registered stepListener where middleStep is overriden, do the contact merging on your list and do the djointattach work here.

Then tells us about results and provide a simples_scenes trimehs demo patch ;)

ekt

06-12-2006 14:50:58

that's exactly what i was searching for :) thanks tuan
i'll post results as soon as i have something

ekt

10-12-2006 10:46:56

fyi: i'll have to create a new class
class _OgreOdeExport ContactJoint:public Joint

in order to wrap the dJointCreateContact.

tuan kuranes

14-12-2006 13:53:06

Seems great. Btw, I think it also can be a way for user to use OgreOde only as a Collision library, and handle its physic itself...