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

Issue: Incorrect inelastic collision #560

Open
Badgerup1510 opened this issue Nov 17, 2024 · 5 comments
Open

Issue: Incorrect inelastic collision #560

Badgerup1510 opened this issue Nov 17, 2024 · 5 comments
Labels
A-Dynamics Relates to rigid body dynamics: motion, mass, constraint solving, joints, CCD, and so on C-Bug Something isn't working

Comments

@Badgerup1510
Copy link

Currently trying to make a 3d first person character. i have given the entity with the collider a restitution of 0.0. Although this does not work, the player character still bounces upon reaching sufficient height and falling. I have attempted to apply a restitution of 0.0 too the ground as well with no avail.
This is the current code:
// Spawn the parent entity with the collider
let parent = commands.spawn((
TransformBundle::from_transform(Transform::from_xyz(0.0, 4.5, 0.0)),
RigidBody::Dynamic,
Collider::capsule(1.0, 3.0),
LockedAxes::new().lock_rotation_x().lock_rotation_z(),
Restitution::new(1.0).with_combine_rule(CoefficientCombine::Min),
Player,
)).id();

for clarity o tried with and without the comibine rule.
@cart
Copy link

cart commented Nov 24, 2024

I'm seeing this too / would love a way to prevent bouncing rigidbodies.

@Jondolf Jondolf added C-Bug Something isn't working A-Dynamics Relates to rigid body dynamics: motion, mass, constraint solving, joints, CCD, and so on labels Nov 25, 2024
@Jondolf
Copy link
Owner

Jondolf commented Nov 25, 2024

Is this in version 0.1? I suspect this was fixed by #542 on the main branch. You can also see the second video there for a scenario that is quite similar to what you're describing; a cuboid with locked rotation and zero restitution falling to the ground.

Zero restitution is also the default on the main branch as of #551, so there shouldn't be any noticeable bounce by default anymore.

The bug was related to contact tangent directions being computed incorrectly for friction impulses, which was sometimes causing an upward force when hitting the ground. If this is the issue you're hitting, setting friction to zero should remove the bounce (not needed on main branch).

@cart
Copy link

cart commented Nov 25, 2024

Excellent! This is on my fork of your bevy-0.15 branch, adjusted to point to bevyengine/main. It doesn't contain those changes. I'll give it a test as soon as main (or some other branch) is updated to 0.15.

@cart
Copy link

cart commented Nov 25, 2024

(no time pressure on that. happy to wait until after Bevy 0.15 releases as I'm focused on that at the moment anyway 😄 )

@Jondolf
Copy link
Owner

Jondolf commented Nov 25, 2024

The main branch already uses Bevy 0.15-rc, but not Bevy's main branch. My new PR for interpolation and extrapolation support (#566) does depend on Bevy's main branch though, since it needs a bug fix that hasn't made it into an RC yet (one of the recently merged fixes to runtime required components)

Edit: The main branch uses Bevy 0.15 now. A new release is also coming Soon™.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Dynamics Relates to rigid body dynamics: motion, mass, constraint solving, joints, CCD, and so on C-Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants