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

camera y-axis set to infinity if speed too big #13

Open
azur-wolve opened this issue Jun 17, 2024 · 0 comments
Open

camera y-axis set to infinity if speed too big #13

azur-wolve opened this issue Jun 17, 2024 · 0 comments

Comments

@azur-wolve
Copy link

default move speed is small
but if its something bigger, like 50, the camera y-axis ends up to infinity

after this line:

camera_target_position = lerp(camera_target_position, head_xform.origin, delta * speed * STAIRS_FEELING_COEFFICIENT * camera_lerp_coefficient)

if STAIRS_FEELING_COEFFICIENT = 0.5 solves some of that.
it should be calculated relative to MAX_SPEED with some formula?

also clamping the resulting camera_target_position:

camera_target_position = lerp(camera_target_position, head_xform.origin, delta * speed * STAIRS_FEELING_COEFFICIENT * camera_lerp_coefficient)

# FIX: limit camera pos away from body
camera_target_position.y = clamp(camera_target_position.y, 0, abs(head_xform.origin.y) + MAX_STEP_HEIGHT)
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