Struct XpbdWorld3D
pub struct XpbdWorld3D {
pub bodies: Vec<RigidBody3D>,
pub joints: Vec<MotorJoint3D>,
pub manifolds: [ContactManifold3D; 128],
pub manifold_count: usize,
pub bvh: BroadphaseBvh<etalon_sim::::continuum_3d::XpbdWorld3D::{constant#0}>,
pub gravity: [f32; 3],
pub substeps: usize,
}Expand description
64 Hz deterministic Extended Position-Based Dynamics (XPBD) rigid-body physics world.
Fields§
§bodies: Vec<RigidBody3D>§joints: Vec<MotorJoint3D>§manifolds: [ContactManifold3D; 128]§manifold_count: usize§bvh: BroadphaseBvh<etalon_sim::::continuum_3d::XpbdWorld3D::{constant#0}>§gravity: [f32; 3]§substeps: usizeImplementations§
§impl XpbdWorld3D
impl XpbdWorld3D
pub fn new(gravity: [f32; 3], substeps: usize) -> XpbdWorld3D
pub fn new(gravity: [f32; 3], substeps: usize) -> XpbdWorld3D
Creates a new XPBD world with gravitational acceleration and solver substeps.
pub fn add_body(&mut self, body: RigidBody3D) -> usize
pub fn add_body(&mut self, body: RigidBody3D) -> usize
Adds a RigidBody3D to the physics world, inserting its AABB into the BVH.
pub fn add_joint(&mut self, joint: MotorJoint3D) -> usize
pub fn add_joint(&mut self, joint: MotorJoint3D) -> usize
Adds a 6-DOF PGA MotorJoint3D constraint to the physics world.
pub fn rebuild_bvh(&mut self)
pub fn rebuild_bvh(&mut self)
Rebuilds broadphase BVH tight AABBs for all active rigid bodies.
Trait Implementations§
§impl Clone for XpbdWorld3D
impl Clone for XpbdWorld3D
§fn clone(&self) -> XpbdWorld3D
fn clone(&self) -> XpbdWorld3D
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read more§impl Debug for XpbdWorld3D
impl Debug for XpbdWorld3D
§impl Default for XpbdWorld3D
impl Default for XpbdWorld3D
§fn default() -> XpbdWorld3D
fn default() -> XpbdWorld3D
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for XpbdWorld3D
impl RefUnwindSafe for XpbdWorld3D
impl Send for XpbdWorld3D
impl Sync for XpbdWorld3D
impl Unpin for XpbdWorld3D
impl UnsafeUnpin for XpbdWorld3D
impl UnwindSafe for XpbdWorld3D
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
Mutably borrows from an owned value. Read more