-
-
Notifications
You must be signed in to change notification settings - Fork 194
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf: Hash Grid Broadphase + Hot Path Allocation Reduction (#3071)
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
- Loading branch information
Showing
32 changed files
with
1,655 additions
and
193 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.