Im trying to use the CollisionHandlerPusher but it behaves very weird.
Watch this video, then you’ll know what I mean.
The terrain consists of just 1 egg file.
This is my code:
“Sharp” (90 degree or more) edges seem to be the problem. I have tried to compile Panda3D myself and play around with the collision code. But I didn’t spend much time on understanding how it works, and so I wasn’t surprised that I failed here.
My solution so far: using a physics engine (ODE, Newton, Tokama, …)
I think the problem is the way the pusher handles the collisions. The collision systems find two or more normals in contact with the sphere, and the pusher selects one of them, and then applies a correction according to the one collision normal it has selected.
But I don’t know enough about Panda3D internals to give a solid answer here. drwr might be able to.
Using a queue could work, but then you have to implement collision response yourself, since queue is (AFAIK) only a list of collision entries, and nothing happens if you don’t code a response yourself.
It will be very spammy, so a re-direct to a file might be usefull. Perhaps this way (by comparing the messages with the Panda3D source code) you might be able to narrow the problem down to a particular part of the code.
I wasn’t able to fix it- so I now use a CollisionHandlerQueue, and each frame it checks whether there was a collision or not, it there was, it sets the position to the previous one. It doesn’t slide along the wall anymore, but it doesn’t penetrate the wall either.