PDA

View Full Version : Checking Collision with a subnode


Chapre
10-21-2010, 04:10 AM
Hello! I'm working on collision between 2 objects, When my main object collide with a second object, I can easily get the the second object ID; my main problem now is how will I check if my main object collided with a child (subnode) of the second object?

Jeff
10-21-2010, 11:57 AM
There is no command to check for collisions with a sub-part of an object. You can do this using the method described in the following article:
http://kb.worldviz.com/articles/350

masaki
10-21-2010, 12:13 PM
You can also try re-parenting the child to viz.WORLD, apply a collision shape to it, and then detect collisions.

e.g.
model = viz.add( 'myModel.ive')
child = model.getChild( 'subnode-GEODE' )
child.parent( viz.WORLD )
child.collideBox()

Masaki

Chapre
10-25-2010, 07:25 AM
Thanks very helpfull!