Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Collision detection issues - multiple collision shapes, CCD #39095

Open
Tracked by #45333
Cykyrios opened this issue May 27, 2020 · 0 comments
Open
Tracked by #45333

Collision detection issues - multiple collision shapes, CCD #39095

Cykyrios opened this issue May 27, 2020 · 0 comments

Comments

@Cykyrios
Copy link
Contributor

Godot version:
v3.2.2, custom build 73b97e8

OS/device including version:
Linux Mint 19.3

Issue description:
There are several issues already discussing the problems of continuous collision detection, more specifically the fact that it seemingly does not work at all (see #16113 for instance). I made some more tests as this issue affects my project, and noticed some unexpected behavior.

First of all, it is expected that small, fast objects may tunnel through thin obstacles or other small objects if they travel more distance between two physics frames than the size of both objects. This is where continuous collision detection is supposed to prevent such behavior. However, while testing I noticed the following:

  • with continuous collision detection disabled, a rigid body with a single BoxShape never tunnels through a thin obstacle (see MRP below), even at speeds of 500 m/s at 60 physics FPS.
  • on the other hand, a compound rigid body (in this case two BoxShapes) can tunnel through the same obstacle, irrespective of whether continuous collision detection is enabled.

I have not tested other shapes, but it appears that having more than one collision shape in a rigid body causes it to ignore continuous collision detection, while single collision shape rigid bodies seem to always have CCD enabled.

Steps to reproduce:

  • Add a StaticBody with a thin BoxShape collision shape
  • Add a RigidBody with a small BoxShape collision shape
  • Throw/drop the rigid body into the static body at various velocities and CCD settings
  • Perform the same test after adding a second collision shape to the RigidBody

Minimal reproduction project:
CollisionDetectionIssue.zip

In this test project, there are two small rigid bodies that get thrown into a thin wall when you press the space bar. One of them has a single collision shape while the other has two. You can change the speed of both rigid bodies through the root node's exported variable.
At 60 physics FPS, tunnelling starts occurring for the second rigid body at an initial speed of 61 m/s.
The first rigid body will never tunnel, even at 500 m/s.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants