Mai
11-30-2009, 04:49 AM
I am using the following object to touch balloons (as an example) hand=viz.add('hand.cfg')
to enable the collision I have used the following code:
handballoon = viz.add('balloon.ive',scale=[0.01,0.01,0.01])
handballoon.collideSphere()
handballoon.disable(viz.DYNAMICS)
handballoon.enable(viz.COLLIDE_NOTIFY)
handballoon_link= viz.link( hand , handballoon )
handballoon_link.preTrans([0.07,-0.07,0])
def onCollideBegin(e):
if e.obj1 == handballoon:
if e.obj2==balloon:
print 'Yes Balloon has been touched :',e.obj2
viz.callback(viz.COLLIDE_BEGIN_EVENT,onCollideBegi n)
but it does not work
any help would be appreciated
to enable the collision I have used the following code:
handballoon = viz.add('balloon.ive',scale=[0.01,0.01,0.01])
handballoon.collideSphere()
handballoon.disable(viz.DYNAMICS)
handballoon.enable(viz.COLLIDE_NOTIFY)
handballoon_link= viz.link( hand , handballoon )
handballoon_link.preTrans([0.07,-0.07,0])
def onCollideBegin(e):
if e.obj1 == handballoon:
if e.obj2==balloon:
print 'Yes Balloon has been touched :',e.obj2
viz.callback(viz.COLLIDE_BEGIN_EVENT,onCollideBegi n)
but it does not work
any help would be appreciated