pub struct PhysicsBudget {
pub fixed: u32,
pub dynamic: u32,
pub kinematic: u32,
pub sensors: u32,
pub joints: u32,
pub anchors: u32,
pub spawn_headroom: u32,
}Expand description
The reservation a world’s physics content implies.
Grouped by the kind of body the simulation builds rather than by the asset that asked for it, because that is what the simulation sizes its storage against.
Fields§
§fixed: u32Immovable bodies: static colliders plus the world’s floor.
dynamic: u32Freely simulated bodies.
kinematic: u32Position-driven bodies: the player capsule and the character rigs.
sensors: u32Sensor bodies, one per trigger volume.
joints: u32Joints connecting two bodies.
anchors: u32Hidden static bodies minted to anchor a world-anchored joint.
spawn_headroom: u32Bodies held back for entities created after init.
Implementations§
Source§impl PhysicsBudget
impl PhysicsBudget
Sourcepub const fn derive(counts: &PhysicsCounts, spawn_headroom: u32) -> Self
pub const fn derive(counts: &PhysicsCounts, spawn_headroom: u32) -> Self
Derive the reservation for a world’s counts, holding back
spawn_headroom bodies for entities created at runtime.
The floor body is always built, so fixed is one past the static
collider count.
Sourcepub const fn body_total(&self) -> u32
pub const fn body_total(&self) -> u32
Bodies the authored world builds at init.
Trait Implementations§
Source§impl Clone for PhysicsBudget
impl Clone for PhysicsBudget
Source§fn clone(&self) -> PhysicsBudget
fn clone(&self) -> PhysicsBudget
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more