I’m creating bullets to bash about and collide with other ship objects, but after I get about 60 or so in a scene the collision traverser will stop registering collisions with the new bullets. At this point everything passes through everything else until the number of collision spheres drops down.
Collision Traverser:
# Define the Collider
collisionTraverser = CollisionTraverser('traverser')
base.cTrav = collisionTraverser
collisionTraverser.showCollisions(render)
# Event Collision Handler
# collisionHandler = CollisionHandlerQueue()
collisionHandler = CollisionHandlerEvent()
collisionHandler.addInPattern('%fn-into')
Bullet collision creation:
self.ColNode = CollisionNode("bullet" + self.ID)
self.ColNode.addSolid(CollisionSphere(0,0,0, 2))
self.Collision = self.actor.attachNewNode(self.ColNode)
ClassGlobals.objectDictionary["bullet" + self.ID] = self
ClassGlobals.collisionTraverser.addCollider(self.Collision,
ClassGlobals.collisionHandler)
self.accept("bullet" + self.ID + "-into", self.handleCollision)
self.Collision.show()
This happens with either the Event or the Queue collision handler. The colliders are removed upon bullet destruction.
Is there a cap to the number of collision objects allowed in a scene at any one time?
Thanks,
-Jimmy