I'm adding basic ray casting and collision detection for my game, and also adding bounding volumes and collision meshes.
The ray is cast in world space and each mesh's node can track its world transformation. Considering I want to test for intersection between a ray and bounding volume and also bounding volume with other bounding volume, in what space should I perform the intersection test?
Scenarios that I have in mind:
- Transform ray into object's local space, perform test, then inverse transform the resulted point.
- Transform bounding volume into world space and perform it there, or should I always keep bounding volumes in world space?
- Perform bounding/bounding test in world space or one of the objects?
Do things change much between static and dynamic collision regarding used spaces?