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

Jumping on sloping ground is broken #580

Closed
Malcolmnixon opened this issue Dec 9, 2023 · 0 comments
Closed

Jumping on sloping ground is broken #580

Malcolmnixon opened this issue Dec 9, 2023 · 0 comments

Comments

@Malcolmnixon
Copy link
Collaborator

PR #519 broke jumping while running on a sloped ground. Specifically the following test is broken:

# Skip if our vertical velocity is not essentially the same as the ground
var ground_relative := velocity - ground_velocity
if abs(ground_relative.dot(up_player)) > 0.01:
return

It calculates the players velocity (relative to the ground) and attempts to ascertain if there is a significant vertical component to it indicating a jump or landing is in effect.

The problem occurs when the player is running up or down a slope which involves a vertical velocity with regards to the players "up" vector. Instead the test should be against the grounds normal vector - asking whether there is a vertical velocity moving towards or away from the ground surface.

Malcolmnixon added a commit to Malcolmnixon/godot-xr-tools that referenced this issue Dec 9, 2023
This PR fixes issue GodotVR#580 by checking for vertical velocity against the current ground plane rather than the players up-vector.
Malcolmnixon added a commit that referenced this issue Dec 11, 2023
This PR fixes issue #580 by checking for vertical velocity against the current ground plane rather than the players up-vector.
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

No branches or pull requests

1 participant