#[repr(C)]pub struct b3WorldDef {Show 21 fields
pub gravity: b3Vec3,
pub restitutionThreshold: f32,
pub hitEventThreshold: f32,
pub contactHertz: f32,
pub contactDampingRatio: f32,
pub contactSpeed: f32,
pub maximumLinearSpeed: f32,
pub frictionCallback: b3FrictionCallback,
pub restitutionCallback: b3RestitutionCallback,
pub enableSleep: bool,
pub enableContinuous: bool,
pub workerCount: u32,
pub enqueueTask: b3EnqueueTaskCallback,
pub finishTask: b3FinishTaskCallback,
pub userTaskContext: *mut c_void,
pub userData: *mut c_void,
pub createDebugShape: b3CreateDebugShapeCallback,
pub destroyDebugShape: b3DestroyDebugShapeCallback,
pub userDebugShapeContext: *mut c_void,
pub capacity: b3Capacity,
pub internalValue: c_int,
}Expand description
World definition used to create a simulation world. Must be initialized using b3DefaultWorldDef. @ingroup world
Fields§
§gravity: b3Vec3Gravity vector. Box3D has no up-vector defined.
restitutionThreshold: f32Restitution speed threshold, usually in m/s. Collisions above this speed have restitution applied (will bounce).
hitEventThreshold: f32Hit event speed threshold, usually in m/s. Collisions above this speed can generate hit events if the shape also enables hit events.
contactHertz: f32Contact stiffness. Cycles per second. Increasing this increases the speed of overlap recovery, but can introduce jitter.
contactDampingRatio: f32Contact bounciness. Non-dimensional. You can speed up overlap recovery by decreasing this with the trade-off that overlap resolution becomes more energetic.
contactSpeed: f32This parameter controls how fast overlap is resolved and usually has units of meters per second. This only puts a cap on the resolution speed. The resolution speed is increased by increasing the hertz and/or decreasing the damping ratio.
maximumLinearSpeed: f32Maximum linear speed. Usually meters per second.
frictionCallback: b3FrictionCallbackOptional mixing callback for friction. The default uses sqrt(frictionA * frictionB).
restitutionCallback: b3RestitutionCallbackOptional mixing callback for restitution. The default uses max(restitutionA, restitutionB).
enableSleep: boolCan bodies go to sleep to improve performance
enableContinuous: boolEnable continuous collision
workerCount: u32Number of workers to use with the provided task system. Box3D performs best when using only performance cores and accessing a single L2 cache. Efficiency cores and hyper-threading provide little benefit and may even harm performance. This is clamped to the range [1, B3_MAX_WORKERS]. Using a value above 1 will turn on multithreading. If task callbacks are provided then Box3D will use the user provided task system. Otherwise Box3D will create threads and use an internal scheduler.
enqueueTask: b3EnqueueTaskCallbackfunction to spawn task
finishTask: b3FinishTaskCallbackfunction to finish a task
userTaskContext: *mut c_voidUser context that is provided to enqueueTask and finishTask
userData: *mut c_voidUser data associated with a world
createDebugShape: b3CreateDebugShapeCallbackUsed to create debug draw shapes. This is called when a shape is first drawn using b3DebugDraw.
destroyDebugShape: b3DestroyDebugShapeCallbackUsed to destroy debug draw shapes. This is called when a shape is modified or destroyed.
userDebugShapeContext: *mut c_voidThis is passed to the debug shape callbacks to provide a user context.
capacity: b3CapacityOptional initial capacities
internalValue: c_intUsed internally to detect a valid definition. DO NOT SET.
Trait Implementations§
Source§impl Clone for b3WorldDef
impl Clone for b3WorldDef
Source§fn clone(&self) -> b3WorldDef
fn clone(&self) -> b3WorldDef
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more