PDA

View Full Version : Collision detection


Moh200jo
01-26-2010, 11:34 AM
Hi
I’ve got a strange problem in the following code:

foot1=viz.add('Foot.ive', scale = [.05,.05,.05])
foot=viz.add('Foot.ive', scale = [.05,.05,.05])
foot1.collideBox(.005,.005,.005)
foot1.disable(viz.DYNAMICS)
foot1.enable(viz.COLLIDE_NOTIFY)
foot.collideBox(.05,.005,.05)
foot.disable(viz.DYNAMICS)
foot.enable(viz.COLLIDE_NOTIFY)

def onCollideBegin(e):
if box in viz.phys.intersectNode(foot1):
print "Yes you touched the box by foot1"
if box in viz.phys.intersectNode(foot):
print "Yes you touched the box by foot1"
viz.callback(viz.COLLIDE_BEGIN_EVENT,onCollideBegi n)
The problem is that the collision detection function can detect the collision with foot and could not detect the collision with the other foot
Is there anybody can advice where is my problem?
Thanks,
Moh

GiudiceLab
01-27-2010, 07:39 AM
Your collide box dimensions with one foot are much smaller than with the other. Could that be the problem?