Panda3D and PyODE

Could you please publish samples for using Panda3D and PyODE?
I installed Panda and PyODE, they work.

This is what I have found from PyODE:

Please help to find some tutorial and/or Python examples for PyODE and Panda3D integration.

Sorry for my English.

Well, to my knowledge, we haven’t done this at the entertainment technology center. But I believe that Schell Games did this at one point. Can somebody from Schell comment?

Thank you, Josh.

The question is how to create main loop in Panda and manage position and rotation for all objects from PyODE.

I don’t know exactly what you need to do, but it sounds like you need to create a task (a function automatically called every frame) and update ODE with the positions of objects.

You can look up tasks in the manual or the samples. The tasks tutorial in particular (the asteroids game) is a good example of using a task for a main loop.

We didn’t actually use PyODE, but created our own wrapper instead. That said, the approach is pretty straightforward either way. As was mentioned, what you want to do is set up a task that will step the physics simulation and update Panda objects based on the position and orientation of the ODE objects each frame.

The biggest reason to not use PyODE is if you’re dealing with a lot of potential collisions and speed is a concern. ODE requires you to provide a collision callback function to determine which potential collisions actually need to be checked and which can be ignored. This can speed up the simulation considerably, but if it’s implemented in python (as with PyODE), then you end up with a large number of individual calls passing between C and python each frame, and you can lose all of the time you’ve gained.

If your simulation is going to remain reasonably simple, then PyODE is probably a fine way to go. It shouldn’t be too hard for someone to whip up an example, although I definitely think that in the long term, ODE will want to be integrated into Panda at the C++ level.

Thank you, JasonPratt

Do you know how slow is using PyODE comparing to your own wrapper? Is it 10…100 times or less?

Also is there a way to use Panda3D native collision in PyODE?
I mean check for collision in Panda and send a results to PyODE?

Thank you very much for your help.

As with most things, the speed difference will depend a lot on your individual usage. I haven’t done any testing, but a factor of ten or more wouldn’t surprise me, assuming many potential collisions.

It is theoretically possible to use Panda’s collision with ODE (ODE supports third party collision detection), but that wouldn’t be a trivial amount of work, and I don’t know that you would get much benefit from it.