heron icon indicating copy to clipboard operation
heron copied to clipboard

Objects sometimes fall into each other at low FPS

Open Shatur opened this issue 4 years ago • 9 comments

In my game, the character is represented as RigidBody::Dynamic and when linear velocity is applied to it, it sometimes falls into other objects at low FPS: изображение изображение

Steps to reproduce:

  1. Clone this repo: https://github.com/gardum-game/gardum
  2. Checkout to 2187ae14b5cebd72ab8939e85595de28a1516b51 (just in case).
  3. Run cargo run --features "gi" -- --preselect-hero North host (with enabled GI in debug mode you should have low FPS).
  4. Press Space to jump and see the character falls into the ground :D

I tried enabling continuous collision detection, as suggested in #199, but it didn't help.

Shatur avatar Mar 13 '22 20:03 Shatur

thanks for the report, I'll try to look into it. Just a question, you say "at low FPS", how many FPS is that exactly?

jcornaz avatar Mar 14 '22 08:03 jcornaz

~8 FPS

Shatur avatar Mar 14 '22 08:03 Shatur

The lower the FPS, the more noticeable the effect. I can reproduce the issue at ~18 FPS (no GI), it's just less noticeable.

Shatur avatar Mar 14 '22 08:03 Shatur

Do you configure the PhysicsStep? Or is it the default?

jcornaz avatar Mar 14 '22 11:03 jcornaz

No, I didn't configure it. I assume it is the default.

Shatur avatar Mar 14 '22 11:03 Shatur

I get the same issue even with high FPS, happens most of the times. You can see the bevy icon going sligthly through the floor. Friction and restitution both to 0 on the bevy icon and the floor.

https://user-images.githubusercontent.com/42871796/160277436-c6fd1aa6-5af4-4ee0-be9d-303aec3244d5.mp4

Whimfoome avatar Mar 27 '22 10:03 Whimfoome

I get the same issue even with high FPS, happens most of the times. You can see the bevy icon going sligthly through the floor. Friction and restitution both to 0 on the bevy icon and the floor.

Ah, but that is rapier behavior I think. Or can you observe better behavior when using rapier directly (without heron)?

jcornaz avatar Mar 28 '22 08:03 jcornaz

In rapier I get the same behaviour, maybe Continuous Collision Detection can fix that but I haven't tested, because rapier seems a lot more complex than heron, I would like to test CCD in heron, but I can't find documentation about it.

Whimfoome avatar Mar 29 '22 10:03 Whimfoome

In rapier I get the same behaviour, maybe Continuous Collision Detection can fix that but I haven't tested, because rapier seems a lot more complex than heron, I would like to test CCD in heron, but I can't find documentation about it.

I would like to eventually add first-class support for ccd in heron (#199). Until then, here is how you can enable it yourself: https://github.com/jcornaz/heron/issues/199#issuecomment-1052453851

jcornaz avatar Apr 21 '22 12:04 jcornaz