Panda3D Manual: The Rigid Body CombinerThe Rigid Body CombinerWhen you are developing a complex game, you will most likely run into the problem that you will have too many meshes in your scene. Panda3D's flattening methods can help you reducing the number of nodes, but often when you have hundreds of moving bodies this is not always an option. Therefore, Panda3D has a feature to help you reduce the number of nodes, even if they are moving: the RigidBodyCombiner. The RigidBodyCombiner is designed to reduce the number of nodes actually sent to the graphics card, just like the flattening functions. But instead of flattening everything into one node immediately, the RigidBodyCombiner keeps your original node structure intact, still allowing you to apply transforms (e.g. moving around, rotating or scaling) sub-nodes. But what's actually sent to the graphics cards is just one node, a combined version of all these sub-nodes. If you want to see the combined version of these nodes (not likely), you can call The RigidBodyCombiner class is just another kind of PandaNode. All of the standard node interfaces apply. Thus, the easiest way to add nodes to a RigidBodyCombiner is to wrap a NodePath around it, and then use the standard When you are done with reparenting the nodes, you need to call The vertices of the objects you attach to the RigidBodyCombiner must be transformed each frame on the CPU. For this reason, you may find a performance advantage in limiting the number of vertices in the models you use. Also, be sure you do not have normals on your models unless you are actually using lighting. Here is a small example showing a random cloud of boxes: from direct.directbase.DirectStart import * Note: RenderEffects such as Billboards are not supported below this node. For more information and a complete list of RigidBodyCombiner functions please see the API reference. © Carnegie Mellon University 2010 |