Collidable Switch?

Should we add a switch to Spatial to allow individual control of picking/intersection of objects?



then hasCollision would be something like:

if (getWorldBound() != null && isCollidable) {…}

This would mean that the Spatial would not be processed for any collisions as well as any children.

Would be a very easy addition, and might make some things easier. Any negatives about this?

Sounds good - could speed up collision detection alot when people have many things that cannot collide. And could ease handling of collisions.

I also want to add to the PickResults class an optional flag (checkDistances) that if set, will calculate the distance from the origin of the pick ray to the bounding that was picked.

And probably sort the results?

Sure, I don't see a problem with that.

Collidable switch is in.

I've added distanceToEdge(Vector3f) to BoundingVolume and implemented for all three boundings. So, you can now get the distance between a point and the closest point on the volume surface.

This distance is also now stored in PickData, is PickResults has it turned on. This is tested and working.

Next, I'll sort the results.