The Open Dynamics Engine (ODE) in short, is a very powerful and feature-rich implementation of a rigid body physics system. It has been successfully integrated into various commercial simulation and game projects like World of Goo and Nail'd, for example. Panda3D comes with this proven piece of physics technology included out of the box. This leaves it to us to enable and use ODE in our code, so let's get started!
To get set for this recipe, please follow Setting up the game structure first. You can find this recipe in Chapter 1.
The ODE physics engine is used like the following in a Panda3D application:
Open
Application.py
and add this code:from direct.showbase.ShowBase import ShowBase from panda3d.core import * from panda3d.ode import * import random class Application(ShowBase): def __init__(self): ShowBase.__init__(self) self.smiley = loader.loadModel("smiley") self.smileyCount = 0 self.cam.setPos...