Is there any way to create an octree for collision detection on terrain generated at runtime?
let me explain: I’m generating terrain with perlin noise, and it gets to be a fairly large collision solid. There ends up being around 16384 collision polygons in the single collision node. This brings my framerate uncomfortably low, so for the time being I lowered the number of subdivisions by one, leaving only 4096 collision polys. this brings my framerate back up to ~60fps. I am using the collision polys for a collisionhandlergravity. If octree-ing is impossible for terrain generated at runtime, is there any other way to speed up collisions?
Reading my last post, I realized that I should try separating the collision polys into separate nodes, in the hopes that panda would not test collisions against nodes whose bounding boxes (or spheres) were not in collision with each other. It didn’t seem to make a difference, but it could be that I went from not enough divisions to too much in one test.
Ok, I started making my own makeshift octree, by dividing the collision node into 16 (or more) parts and changing base.cTrav into base.myCTrav and making a task to traverse manually, so that I can select which part to traverse.
It works handsomely.