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 is_grounded #711

Merged
merged 1 commit into from
Aug 9, 2024

Conversation

Vrixyz
Copy link
Contributor

@Vrixyz Vrixyz commented Aug 5, 2024

Some numbers

offset is CharacterLength::Relative(0.01), then the height of the CharacterController in the exampple is 0.3, resulting in an exxaggerated offset (for aabb computation) of 0.0033. The nudge factor being 0.0001 shouldn´t impact that, but we're still in small numbers game. I think overshooting a bit won´t hurt much, especially if it fixes is_grounded reliability.

TODO?

I think I can make a test about ground prediction (make a character walking on a trimesh for some time, verify it's always grounded), but I fear this test might not always catch such bug.

Alternatives

We can consider exposing this offset multiplier, or the whole AABB used.

tested in windows and linux though, + character controller example no longer glimpses red, + still passes tests
@Vrixyz Vrixyz changed the title character offset exxageration to 1.2 ; number is out of my hat fix is_grounded character controller Aug 5, 2024
@Vrixyz Vrixyz changed the title fix is_grounded character controller fix character controller is_grounded Aug 5, 2024
@Vrixyz Vrixyz requested a review from sebcrozet August 7, 2024 08:08
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.

It would be interesting to know why 1.1 didn’t work here, but let’s merge this as a stopgap solution. Thanks!

@Vrixyz Vrixyz merged commit 5542bc5 into dimforge:master Aug 9, 2024
7 checks passed
@Vrixyz
Copy link
Contributor Author

Vrixyz commented Aug 12, 2024

It would be interesting to know why 1.1 didn’t work here, but let’s merge this as a stopgap solution. Thanks!

@sebcrozet My behaviour analysis, with a capsule moving on a flat ground (character controller example)

It's frustrating that I can´t find why the capsule ends up being too high, but I'll give up on further analysis for now...

image

https://docs.google.com/presentation/d/1Uc9HEgNH0H3Mf9zvaiuNFCdopPnl50QVsyTkjxdK4po/edit?usp=sharing

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