pub struct b2RayCastCallback { /* private fields */ }Expand description
Callback class for ray casts. See b2World::RayCast
Implementations§
Source§impl b2RayCastCallback
impl b2RayCastCallback
Sourcepub unsafe fn ReportFixture(
self: Pin<&mut b2RayCastCallback>,
fixture: *mut b2Fixture,
point: &b2Vec2,
normal: &b2Vec2,
fraction: f32,
) -> f32
pub unsafe fn ReportFixture( self: Pin<&mut b2RayCastCallback>, fixture: *mut b2Fixture, point: &b2Vec2, normal: &b2Vec2, fraction: f32, ) -> f32
Called for each fixture found in the query. You control how the ray cast proceeds by returning a float: return -1: ignore this fixture 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 @param fixture the fixture hit by the ray @param point the point of initial intersection @param normal the normal vector at the point of intersection @param fraction the fraction along the ray at the point of intersection @return -1 to filter, 0 to terminate, fraction to clip the ray for closest hit, 1 to continue
Sourcepub unsafe fn ReportParticle(
self: Pin<&mut b2RayCastCallback>,
particleSystem: *const b2ParticleSystem,
index: c_int,
point: &b2Vec2,
normal: &b2Vec2,
fraction: f32,
) -> f32
pub unsafe fn ReportParticle( self: Pin<&mut b2RayCastCallback>, particleSystem: *const b2ParticleSystem, index: c_int, point: &b2Vec2, normal: &b2Vec2, fraction: f32, ) -> f32
Called for each particle found in the query. You control how the ray cast proceeds by returning a float: return <=0: ignore the remaining particles in this particle system return fraction: ignore particles that are ‘fraction’ percent farther along the line from ‘point1’ to ‘point2’. Note that ‘point1’ and ‘point2’ are parameters to b2World::RayCast. @param particleSystem the particle system containing the particle @param index the index of the particle in particleSystem @param point the point of intersection bt the ray and the particle @param normal the normal vector at the point of intersection @param fraction percent (0.0~1.0) from ‘point0’ to ‘point1’ along the ray. Note that ‘point1’ and ‘point2’ are parameters to b2World::RayCast. @return <=0 to ignore rest of particle system, fraction to ignore particles that are farther away.
Sourcepub unsafe fn ShouldQueryParticleSystem(
self: Pin<&mut b2RayCastCallback>,
particleSystem: *const b2ParticleSystem,
) -> bool
pub unsafe fn ShouldQueryParticleSystem( self: Pin<&mut b2RayCastCallback>, particleSystem: *const b2ParticleSystem, ) -> bool
Cull an entire particle system from b2World::RayCast. Ignored in b2ParticleSystem::RayCast. @return true if you want to include particleSystem in the RayCast, or false to cull particleSystem from the RayCast.