Skip to main content

SectorPhysicsWorld3D

Struct SectorPhysicsWorld3D 

pub struct SectorPhysicsWorld3D {
    pub sector_id: String,
    pub time_seconds: f64,
    pub substep_counter: u64,
    pub xpbd: XpbdWorld3D,
    pub landforms: Vec<SdfCollider>,
    pub ragdolls: Vec<ArticulatedRagdoll>,
    pub character: CharacterController,
    pub rover: RoverState,
    pub continuum: ContinuumBridge3D,
    pub fracture_events: usize,
    pub total_raycasts: usize,
    pub total_raycast_hits: usize,
}
Expand description

Unified sector physics simulation world coordinating 3D XPBD rigid bodies, analytical SDF terrain, character controller, rover kinematics, ragdolls, dynamic fracture, and two-way continuum coupling.

Fields§

§sector_id: String

Sector identifier (e.g. "talbingo_pines", "jounama_karst").

§time_seconds: f64

Total elapsed simulation time in seconds.

§substep_counter: u64

Monotonically increasing substep tick counter.

§xpbd: XpbdWorld3D

64 Hz deterministic XPBD simulation engine.

§landforms: Vec<SdfCollider>

Analytical SDF terrain landforms registered in the world.

§ragdolls: Vec<ArticulatedRagdoll>

Articulated fauna ragdoll controllers.

§character: CharacterController

3D capsule character controller.

§rover: RoverState

4-wheel rover vehicle kinematics controller.

§continuum: ContinuumBridge3D

Two-way continuum coupling bridge (Soil, Water, Vegetation).

§fracture_events: usize

Count of dynamic stress-cleavage fracture events observed.

§total_raycasts: usize

Total spatial raycasts evaluated.

§total_raycast_hits: usize

Total spatial raycast hits registered.

Implementations§

§

impl SectorPhysicsWorld3D

pub fn for_sector(sector_id: &str) -> SectorPhysicsWorld3D

Creates a fully populated physics world configured for the requested sector_id.

pub fn step(&mut self, dt: f32)

Advances the entire sector physics simulation by dt seconds (XPBD, continuum, ragdolls).

pub fn step_character_3d( &mut self, wish_dir: [f32; 2], sprint: bool, jump: bool, crouch: bool, dt: f32, )

Steps the 3D capsule character controller with full 3D collision, stair-stepping, and cave ceiling checks.

pub fn step_rover_3d(&mut self, throttle: f32, steer: f32, brake: f32, dt: f32)

Steps the 4-wheel rover vehicle kinematics using 3D sphere-cast suspension probes.

pub fn step_continuum_coupling_3d(&mut self, dt: f32)

Steps the two-way continuum coupling bridge against active sector dynamic bodies.

pub fn evaluate_fracture_impact( &mut self, body_idx: usize, impact_impulse_ns: f32, contact_area_m2: f32, impact_normal_world: [f32; 3], mat_props: &FractureMaterialProps, ) -> Option<FractureOutcome3D>

Evaluates impact stress on a dynamic rigid body and partitions it along its principal cleavage plane if stress exceeds mat_props.tensile_strength, strictly conserving momentum.

pub fn cast_ray( &mut self, origin: [f32; 3], dir: [f32; 3], max_toi: f32, ) -> Option<RayHit3D>

Casts a 3D ray through the sector BVH, returning the closest collider hit.

pub fn cast_sphere( &self, center: [f32; 3], radius: f32, dir: [f32; 3], max_dist: f32, ) -> Option<ShapeCastHit3D>

Casts a sphere along dir up to max_dist through the sector BVH.

pub fn cast_capsule( &self, center: [f32; 3], radius: f32, half_height: f32, dir: [f32; 3], max_dist: f32, ) -> Option<ShapeCastHit3D>

Casts a vertical capsule along dir up to max_dist through the sector BVH.

pub fn overlap_aabb( &self, query_aabb: &Aabb3D, out_collider_ids: &mut [u32], ) -> usize

Writes all collider IDs overlapping query_aabb into out_collider_ids.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<T> Downcast<T> for T

§

fn downcast(&self) -> &T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> Upcast<T> for T

§

fn upcast(&self) -> Option<&T>

§

impl<T> WasmNotSend for T
where T: Send,

§

impl<T> WasmNotSendSync for T
where T: WasmNotSend + WasmNotSync,

§

impl<T> WasmNotSync for T
where T: Sync,