Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Accessing broadphase AABBs

Discussion in 'Physics for ECS' started by WildMaN, Oct 9, 2020.

  1. WildMaN


    Jan 24, 2013
    As far as I understand, AABBs are calculated during the broadphase for each colliding body. Is there a way to access that data using entity id, BodyIndex or such ?
  2. petarmHavok


    Nov 20, 2018
    Unfortunately, they are only produced during the process of the bounding volume hierarchy build. You can take a look at PrepareDynamicBodyDataJob and PrepareStaticBodyDataJob to see how they are calculated and recalculate them wherever you need them.

    Leaves of the bounding volume hierarchy do contain these AABBs, and there is data in them to point at the rigid body index, but you don't get direct access, you'd have to iterate through all of them. Check DisplayBroadphaseSystem for that, but it seems like it doesn't fit that well in what you need.