I need to make a dedicated collision mesh for my terrain. The visible terrain geometry has ~20k polys (divined among 64 tiles) I think that’s too much for collisionsm so I’ve made a version of it with just 1.2k. I’m only going to use it to detect collisions with the game avatar (collision sphere). As far as size goes, if the avatar is a sphere of radius 1 then the terrain would be something like a box 600 width and length, 80 in hight.
Should I leave it like that or divided into smaller pieces? Will the game automatically check only those nodes that are close or all of them?
If I understand it right, when I’ll divide the mesh into separate objects I’ll get lots of tags in the egg file. Should I add a tag to each one? And (more importantly) can I give them all the same name (so I can make just one collision event with that name)?
Even 1.2k polygons is an awful lot for a single collision mesh – Just think, every time Panda3d needs to check to see if something collides with your terrain, it must run each solid through over a thousand plane-intersection tests.
That’s where the thread that Thomas mentioned comes in handy. There are scripts in there which will further subdivide either visible geometry or collision solids.
Panda3d collision detection will automatically take advantage of nested bounding volumes. In fact you really don’t have to worry about this much on your own – geoms (and collision solids) automatically get represented by a BV, as it moves down the scenegraph tree.