I am using Panda’s ODE:
space = OdeSimpleSpace()
contactgroup = OdeJointGroup()
def simulationTask1(self, task):
self.space.autoCollide() # Setup the contact joints
# Step the simulation and set the new positions
for b_ode in self.objectlist:
np = b_ode.realObj
#body = b_ode.body
body = b_ode.geom
np.setPosQuat(render, body.getPosition(), Quat(body.getQuaternion()))
self.contactgroup.empty() # Clear the contact joints
How can I get back the contact joints from self.contactgroup before I empty it ? I would like to know the contact points to make some visual effect. But I can’t find the method to do so.
Also, is there corresponding functions in Panda’s ODE to perform a near_callback when object collides ?
I had this exact same problem only a few days ago.
Have a look at the Egg & Bowl Demo: discourse.panda3d.org/viewtopic.php … sic+engine
It grabs the contact joints, and has a method for visualising collision meshes and collisions etc, however it is a lengthy (but awesome) piece of code if you are not familiar with ODE. Note that it also uses PyODE directly, rather than the Panda3D wrappers.
As far as I could tell going over the manual and the forums, in the current version of Panda3D’s builtin ODE support, there is no way to get the contact joints? -Maybe someone tell me I’m wrong
If you still want to use Panda3D’s ODE, i found that the ODE car demo was very informative: discourse.panda3d.org/viewtopic.php?t=5646.
Hope this helps,
Thank you for the tips !
I do a search again and some posts mentioned about the better support in the coming version 1.6…
OdeSpace.getContactData() seems corresponding to the contact joint points x,y,z …
After looking into odeSpace.cxx, the getContactData is more for debugging purpose. Looking like a lot of contact information is lost and not able to be retrieved. Has to use ODE or wait for version 1.6.