b2CastResultFcn

Type Alias b2CastResultFcn 

Source
pub type b2CastResultFcn = Option<unsafe extern "C" fn(shapeId: b2ShapeId, point: b2Vec2, normal: b2Vec2, fraction: f32, context: *mut c_void) -> f32>;
Expand description

Prototype callback for ray and shape casts. Called for each shape found in the query. You control how the ray cast proceeds by returning a float: return -1: ignore this shape and continue return 0: terminate the ray cast return fraction: clip the ray to this point return 1: don’t clip the ray and continue A cast with initial overlap will return a zero fraction and a zero normal. @param shapeId the shape hit by the ray @param point the point of initial intersection @param normal the normal vector at the point of intersection, zero for a shape cast with initial overlap @param fraction the fraction along the ray at the point of intersection, zero for a shape cast with initial overlap @param context the user context @return -1 to filter, 0 to terminate, fraction to clip the ray for closest hit, 1 to continue @see b2World_CastRay @ingroup world

Aliased Type§

pub enum b2CastResultFcn {
    None,
    Some(unsafe extern "C" fn(b2ShapeId, b2Vec2, b2Vec2, f32, *mut c_void) -> f32),
}

Variants§

§1.0.0

None

No value.

§1.0.0

Some(unsafe extern "C" fn(b2ShapeId, b2Vec2, b2Vec2, f32, *mut c_void) -> f32)

Some value of type T.