You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a simple program that employs 1000 units on screen. Each unit has its own dynamic rigidbody, as well as a collider. On startup, these units are spaced far enough apart that they are not colliding. My program runs at a very slow 15 FPS, and when the units actually start colliding, it drops to below 5 FPS.
From my understanding, collision happens in two phases, the Broadphase & Narrowphase. The Broadphase checks to see if there are any collisions or intersections, while the narrowphase uses the data from the broadphase to actually compute the contact points required for actual collision.
Because of the exponentially bad performance as I increase the amount of units on screen, I would assume that spatial Partitioning is not implemented.
Questions
Is the broadphase checking for collisions on a collider which every other collider on screen? If this is this case, with 1000 units, that means there are 1000000 calculations being made every frame?
If this^^ is the case, is there a way to implement spatial awareness so that the broadphase is only checking for intersections in a certain proximity to a collider?
The text was updated successfully, but these errors were encountered:
The-DevBlog
changed the title
Does Rapier 3d Implement Spatial Awareness?
Does Rapier 3d Implement Spatial Partitioning?
May 13, 2024
Short answer: yes, rapier3d has space partitionning.
Slightly longer response is that the broadphase setups the space partitioning and the narrowphase does the finer detection. On top of that there is an IslandManager to be able to parallelize these 2 steps better.
This repository is focused on bevy integration though, and I feel like your question is more oriented towards "lower level" performance: Consider looking into the lower level crates such as rapier or Parry.
If you have a particular performance issue, double check you're running in release mode (or your dependency is), as mentioned in the documentation.
If you still have a problem, please reopen an issue! Minimal reproducible examples are appreciated :)
Scenario
I have a simple program that employs 1000 units on screen. Each unit has its own dynamic rigidbody, as well as a collider. On startup, these units are spaced far enough apart that they are not colliding. My program runs at a very slow 15 FPS, and when the units actually start colliding, it drops to below 5 FPS.
From my understanding, collision happens in two phases, the Broadphase & Narrowphase. The Broadphase checks to see if there are any collisions or intersections, while the narrowphase uses the data from the broadphase to actually compute the contact points required for actual collision.
Because of the exponentially bad performance as I increase the amount of units on screen, I would assume that spatial Partitioning is not implemented.
Questions
The text was updated successfully, but these errors were encountered: