Skip to content

0.30.0-alpha.1078+6db28e1

@eonarheim eonarheim tagged this 29 Jun 00:55
This PR explores a different data structure for handling large numbers of colliders in the scene at a time efficiently.

* New features
  - Query colliders directly on the `PhysicsWorld`
      ```typescript
      const scene = ...;
      const colliders = scene.physics.query(ex.BoundingBox.fromDimensions(...));
      ```

* New `SparseHashGrid` data structure
  - Used as the new default for the collision broadphase which is faster performing than the dynamic try
  - Used in the `PointerSystem` to improve pointer dispatch when there are a lot of entities

* More allocation reduction
  - New pool type `RentalPool`
  - `Transform` refactoring to remove 
  - `AffineMatrix`
  - Graphics context state/Transform stack hot path allocations pooling 

* Perf improvements to `CircleCollider` bounds calculations
* Switch from iterators to c-style loops which bring more speed
  - `Entity` component iteration
  - `EntityManager` iteration
  - `EventEmitter`s
  - `GraphicsSystem` entity iteration
  - `PointerSystem` entity iteration
Assets 2
Loading