Panda3D Manual: Bullet Debug RendererIn the previous "hello world" sample we have been introduced to a few Bullet physics objects, for example the rigid body ( These objects are part of the Panda3D scene graph. But they are not visible. In order to be able to actually see a rigid body we had to reparent a visible geometry below the rigid body node. This is fine, since we (1) can control the way an object looks like, by choosing whatever visible geoemtry we want, and (2) we can create invisible objects too, by not reparenting any geometry below a rigid body. But when developing a game it sometimes would be handy to actually see where the physical objects are. This is what the The debug node is pretty easy to use. We just need to create such a node, place it in the scene graph, and tell the Bullet world that we have such a node. From now on Bullet will create a "debug" visualisation of the world's content within the debug node, whenever from panda3d.bullet import BulletDebugNode
We can control the amount of information rendered using the following methods:
There is one thing to pay attention to: By default the Since debug rendering is not very fast we can turn debug rendering on and off, without having to remove the debug node from the scene graph. Turning debug rendering on and of is simply done by hiding or showing the debug node. The following code shows how to toggle debug node visibility on and off, using the F1 key: from direct.showbase.DirectObject import DirectObject
© Carnegie Mellon University 2010 |