b2PreSolveFcn

Type Alias b2PreSolveFcn 

Source
pub type b2PreSolveFcn = Option<unsafe extern "C" fn(shapeIdA: b2ShapeId, shapeIdB: b2ShapeId, point: b2Vec2, normal: b2Vec2, context: *mut c_void) -> bool>;
Expand description

Prototype for a pre-solve callback. This is called after a contact is updated. This allows you to inspect a contact before it goes to the solver. If you are careful, you can modify the contact manifold (e.g. modify the normal). Notes:

  • this function must be thread-safe
  • this is only called if the shape has enabled pre-solve events
  • this is called only for awake dynamic bodies
  • this is not called for sensors
  • the supplied manifold has impulse values from the previous step Return false if you want to disable the contact this step @warning Do not attempt to modify the world inside this callback @ingroup world

Aliased Type§

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

Variants§

§1.0.0

None

No value.

§1.0.0

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

Some value of type T.