pub struct WorldDef {Show 17 fields
pub gravity: Vec3,
pub restitution_threshold: f32,
pub hit_event_threshold: f32,
pub contact_hertz: f32,
pub contact_damping_ratio: f32,
pub contact_speed: f32,
pub maximum_linear_speed: f32,
pub friction_callback: Option<FrictionCallback>,
pub restitution_callback: Option<RestitutionCallback>,
pub enable_sleep: bool,
pub enable_continuous: bool,
pub user_data: u64,
pub capacity: Capacity,
pub create_debug_shape: Option<CreateDebugShapeCallback>,
pub destroy_debug_shape: Option<DestroyDebugShapeCallback>,
pub user_debug_shape_context: u64,
pub internal_value: i32,
}Expand description
World definition used to create a simulation world.
Must be initialized using default_world_def. (b3WorldDef)
Task-system fields from C (workerCount, enqueue/finish callbacks) are
omitted: the Rust port is serial and never spawns workers.
Fields§
§gravity: Vec3Gravity vector. Box3D has no up-vector defined.
restitution_threshold: f32Restitution speed threshold, usually in m/s.
hit_event_threshold: f32Hit event speed threshold, usually in m/s.
contact_hertz: f32Contact stiffness. Cycles per second.
contact_damping_ratio: f32Contact bounciness. Non-dimensional.
contact_speed: f32Contact speed cap for overlap resolution, usually m/s.
maximum_linear_speed: f32Maximum linear speed, usually m/s.
friction_callback: Option<FrictionCallback>Optional friction mixing callback.
restitution_callback: Option<RestitutionCallback>Optional restitution mixing callback.
enable_sleep: boolCan bodies go to sleep?
enable_continuous: boolEnable continuous collision.
user_data: u64Application-specific world data.
capacity: CapacityOptional capacity hints to avoid run-time allocations.
create_debug_shape: Option<CreateDebugShapeCallback>Used to create debug draw shapes when a shape is first drawn.
destroy_debug_shape: Option<DestroyDebugShapeCallback>Used to destroy debug draw shapes when a shape is modified or destroyed.
user_debug_shape_context: u64Passed to the debug shape callbacks.
internal_value: i32Used internally to detect a valid definition. DO NOT SET.