|
#1
|
|||
|
|||
In this case collision callbacks won't work, so you need to manually call the intersect function yourself.
|
#2
|
|||
|
|||
Why? Will the collision callbacks work while dragging something with the HD? That's what I'm trying to do....
|
#3
|
|||
|
|||
Yes, the callbacks will still work when you are dragging an object. Like I mentioned above, you will need to explicitly enable collision notifications on an object for a callback to be triggered.
|
#4
|
|||
|
|||
Quote:
made a bunch of screws and said this for each one: Code:
screw.collideCapsule() screw.enable(viz.COLLIDE_NOTIFY) Code:
currentBox.collideMesh() #make a collision mesh so we know when screws hit it currentBox.enable(viz.COLLIDE_NOTIFY) Code:
def onCollide(e): print "collision!" global allM1Screws, allM2Screws #Did a screw hit the box? if ((e.obj2 in allM1Screws) or (e.obj2 in allM2Screws)): #Change color of box e.obj1.color( random.choice( [viz.RED,viz.GREEN,viz.SKYBLUE,viz.YELLOW,viz.ORANGE,viz.PURPLE] ) ) viz.callback( viz.COLLIDE_BEGIN_EVENT, onCollide ) viz.collision(viz.ON) Last edited by mjabon; 07-16-2007 at 02:28 PM. Reason: forgot something |
|
|