INNER CODE UNIT · Rust

reach

dust-engine/dust · crates/character/src/lib.rs:344

    let reach = character.height * 0.5 + character.step_height + character.ground_probe;
    move_and_slide
        .spatial_query
        .cast_ray(position, Dir3::NEG_Y, reach, true, filter)
        .is_some_and(|hit| hit.normal.y >= character.min_ground_normal_y)
}

/// Try the move again from `step_height` higher: sweep up, slide horizontally,
/// sweep back down. Accept it when the raised capsule has a full radius of room
/// ahead (a step, not a wall), lands on something, and ends up higher than it
/// started. The landing's contact normal is not consulted: the rounded bottom
/// first meets a ledge's front edge, whose normal tilts; `ground_under` then
/// keeps the character grounded while it walks up over the edge.
#[allow(clippy::too_many_arguments)]
fn step_up(
    move_and_slide: &MoveAndSlide,
    collider: &Collider,
    start: Vec3,

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…