PandaSteer 2

ynjh_jo: just tried out both of your efficiency improvements. Although I’m not sure I understand your code exactly, it’s a major enhancement! I’m getting a smooth 30FPS with 10 characters on screen at once now, and 65-75FPS in all the other demos (with 1-3 characters). Fantastic work!

Let me see if I understand your enhancements correctly.

So for your first improvement, you create two terrain models, one for rendering and one for colliding, instead of just using the renderable terrain for collisions. The collision terrain is constructed slightly differently from the rendering terrain, because the render terrain is all one big model, it’s all in one EggData. Whereas with the new collision terrain, you made a separate model, a separate EggData and EggVertexPool, for every four-vertex block of the terrain. And this is the reason for the speed improvement? Do I have it right?

Then Panda would only need to test the bounding box of each of those collision models, and can discard most of them without actually having to test against the polygons, right?

And for your second improvement, if I understand correctly, you have collected every 3x3 group of collision models together under an EggGroup? This allows Panda to discard entire EggGroups at once by testing against the bounding box of the whole group, so is even faster. Do I have it right?

I think that if even more efficiency was needed for a larger terrain, these EggGroups could be further collected into groups of EggGroups, forming a hierarchical structure like an octree. But that doesn’t seem necessary at the moment, as the framerates I’m already getting with your improvements are more than enough.

Thanks again for the great work!