View Single Post
  #2  
Old 03-29-2011, 02:50 PM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
You can register a callback function for collision events. If each of these 10 objects has collide notify enabled:
Code:
<node3D>.enable( viz.COLLIDE_NOTIFY )
then whenever a collision happens with one of those objects the function will get called. Then you can check to see if the second node passed with the event object is the box:
Code:
#Called when two objects collide in the physics simulator
def onCollide(e):
    #Did object collide with box?
    if e.obj2 == box1:
        #Do something
        
viz.callback( viz.COLLIDE_BEGIN_EVENT, onCollide )
Reply With Quote