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

Fix character controller ground detection attempt 3 #715

Merged
merged 5 commits into from
Nov 19, 2024

Conversation

Vrixyz
Copy link
Contributor

@Vrixyz Vrixyz commented Aug 12, 2024

Following details from #711 (comment)

  • always call detect_ground (which was not done if no collision were initially detected, or if we were not moving).
  • flat value for predict_ground function

The tests were not passing though, a ground of 600 makes the controller not grounded at

  ┌             ┐
  │   502.99017 │
  │ -0.19247428 │
  │   100.54156 │
  └             ┘

By adding more height to the ground, I could make the test pass.

image

⚠️ This PR poses a problem of detecting ground when too near of a ground, because loosened shape intersect with it.

video illustration

Unfortunately we can´t see in the video, but during a frame the charactercontroller is detected as grounded when flying exactly on the edge of the "cliff":

Screencast.from.09-09-2024.04.21.37.PM.webm

It's not the case before because we were not computing the ground state when there was no collision on the initial cast_shape.

Copy link
Member

@sebcrozet sebcrozet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good, thanks.
It’s interesting that you sometimes get minY ~= 0.02. I’m wondering if the offset gets counted twice somewhere (because 0.02 ~= 0.009 * 2 + 0.004).

@Vrixyz Vrixyz merged commit 684f3a3 into dimforge:master Nov 19, 2024
7 of 8 checks passed
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.

2 participants