PDA

View Full Version : Collision detection between objects


hotspur1
09-12-2006, 10:57 AM
I'd like to detect when two objects collide so they stick together (e.g., robot hand grabs object). With v2.53 I've been using the following

<node3d-1>.collidemesh()
<node3d-1>.collidingwith(<node3d-2>,0) # This returned a 1 if meshes intersected.

I see that the syntax has changed slightly to collideMesh, is the collidingwith method still included in v3? Or is there a new way to do this?

Thanks

farshizzo
09-12-2006, 11:02 AM
The current Beta version of 3.0 does not implement the collidingwith function. However, there is still a way to detect whether two nodes are colliding. The viz.phys.intersectNode() function will return a list of all the nodes that a node is currently colliding with. Example:if node2 in viz.phys.intersectNode(node1):
print 'Node 1 is colliding with Node 2'

hotspur1
09-12-2006, 11:29 AM
Great - that did the trick - thanks.

giancamati
12-02-2006, 09:42 AM
Where can I find a document explaining all these changes?

g.a.

Gladsomebeast
12-05-2006, 11:17 AM
We are still working on the documentation. You can always look at the source, aka the viz.py file.