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

A potential bug in CCD #129

Open
chungwong opened this issue Mar 30, 2022 · 0 comments
Open

A potential bug in CCD #129

chungwong opened this issue Mar 30, 2022 · 0 comments
Labels
A-Dynamics A-Integration very bevy specific C-Bug Something isn't working D-Medium P-High arbitrary important item S-not-started Work has not started

Comments

@chungwong
Copy link
Contributor

I have hit a strange bug, I am not sure if it is caused by my code or rapier

I have simple Pong game and if the ball passes the red lines, a new round would start which means the current ball will get despawned and a new ball will be spawned.

The bug is that when the ball is with high velocity, it will hit the paddle and trigger the intersection event(as if it is passing the red line) and thus triggered the new round and a new ball is spawned.

So basically every time the ball hit the paddle, it first triggers a Contact Event and because the ball is fast, it some how magically, virtually passes the red line.
I am not sure if it is tunneling or a well-known issue in physics engine

I have uploaded a minimum repo and here is the setup for the ball
https://github.com/chungwong/rapier_maybe_bug/blob/main/src/ball.rs#L23

Reduce the speed at this line will not trigger the problem
https://github.com/chungwong/rapier_maybe_bug/blob/main/src/ball.rs#L86
And increase the offset of the paddles(moving them further) will kind of aovid the bug too.
https://github.com/chungwong/rapier_maybe_bug/blob/main/src/collider.rs#L83

A screenshot
Screenshot from 2022-03-30 19-28-25

@Vrixyz Vrixyz added C-Bug Something isn't working D-Medium P-High arbitrary important item S-not-started Work has not started A-Dynamics A-Integration very bevy specific labels May 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Dynamics A-Integration very bevy specific C-Bug Something isn't working D-Medium P-High arbitrary important item S-not-started Work has not started
Projects
None yet
Development

No branches or pull requests

2 participants