RigidBodyCombiner culling


I might be seeing the same thing as in a post from ThomasEgi in 2009
[url]RigidBodyCombiner culling-errors.]

I’m trying to manage the number of allocated grass, bushes or trees that are in a scene. Only those that are around the camera will be seen, all position data is preloaded. When the camera is positioned on a terrain tile I create a matrix of models with the camera at the center; each “cell” of the model matrix is a RBC and contains the same number of models.

Before I move the camera everything looks fine, but after I move the camera and the models in the cells behind the camera are moved to new positions ahead of the camera, I’ll start seeing some the the forward models vanish an reappear ( I should only see models appear a ways ahead of the camera). Also if I stop and just rotate in azimuth, I’ll see models vanish and reappear. If I don’t use RBCs then everything is fine, but I was thinking to reduce my geomNode count.

In the above mentioned post, drwr showed a work around, but it is python and I haven’t found how to do the OmniBoundingVolume() part.

Would using flatten strong and then just keep loading models and removing models as the camera moves be okay, I was just worried that memory might fragmented or something, so I thought to just maintain a certain number of models and reuse them (changing their position, scale and orientation)

sorry for being long winded.
thanks for any advice.

If it is just translating Python to C++ I can help. I do this trick too, e. g. in the CTOR of BulletDebugNode:

#include "omniBoundingVolume.h"
  GeomNode *node = ...
  CPT (BoundingVolume) bounds = new OmniBoundingVolume();

Danke schoen

That worked, no more models popping on and off :slight_smile:
I should have thought to try adding an include file for the OmniBoundingVolume, but it was late and I was tired, and had looked all over the forum. I decided to throw out the post and go to bed and what do you know, someone on the other side of the planet is awake and answering Panda posts.

Well it’s late again, 11:45pm in California, USA., and I need to sleep.

Thanks again to both you and drwr and also for ThomsaEgi’s 2009 post…