Skip to content

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

@azur-wolve

Description

@azur-wolve

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions