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: StringSector identifier (e.g. "talbingo_pines", "jounama_karst").
time_seconds: f64Total elapsed simulation time in seconds.
substep_counter: u64Monotonically increasing substep tick counter.
xpbd: XpbdWorld3D64 Hz deterministic XPBD simulation engine.
landforms: Vec<SdfCollider>Analytical SDF terrain landforms registered in the world.
ragdolls: Vec<ArticulatedRagdoll>Articulated fauna ragdoll controllers.
character: CharacterController3D capsule character controller.
rover: RoverState4-wheel rover vehicle kinematics controller.
continuum: ContinuumBridge3DTwo-way continuum coupling bridge (Soil, Water, Vegetation).
fracture_events: usizeCount of dynamic stress-cleavage fracture events observed.
total_raycasts: usizeTotal spatial raycasts evaluated.
total_raycast_hits: usizeTotal spatial raycast hits registered.
Implementations§
§impl SectorPhysicsWorld3D
impl SectorPhysicsWorld3D
pub fn for_sector(sector_id: &str) -> 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)
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,
)
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)
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)
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>
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>
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>
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>
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
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.