PandaSteer 2

Wow, great work ynjh_jo!

I’ve merged your fixes into my branch, they were spot on, every one of them :slight_smile:

Your fixes have revealed another serious problem though: using a CollisionSegment (or CollisionRay) and CollisionHandlerFloor for each Character seems to be very inefficient.

On my machine (2.4GHz, 1GB RAM, Nvidia Quadro4 900XGL, using proprietary Nvidia driver on Ubuntu 6.10) the “wandering pedestrians” demo, which has 10 Characters, now runs at 5fps. If I disable the CollisionFloorHandlers it runs at a nice 30.5fps. Even the “arrive” demo with one character runs at about 30fps with the CollisionHandlerFloor, about 70fps without.

Ultimately I’d like to have 10-12 Characters, each using different models, and on a much larger terrain with some static models for obstacles too, and it’ll need to run at at least 15fps, preferably 30fps. So the current situation is not encouraging.

I tried having a single global CollisionHandlerFloor shared by all Character’s, with each Character adding its own CollisionSegment. But this was no improvement.

Surely colliding a single line segment against some simple terrain should be pretty cheap? There must be a more efficient way to do this?

Perhaps I can write my own query function which returns the Z-position of the terrain at a given (X,Y)-position, and simply use this instead of Panda’s collision system.

But I’d appreciate any help with this issue.

More improvements to come from me too! Perhaps when I recover from the cold I’m coming down with…