5
\$\begingroup\$

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?

\$\endgroup\$

2 Answers 2

8
\$\begingroup\$

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).
\$\endgroup\$
2
\$\begingroup\$

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?

\$\endgroup\$
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .