Struct libliquidfun_sys::box2d::ffi::b2Fixture
source · #[repr(C, align(8))]pub struct b2Fixture { /* private fields */ }Expand description
A fixture is used to attach a shape to a body for collision detection. A fixture inherits its transform from its parent. Fixtures hold additional non-geometric data such as friction, collision filters, etc. Fixtures are created via b2Body::CreateFixture. @warning you cannot reuse fixtures.
Implementations§
source§impl b2Fixture
impl b2Fixture
sourcepub fn GetType(self: &b2Fixture) -> b2Shape_Type
pub fn GetType(self: &b2Fixture) -> b2Shape_Type
Get the type of the child shape. You can use this to down cast to the concrete shape. @return the shape type.
sourcepub fn GetNext(self: Pin<&mut b2Fixture>) -> *mut b2Fixture
pub fn GetNext(self: Pin<&mut b2Fixture>) -> *mut b2Fixture
Get the next fixture in the parent body’s fixture list. @return the next shape.
pub fn GetNext1(self: &b2Fixture) -> *const b2Fixture
sourcepub fn GetUserData<'a>(
self: Pin<&'a mut b2Fixture>
) -> Pin<&'a mut b2FixtureUserData>
pub fn GetUserData<'a>( self: Pin<&'a mut b2Fixture> ) -> Pin<&'a mut b2FixtureUserData>
Get the user data that was assigned in the fixture definition. Use this to store your application specific data.
sourcepub fn TestPoint(self: &b2Fixture, p: &b2Vec2) -> bool
pub fn TestPoint(self: &b2Fixture, p: &b2Vec2) -> bool
Test a point for containment in this fixture. @param p a point in world coordinates.
sourcepub unsafe fn ComputeDistance(
self: &b2Fixture,
p: &b2Vec2,
distance: *mut f32,
normal: *mut b2Vec2,
childIndex: c_int
)
pub unsafe fn ComputeDistance( self: &b2Fixture, p: &b2Vec2, distance: *mut f32, normal: *mut b2Vec2, childIndex: c_int )
Compute the distance from this fixture. @param p a point in world coordinates.
sourcepub unsafe fn RayCast(
self: &b2Fixture,
output: *mut b2RayCastOutput,
input: &b2RayCastInput,
childIndex: c_int
) -> bool
pub unsafe fn RayCast( self: &b2Fixture, output: *mut b2RayCastOutput, input: &b2RayCastInput, childIndex: c_int ) -> bool
Cast a ray against this shape. @param output the ray-cast results. @param input the ray-cast input parameters. @param childIndex the child shape index (e.g. edge index)
sourcepub unsafe fn GetMassData(self: &b2Fixture, massData: *mut b2MassData)
pub unsafe fn GetMassData(self: &b2Fixture, massData: *mut b2MassData)
Get the mass data for this fixture. The mass data is based on the density and the shape. The rotational inertia is about the shape’s origin. This operation may be expensive.
source§impl b2Fixture
impl b2Fixture
sourcepub fn SetFilterData(self: Pin<&mut Self>, filter: &b2Filter)
pub fn SetFilterData(self: Pin<&mut Self>, filter: &b2Filter)
Set the contact filtering data. This will not update contacts until the next time step when either parent body is active and awake. This automatically calls Refilter.
source§impl<'a> b2Fixture
impl<'a> b2Fixture
sourcepub fn GetFilterData(&'a self) -> &'a b2Filter
pub fn GetFilterData(&'a self) -> &'a b2Filter
Get the contact filtering data.
source§impl b2Fixture
impl b2Fixture
sourcepub fn SetDensity(self: Pin<&mut Self>, density: f32)
pub fn SetDensity(self: Pin<&mut Self>, density: f32)
Set the density of this fixture. This will not automatically adjust the mass of the body. You must call b2Body::ResetMassData to update the body’s mass.
source§impl b2Fixture
impl b2Fixture
sourcepub fn SetFriction(self: Pin<&mut Self>, friction: f32)
pub fn SetFriction(self: Pin<&mut Self>, friction: f32)
Set the coefficient of friction. This will not change the friction of existing contacts.
source§impl b2Fixture
impl b2Fixture
sourcepub fn SetRestitution(self: Pin<&mut Self>, restitution: f32)
pub fn SetRestitution(self: Pin<&mut Self>, restitution: f32)
Set the coefficient of restitution. This will not change the restitution of existing contacts.
source§impl b2Fixture
impl b2Fixture
sourcepub fn GetRestitutionThreshold(&self) -> f32
pub fn GetRestitutionThreshold(&self) -> f32
Get the restitution velocity threshold.