Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

again. This question is strictly related to this one so, what is the technology that makes physics engines suitable for raycasting? It is a particular data structure? Has it to do with the engine's internal representation of the objects? If so, how do they represent objects so to be able to make polygon-precise raycasting? Do they hold the whole information about a mesh?

share|improve this question
add comment

2 Answers

up vote 6 down vote accepted

Good physics engines:

  • Use algorithms and data structures with good theoretical ("big-O") properties.
  • Use specific memory allocators and data layouts for improved cache efficiency.
  • Use microoptimized code, that not just has good big-O runtime but is also known to generate efficient code on real compilers / machines (e.g. SIMD and specialized instructions like fsel).
  • Use a variety of good spatial subdivision techniques (octrees, BSP trees, spatial hashes).
  • Use different levels of checks of various costs (e.g. first AABB, then tri-tri).
share|improve this answer
add comment

I don't think there are specific technologies that are exlusive to physics engines which makes them so good for Ray Casting. It's more the fact that in general they have very good ray casting capabilities because that's what they use to determine collisions between objects in the simulation. These have generally been optimised and tested pretty well as they're a fundamental component to a physics simulation.

Why re-invent the wheel if you can leverage existing, fast and well tested libraries?

share|improve this answer
    
So which technologies do they use? –  tunnuz Sep 16 '10 at 9:35
    
Joe has mentioned specific types of algorithms used, if that's what you mean by technology. –  Muttley Sep 16 '10 at 12:53
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.