Skip to main content

b2RayCastCallback

Struct b2RayCastCallback 

Source
pub struct b2RayCastCallback { /* private fields */ }
Expand description

Callback class for ray casts. See b2World::RayCast

Implementations§

Source§

impl b2RayCastCallback

Source

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

Source

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.

Source

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.

Trait Implementations§

Source§

impl AsRef<b2RayCastCallback> for b2RayCastCallbackWrapper

Source§

fn as_ref(&self) -> &b2RayCastCallback

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl Drop for b2RayCastCallback

Source§

fn drop(self: &mut b2RayCastCallback)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more
Source§

impl ExternType for b2RayCastCallback

Source§

type Kind = Opaque

Source§

type Id

A type-level representation of the type’s C++ namespace and type name. Read more
Source§

impl MakeCppStorage for b2RayCastCallback

Source§

unsafe fn allocate_uninitialized_cpp_storage() -> *mut b2RayCastCallback

Allocates heap space for this type in C++ and return a pointer to that space, but do not initialize that space (i.e. do not yet call a constructor). Read more
Source§

unsafe fn free_uninitialized_cpp_storage(arg0: *mut b2RayCastCallback)

Frees a C++ allocation which has not yet had a constructor called. Read more
Source§

impl SharedPtrTarget for b2RayCastCallback

Source§

impl UniquePtrTarget for b2RayCastCallback

Source§

impl WeakPtrTarget for b2RayCastCallback

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.