Best physics engine for panda?

What’s the best physics engine for panda3d, and where can I find tutorials using panda and said physics engine?

I need the physgine to be able to handle land, vehicle physics well. Acceleration, braking, and g-forces.

i dont think there is a “best” physic engine. but one that is working with panda3d is ODE or rather its python bindings PyODE. it worked quite well when i tried it month ago.
https://discourse.panda3d.org/viewtopic.php?t=2510&highlight=physic+engine <- might help you a little.
ode is used in many games, lots of them are car-simulators, some are well known. well it should provide anything you need.

edit: … reminds me… someone talked about merging a new physic engine into panda by default, cant tell for sure but i think it was ode. in any case… searching the forum might help you. there where several other physic examples posted. not only ode but also newton and this aegis physix thing…

Thanks Thomas. That egg in a bowl thing is amazing, and the frame rate is killer. I’ll have to dissect the code which will take some time as I am still learning python let alone Panda GE and PyODE PE.

ODE is good and simple. I have used it before.

Say treeform, you know of any tutorials integrating ODE into Panda? Or any sites that talk of integration theories or examples?

I haven’t used ODE with Panda specifically, but I have used each separately, as well as worked with other game engines with integrated physics (Havok).

The main principle is to ignore and disable everything Panda does with regard to physics or collisions, and setup your own physics and collisions with ODE. Then, each frame you run the ODE simulation, query the position and rotation of the ODE simulated objects, and copy these values (converting as necessary to deal with slightly different formats) over the your Panda objects. Basically, Panda becomes a rendering only engine which provides a view into your ODE simulation. You can still use things like Panda tasks, but any action that involves moving or rotating an object simulated in ODE should be handled by applying the appropriate ODE forces and torques instead of trying to manipulate the Panda objects directly.

In most cases you will want to create simple ODE collision objects for each Panda object (say a capsule for a humanoid character), with possibly a more complex trimesh for your static world geometry. In this case you may want to use Panda functions to query loaded graphics geometry in order to create a list of triangles that ODE can build a trimesh out of.

I’d highly recommend trying out the demo programs on the PyODE website (just google it). The demos use PyODE with PyOpenGL, but because the ODE simulation will be mostly independent from the Panda graphics in a combined project you should be able to lift the necessary code right out of these demos and into a Panda project.

The one big thing to watch out for is that ODE works best with a fixed frame rate, while Panda runs at a variable frame rate. Depending on the complexity of your game, you may want to pick a fixed frame rate for ODE and limit Panda’s speed to this by making it sleep at the end of each frame it finishes early. You can do variable frame rate with ODE, but this is tricky and can create stability problems.