You’re trying to let a 968 triangle model collide with a 2046 triangle terrain!
First of all, Panda doesn’t support mesh-to-mesh collisions. But even if it would, that means 1.980.528 collision tests are performed every frame!
Either reconstruct the model using collision solids (spheres, probably) and
Also, you forgot to add your model to the collider.
pusher.addCollider(collider, anp)
When I edit suzane.egg, and replace this line:
<Collide> { Polyset descend }
with this:
<Collide> { Sphere descend }
My FPS increases from 3 FPS to 900 FPS!
Of course, as you can see now, the sphere doesn’t fit tightly around the model - its probably better to approximate this model using three spheres.
Alternatively - you can use a physics engine that’s designed to handle this kind of collisions correctly, like ODE - but even ODE will be very unstable on this particular thing, so you’d even then need to approximate the shape with solids.
And also, the an is controlled by physics manager, the anp is controlled by the collision hadler, anp is apparented to the an. So if the anp moves, the physics engine won’t know about it. will it?
It will. NodePath is a mere wrapper around PandaNode/ActorNode. So you didn’t reparent anp to an (you can’t) but anp is more like a handle to modify ‘an’.
So if you move anp, you are actually moving ‘an’.