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 moreimpl Copy for PhysicsBudget
Source§impl Debug for PhysicsBudget
impl Debug for PhysicsBudget
Source§impl Default for PhysicsBudget
impl Default for PhysicsBudget
Source§fn default() -> PhysicsBudget
fn default() -> PhysicsBudget
impl Eq for PhysicsBudget
Source§impl PartialEq for PhysicsBudget
impl PartialEq for PhysicsBudget
impl StructuralPartialEq for PhysicsBudget
Auto Trait Implementations§
impl Freeze for PhysicsBudget
impl RefUnwindSafe for PhysicsBudget
impl Send for PhysicsBudget
impl Sync for PhysicsBudget
impl Unpin for PhysicsBudget
impl UnsafeUnpin for PhysicsBudget
impl UnwindSafe for PhysicsBudget
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.