Skip to main content

XpbdWorld3D

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: usize

Implementations§

§

impl 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

Adds a RigidBody3D to the physics world, inserting its AABB into the BVH.

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)

Rebuilds broadphase BVH tight AABBs for all active rigid bodies.

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

Advances the rigid-body XPBD simulation by dt seconds using sequential impulse contacts.

Trait Implementations§

§

impl Clone for 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)

Performs copy-assignment from source. Read more
§

impl Debug for XpbdWorld3D

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Default for XpbdWorld3D

§

fn default() -> XpbdWorld3D

Returns the “default value” for a type. Read more

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,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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,