pub struct SweepOutcome {
pub hit_fraction: Option<f32>,
pub requested_distance: f32,
pub allowed_distance: f32,
pub allowed_position: Option<Vec3>,
}Expand description
Diagnostics from Sweep::probe, describing only the queried segment.
Distances are sphere-center travel in world units, not surface separation.
No penetration depth, surface normal or blocker identity is inferred from
the fraction-only CollisionQuery abstraction.
use ferravex_math::Vec3;
use ferravex_play::camera::{Blocker, CameraError, Sweep};
let blockers = [Blocker::Sphere { center: Vec3::ZERO, radius: 1. }];
let outcome = Sweep::new(Vec3::ZERO, Vec3::ZERO, 0.25)?
.probe(&blockers[..], 0.02)?;
assert!(outcome.starts_blocked());
assert_eq!(outcome.allowed_position, None);Fields§
§hit_fraction: Option<f32>First impact in [0, 1]; None means the whole segment is clear.
Some(0) includes initial contact as well as initial penetration.
requested_distance: f32Length of the requested center segment, including zero-length queries.
allowed_distance: f32Travel after subtracting padding from the hit distance and clamping to zero. A clear probe retains the full requested distance.
allowed_position: Option<Vec3>Placement after padding, or None when the starting point is blocked.
With zero padding this may touch an obstacle. It is not an escape point.
Implementations§
Source§impl SweepOutcome
impl SweepOutcome
Sourcepub fn starts_blocked(self) -> bool
pub fn starts_blocked(self) -> bool
Whether the adapter reported initial contact/overlap. Zero allowed distance alone does not imply this: padding can consume a clear gap.
Trait Implementations§
Source§impl Clone for SweepOutcome
impl Clone for SweepOutcome
Source§fn clone(&self) -> SweepOutcome
fn clone(&self) -> SweepOutcome
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more