CollisionHandlerEvent problems...

Hi everyone!

I have a question regarding the CollisionHandlerEvent.

My problem is that I cannot get an ActorNode to colllide with visible geometry. I have an ActorNode with its from and into bitmasks set to allOn() and a regular PandaNode with its collideMask set to allOn().

I have set the collisionHandler to recognize the following patterns:


I have also set my collisionManager to accept the following events:

acceptEvent(sColl[1] + '-into' , self.handleTrackCollisionInto)
acceptEvent(sColl[1] + '-outof' , self.handleTrackCollisionOutof)

where sColl[1] indicates a unique string value generated when attaching the collision node to another node.

The methods handleTrackCollisionInto and handleTrackCollisionOutof are indentical and look like this:

handleTrackCollisionInto(self, entry):
   print entry

But when my ActorNode collides with the geomtry, nothing happens!!!

I have added the collision object on the ActorNode to my CollisionTraverser.

I’m not sure if I also have to add it to my CollisionHandler and if so how??? CollisionHandlerEvent has not attribute addCollider()…

Anybody got any ideas, or any simple source code where they have Collision from a CollisionNode with visible geometry using CollisionHandlerEvent ?

Any help would be most appreciated.


ActorNode does not inherit from CollisionNode, so if you want to enable collisions, you need a CollisionNode (with a collision solid) somewhere. After you do that, you need to either create other collision solids for your collision node to collide into, or use myCollisionNode.setCollideGeom(1). Just be aware that when the geom collide flag is on, your collision node will collide with all geometry.

You can read more about collisions in the manual.