pub struct ShapeDef {Show 13 fields
pub user_data: u64,
pub material: SurfaceMaterial,
pub density: f32,
pub filter: Filter,
pub enable_custom_filtering: bool,
pub is_sensor: bool,
pub enable_sensor_events: bool,
pub enable_contact_events: bool,
pub enable_hit_events: bool,
pub enable_pre_solve_events: bool,
pub invoke_contact_creation: bool,
pub update_body_mass: bool,
pub internal_value: i32,
}Expand description
Used to create a shape. Must be initialized using default_shape_def.
(b2ShapeDef)
Fields§
§user_data: u64Application specific shape data.
material: SurfaceMaterialThe surface material for this shape.
density: f32The density, usually in kg/m^2.
filter: FilterCollision filtering data.
enable_custom_filtering: boolEnable custom filtering. Only one of the two shapes needs to enable it.
is_sensor: boolA sensor shape generates overlap events but no collision response.
enable_sensor_events: boolEnable sensor events for this shape. False by default, even for sensors.
enable_contact_events: boolEnable contact events for this shape. False by default.
enable_hit_events: boolEnable hit events for this shape. False by default.
enable_pre_solve_events: boolEnable pre-solve contact events for this shape.
invoke_contact_creation: boolWhen shapes are created they scan the environment for collision next step. Ignored for dynamic and kinematic shapes.
update_body_mass: boolShould the body update the mass properties when this shape is created.
internal_value: i32Used internally to detect a valid definition. DO NOT SET.