#1
|
|||
|
|||
Collision detection between objects
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 |
#2
|
|||
|
|||
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:
Code:
if node2 in viz.phys.intersectNode(node1): print 'Node 1 is colliding with Node 2' |
#3
|
|||
|
|||
Great - that did the trick - thanks.
|
#4
|
|||
|
|||
document
Where can I find a document explaining all these changes?
g.a. |
#5
|
|||
|
|||
We are still working on the documentation. You can always look at the source, aka the viz.py file.
__________________
Paul Elliott WorldViz LLC |
Thread Tools | |
Display Modes | Rate This Thread |
|
|