Sunday, January 9, 2011

What are the technologies that makes physics engines so good for raycasting?

Hello, 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?

  • 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?

    tunnuz : So which technologies do they use?
    Muttley : Joe has mentioned specific types of algorithms used, if that's what you mean by technology.
    From Muttley
  • 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).

0 comments:

Post a Comment