Visibility check

Hi guys,

I’ve realized a complete Python porting of OpenSteer library (www.opensteer.org) based on SWIG.

I need to realize a city environment simulation with a large amount of pedestrians. So, for speed tuning, i want to implement a simple visiblity check so, if a pedestrian 3d mesh is currently culling out from camera view, it doesn’t calculate his new steering state.

How can I implement this feature?

Thanks!

Hmm, I dont know about actual frustum vs boundingvolume checks, but you can check if a point is in the frustum by doing:

base.cam.isInView(point)

You can also create a bounding volume for the frustum and check if it collides with the bounding volume of the object:

lensBounds = base.camLens.makeBounds()

intersectFlags = lensBounds.contains(nodePath.getLens())

where intersectFlags will be a set of flags indicating how the volumes are intersecting. See here:
panda3d.org/apiref.php?page=Geom … dingVolume

There’s probably a better way for this, though.

There is a port of open steer called pandaSteer some place on the forums.

Yes, I’ve already tested it but it’s a pure Python module, so it works very slowly with more than 20 pedestrians… :frowning:

My C++ code porting has best performances but it requires optimizations too like this visibility check…