#[repr(C)]pub struct b2ShapeDef {Show 13 fields
pub userData: *mut c_void,
pub material: b2SurfaceMaterial,
pub density: f32,
pub filter: b2Filter,
pub enableCustomFiltering: bool,
pub isSensor: bool,
pub enableSensorEvents: bool,
pub enableContactEvents: bool,
pub enableHitEvents: bool,
pub enablePreSolveEvents: bool,
pub invokeContactCreation: bool,
pub updateBodyMass: bool,
pub internalValue: c_int,
}Expand description
Used to create a shape. This is a temporary object used to bundle shape creation parameters. You may use the same shape definition to create multiple shapes. Must be initialized using b2DefaultShapeDef(). @ingroup shape
Fields§
§userData: *mut c_voidUse this to store application specific shape data.
material: b2SurfaceMaterialThe surface material for this shape.
density: f32The density, usually in kg/m^2. This is not part of the surface material because this is for the interior, which may have other considerations, such as being hollow. For example a wood barrel may be hollow or full of water.
filter: b2FilterCollision filtering data.
enableCustomFiltering: boolEnable custom filtering. Only one of the two shapes needs to enable custom filtering. See b2WorldDef.
isSensor: boolA sensor shape generates overlap events but never generates a collision response. Sensors do not have continuous collision. Instead, use a ray or shape cast for those scenarios. Sensors still contribute to the body mass if they have non-zero density. @note Sensor events are disabled by default. @see enableSensorEvents
enableSensorEvents: boolEnable sensor events for this shape. This applies to sensors and non-sensors. False by default, even for sensors.
enableContactEvents: boolEnable contact events for this shape. Only applies to kinematic and dynamic bodies. Ignored for sensors. False by default.
enableHitEvents: boolEnable hit events for this shape. Only applies to kinematic and dynamic bodies. Ignored for sensors. False by default.
enablePreSolveEvents: boolEnable pre-solve contact events for this shape. Only applies to dynamic bodies. These are expensive and must be carefully handled due to multithreading. Ignored for sensors.
invokeContactCreation: boolWhen shapes are created they will scan the environment for collision the next time step. This can significantly slow down static body creation when there are many static shapes. This is flag is ignored for dynamic and kinematic shapes which always invoke contact creation.
updateBodyMass: boolShould the body update the mass properties when this shape is created. Default is true. Warning: if this is true, you MUST call b2Body_ApplyMassFromShapes before simulating the world.
internalValue: c_intUsed internally to detect a valid definition. DO NOT SET.
Trait Implementations§
Source§impl Clone for b2ShapeDef
impl Clone for b2ShapeDef
Source§fn clone(&self) -> b2ShapeDef
fn clone(&self) -> b2ShapeDef
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for b2ShapeDef
impl Debug for b2ShapeDef
impl Copy for b2ShapeDef
Auto Trait Implementations§
impl Freeze for b2ShapeDef
impl RefUnwindSafe for b2ShapeDef
impl !Send for b2ShapeDef
impl !Sync for b2ShapeDef
impl Unpin for b2ShapeDef
impl UnwindSafe for b2ShapeDef
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)