Skip to content

Commit

Permalink
update stuck inside
Browse files Browse the repository at this point in the history
  • Loading branch information
Ughuuu committed Sep 24, 2024
1 parent bc58466 commit 6f0b11e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions docs/documentation/rigidbodies.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,11 @@ The side effects of this solution is that objects might pass through each other
## Continuous Collision Detection

Fast moving rigid bodies might pass through other rigid bodies, unless the **Continuous Collision Detection** is active. However, even then, it will only do 1 extra step. For multiple extra steps, configure the project setting **Max Ccd Sub Steps**: Maximum number of sub steps performed by the solver. By default it's set to 1.

## Shapes getting stuck inside

In some cases, objects might get stuck inside polygons. This happens because of the physics engine trying to push the object right and left and it ends up in same position always. A great read about this is the [Stuck Inside](https://box2d.org/posts/2020/04/stuck-inside/) article from box2d.

![ghost collisions](/img/rigidbodies/stuck.png)

In order to solve this, change the polygon to be formed of Segments instead of Solids, or change the Static Body polygon Radius (`RapierPhysicsServer2D.body_set_extra_param(self.get_rid(), 0, 1.0)`) so that the small objects cannot get inside.
Binary file added static/img/rigidbodies/stuck.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 6f0b11e

Please sign in to comment.