Leung, Sunny wrote:

> So is it possible to tell the collision detection node to detect collision
> only within a certain radius (volume) around the object which the node is
> attached onto?

There are two things that you need to do. Firstly, for any objects that
you _don't_ want to collide with, you turn collision detection off using
setCollidable(false) defined in Node. The easiest way to do this is
partition the scene graph into two groups - collidable and not
collidable areas. Then, the parent group of all the not collidable stuff
you setCollidable(false). This then works for all children of the group
so that you don't need to explicitly set it.

Next, you set the bounds for the objects you do want to collide with
using the setCollisionBounds method of the parent group of the
collidable object (defined in the Group class). If you want a spherical
bounds for your object use BoundingSphere as the object that you set.

Finally, when constructing your behaviour criterion, make sure you set
it with the Node and the speed hint of USE_BOUNDS. I think you can also
use the constructor that takes the Bounds reference and it automatically
uses the USE_BOUNDS speed hint, but the docs aren't particularly clear
on this.

--
Justin Couch                                   Author, Java Hacker
Snr Software Engineer                     [EMAIL PROTECTED]
ADI Ltd, Systems Group              http://www.vlc.com.au/~justin/
Java3D FAQ:       http://tintoy.ncsa.uiuc.edu/~srp/java3d/faq.html
-------------------------------------------------------------------
"Look through the lens, and the light breaks down into many lights.
 Turn it or move it, and a new set of arrangements appears... is it
 a single light or many lights, lights that one must know how to
 distinguish, recognise and appreciate? Is it one light with many
 frames or one frame for many lights?"      -Subcomandante Marcos
-------------------------------------------------------------------

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to