Skip to content

Conversation

RJ
Copy link
Contributor

@RJ RJ commented Oct 10, 2023

With very dense colliders / very small inverse masses, the inverse mass sum was < EPSILON, and I was getting no collision response.

Slow dynamic bodies with a high mass and inertia were passing through static bodies.

This sets a minimum inverse_mass amount so there's still a response.

I've no idea if this is correct, I have only verified that it solved the problem I was seeing in 2d.

With very dense colliders / very small inverse masses, the inverse mass sum was < EPSILON, and I was getting no collision response.

Slow dynamic bodies with a high mass and inertia were passing through static bodies.

This sets a minimum inverse_mass amount so there's still a response.

I've no idea if this is correct, I have only verified that it solved the problem I was seeing in 2d.
@Jondolf Jondolf added bugfix A-Dynamics Relates to rigid body dynamics: motion, mass, constraint solving, joints, CCD, and so on labels Oct 10, 2023
@Jondolf
Copy link
Owner

Jondolf commented Oct 10, 2023

Nice catch, I think it's correct like this. I was originally worried that dividing by epsilon could still result in infinity in some cases, but I think in Rust that would only happen if the divisor is exactly zero (within the bounds of f32/f64)

(note: CI is currently failing because of unrelated linking/storage issues so you can ignore it)

@Jondolf Jondolf added C-Bug Something isn't working and removed bugfix labels Jul 19, 2024
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

Successfully merging this pull request may close these issues.

2 participants