Skip to content

bug fix - "moveWithCollisions" method parameter slideOnCollide==false now moves mesh to NEAR the collision point, instead of AT the collision point #16587

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

Merged

Conversation

jon-heard
Copy link
Contributor

Issue - "moveWithCollisions" with the parameter slideOnCollide == false used to move the mesh up to the point of collision. Due to floating point inaccuracy, this sometimes meant just outside, and sometimes just inside penetration with the collided mesh. When just inside, subsequent calls to "moveWithCollisions" would snag on the mesh previously collided with.

Solution - "moveWithCollisions" with the parameter slideOnCollide == false now moves the mesh NOT up to the point of collision, but up to a point just a small distance short of that collision. The small distance is based on "AbstractEngine.CollisionsEpsilon", the same distance considered "close" by other aspects of the collision system.

…d to the collision point. Now it moves to just before the collision point.
@bjsplat
Copy link
Collaborator

bjsplat commented May 10, 2025

Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s).
To prevent this PR from going to the changelog marked it with the "skip changelog" label.

@bjsplat
Copy link
Collaborator

bjsplat commented May 10, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented May 10, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented May 10, 2025

@jon-heard jon-heard changed the title bug fix - "moveWithCollisions" method parameter slideOnCollide==false now it moves to JUST BEFORE the collision point. bug fix - "moveWithCollisions" method parameter slideOnCollide==false now moves mesh to NEAR the collision point, instead of AT the collision point May 10, 2025
@deltakosh deltakosh enabled auto-merge (squash) May 12, 2025 15:30
@deltakosh deltakosh merged commit 64fe1c8 into BabylonJS:master May 12, 2025
16 of 17 checks passed
RolandCsibrei pushed a commit to RolandCsibrei/Babylon.js that referenced this pull request May 15, 2025
… now moves mesh to NEAR the collision point, instead of AT the collision point (BabylonJS#16587)

Issue - "moveWithCollisions" with the parameter slideOnCollide == false
used to move the mesh up to the point of collision. Due to floating
point inaccuracy, this sometimes meant just outside, and sometimes just
inside penetration with the collided mesh. When just inside, subsequent
calls to "moveWithCollisions" would snag on the mesh previously collided
with.

Solution - "moveWithCollisions" with the parameter slideOnCollide ==
false now moves the mesh NOT up to the point of collision, but up to a
point just a small distance short of that collision. The small distance
is based on "AbstractEngine.CollisionsEpsilon", the same distance
considered "close" by other aspects of the collision system.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants