Collision Geometry - Bounding Volumes

I have a scene that uses grids of static geometry of around 200k tris. Using a octree type export I have written in Blender I am getting about 300fps when i use a single avatar to test collisions (using built in shere collision).

I was quite taken aback by how well it is performing, but I have a technical question about the collision nodes and their bounding space.

My Blender export has a heavily optimised mesh, with very tight precalculated, non overlapping, bounding boxes.

I need to get this into panda collision nodes as the bounding volumes panda creates are loose to say the least. This is causing the collision to traverse down multiple paths for a given face, which is costing FPS for me.
If it used my bounding calculations, it wouldnt.

Is there a way, preferably, using egg files (i convert these to BAM so loading is instant) to import my tight bounding boxes and have just the collision side of panda use these?

Just to be clear.
My static meshes are really two seperate objects.
1st Is the mesh used to render (200k tris, shaded etc)
2nd Is A seperate collision object (invisible only using polyset in egg again 200k tris)
Each of these objects is in their own egg file (bam files…)

I found this much faster than putting the collision node inside the normal panda node used to render it, this is probably due to the amount of vertices and bounding areas.
(talking 100s fPS faster)

nt. The scene renders at over 1000 fps with triplanar shading without the collisions turned on (they are loaded) and I have no interest in lowering polycount for this particular case.
Im just curious about overriding Pandas bounding calcs.

You can override the bounding volume on a particular node with nodePath.setBounds(). You can create, for instance, a BoundingBox() and pass it to each NodePath. There’s not any automatic way to import these from an external file, but you can write your own script to do this.


Thanks David.

I had tried setBounds initially, but I think my mistake was not setting the bounds of the innermost child first and working backwards through the nodepath.

Will give it another shot.
Applying the bounding box with a load script will be easy if this holds up.

Right, now that I think about it further, the bounding volume for a PandaNode is always automatically computed. When you set an explicitly bounding volume, the PandaNode’s volume is computed to go around that volume (plus all the node’s children). This, you can’t use node.setBounds() to make a bounding volume smaller than the automatic computed volume.

But, you can set the bounding volume small on a particular CollisionSolid. This will actually stick. The parent node will still be computed around it, but it’s generally this lowest-level bounding volume that you want to be as tight as possible anyway.

You can also use PandaNode.setBoundsType() to set a particular shape of automatic volume. For instance, nodePath.node().setBoundsType(BoundingVolume.BTBox) will tell Panda to compute a tight bounding box for this node instead of its default, a sphere.