Search Unity

Physics engine grid optimization

Discussion in 'Physics' started by hansi924, Jul 8, 2020.

  1. hansi924

    hansi924

    Joined:
    Oct 21, 2018
    Posts:
    3
    Hello all,

    i read somewhere that if some guys where able to simulate collision with a lot of colliders(10000 to 100000) that were rather spread accross a big area by creating a grid and only test collision when 2 colliders where within a certain distance, so that a collision was possible. My question is now wether unitys physics engine works like that as well. This seems like very easy optimization method. Unfortunately i wasn't able to find anything online.

    Best Regards
     
  2. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    11,459
    All physics engines have this kind of optimization otherwise they'd be too slow. This phase is called the broadphase. There are different broadphase algorithms though and Box2D and PhysX use different ones.