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

Simple straight collisions cause loss of momentum, eventually stopping motion entirely #350

Open
krodyrobi opened this issue Mar 24, 2023 · 1 comment
Labels
A-Integration very bevy specific C-Bug Something isn't working D-Difficult Needs strong technical background, domain knowledge, or impacts are high, needs testing... P-Medium S-not-started Work has not started

Comments

@krodyrobi
Copy link

krodyrobi commented Mar 24, 2023

So I've hit some funkyness with the conservation of energy during simulations.

Windows 10

  • Window focused
    Conserves all energy (even with rounding errors)
  • Minimizing frequently
    Conserves rather well (extreemly rare are the cases when it dips and by very little, dip != floating errors)

Mac OS (latest ventura)

  • Window focused
    Dips randomly
  • Minimizing window / swapping active workspace
    Dips often and way harder to the point at which it stops all movement eventually in ~5-10 min

All forces (restitution, dampening, gravity, friction etc) are configured to keep the system going forever but in reality the ball eventually stops completely.
I'm aware that the window in bevy may be throttled but by default it runs as fast as it can.

Tried using fixed timestep, increasing frequency etc. nothing really worked.
Saw integration parameters but from reading about them not sure what I could try.

What I noticed is that swapping workspaces, minimizing windows exhacerbates the loss but it happens regardles, extreemly noticeable on mac.

[dependencies]
bevy = "0.10.0"
bevy_rapier2d = "0.21.0"

[profile.dev]
opt-level = 1
[profile.dev.package."*"]
opt-level = 3

main.rs

recording
log-release-workspace-switch.txt
log-release-same-workspace-but-minimizing.txt

@Vrixyz Vrixyz added C-Bug Something isn't working D-Difficult Needs strong technical background, domain knowledge, or impacts are high, needs testing... P-Medium A-Integration very bevy specific S-not-started Work has not started labels May 23, 2024
@Vrixyz
Copy link
Contributor

Vrixyz commented May 23, 2024

Would be interesting to know if the issue is still happening ; the origin could be in winit, bevy_winit, or bevy_rapier integration 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Integration very bevy specific C-Bug Something isn't working D-Difficult Needs strong technical background, domain knowledge, or impacts are high, needs testing... P-Medium S-not-started Work has not started
Projects
None yet
Development

No branches or pull requests

2 participants