Im making a ‘jungle engine’ where i shoot a collision ray for each tree to determine its Z value on the terrain (not a geomipterrain). This works fine but I need this only for positioning the trees, after that I dont need any collision detection happening. Right now I do that by hand with
base.accept('x', base.cTrav.clearColliders)
.
I tried making that happen automatically, but if I put that line of code simply after the collisionHandlerFloor starts doing its job, most of the trees wont make it to the ground. How to know if they did? And what do I need to remove by hand? Do I need to remove collision solids and handlers myself, or does clearColliders do that? Or maybe theres a method for the traverser to do all that?
Are you sure about that? I think with collisionhandlerFloor the z value gradually decreases, theres no guarantee that one frame is enough.
And what about the garbage collecting?
You do need to remove any collision nodes from their parent nodes, because otherwise those parent nodes would still hold a reference to those collision nodes (consequently, they wouldn’t get destructed).
Okay, I think its all working now.
Just one last question, in the API ref it says:
So when I pass ‘render’ as the argument, it all works correctly, but when I pass the node to which all my tree models are reparented to (and to which the collision solids are attached), it doesnt work.