![]() |
|
#1
|
|||
|
|||
|
Just an Idea to do it
I have 10 objects and want to do something if a collision happens between any of them and Box1. Box 1 can collide with other objects, but I do not want to do anything with that.
I have done that by writing if statement for all of them, but this way is really hard to accommodate I have to write this Code:
if Box in viz.phys.intersectNode(Obj1) : . . if Box in viz.phys.intersectNode(Obj10): Thanks, Moh |
|
#2
|
|||
|
|||
|
You can register a callback function for collision events. If each of these 10 objects has collide notify enabled:
Code:
<node3D>.enable( viz.COLLIDE_NOTIFY ) Code:
#Called when two objects collide in the physics simulator
def onCollide(e):
#Did object collide with box?
if e.obj2 == box1:
#Do something
viz.callback( viz.COLLIDE_BEGIN_EVENT, onCollide )
|
![]() |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Do you have some idea about the bicycle and wheel | sled | Vizard | 6 | 08-01-2003 11:03 PM |