View Single Post
  #1  
Old 05-23-2008, 10:06 AM
rubberpimple rubberpimple is offline
Member
 
Join Date: Jan 2008
Location: Phoenix, Arizona
Posts: 16
Collision questions

Hi,
I'm currently using collision detection in my code, but I'd like to keep the intersecting object from passing though each other. I've read lots of posts but cannot get the right combination of physics, intersection and collision settings. Here's a sample of what I'm doing:
# Some Basics
viz.phys.enable()

viz.collision(1)

# Import a hand object
sensor = viz.add('MonkeyGlove.dls')

myHand = hand.add(sensor,hand.MONKEYGLOVE)
myHand.collidebox()
myHand.enable(viz.DYNAMICS)
myHand.disable(viz.INTERSECTION) myHand.enable(viz.COLLIDE_NOTIFY)

# Import a cylinder object
Cylinder = viz.add('cylinder2.wrl')
Cylinder.collidebox()
Cylinder.enable(viz.DYNAMICS)
Cylinder.disable(viz.INTERSECTION)
Cylinder.enable(viz.COLLIDE_NOTIFY)

I would like both objects to NOT be subject to gravitational forces, but would like for the hand to stop when it contacts the object, and for the object to stay in place as well.

Collisions are detected using the viz.phys.intersectNode(myHand) command

Any help is appreciated!
__________________
David
Reply With Quote