Not all problems concerning world and player interaction need to be handled by a fully fledged physics API—sometimes a much more basic and lightweight system is just enough for our purposes. This is why in this recipe we dive into the collision handling system that is built into the Panda3D engine.
This recipe relies upon the project structure created in Setting up the game structure found in Chapter 1, Setting Up Panda3D and Configuring Development Tools.
Let's go through this recipe's tasks:
Open
Application.py
and add the include statements as well as the constructor of theApplication
class:from direct.showbase.ShowBase import ShowBase from panda3d.core import * import random class Application(ShowBase): def __init__(self): ShowBase.__init__(self) self.cam.setPos(0, -50, 10) self.setupCD() self.addSmiley() self.addFloor() taskMgr.add(self.updateSmiley, "UpdateSmiley...