pub struct GpuRigidBodyBatch {
pub bodies: Vec<GpuRigidBody>,
}Expand description
A batch of GPU rigid bodies supporting bulk integration.
Fields§
§bodies: Vec<GpuRigidBody>The rigid bodies in this batch.
Implementations§
Source§impl GpuRigidBodyBatch
impl GpuRigidBodyBatch
Sourcepub fn add(&mut self, body: GpuRigidBody) -> usize
pub fn add(&mut self, body: GpuRigidBody) -> usize
Add a body to the batch and return its index.
Sourcepub fn integrate_all(&mut self, dt: f32, gravity: [f32; 3])
pub fn integrate_all(&mut self, dt: f32, gravity: [f32; 3])
Integrate all bodies by dt seconds under a uniform gravity (m/s²).
Uses explicit Euler integration for linear dynamics and a first-order quaternion update for rotational dynamics.
Trait Implementations§
Source§impl Clone for GpuRigidBodyBatch
impl Clone for GpuRigidBodyBatch
Source§fn clone(&self) -> GpuRigidBodyBatch
fn clone(&self) -> GpuRigidBodyBatch
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for GpuRigidBodyBatch
impl Debug for GpuRigidBodyBatch
Source§impl Default for GpuRigidBodyBatch
impl Default for GpuRigidBodyBatch
Source§fn default() -> GpuRigidBodyBatch
fn default() -> GpuRigidBodyBatch
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for GpuRigidBodyBatch
impl RefUnwindSafe for GpuRigidBodyBatch
impl Send for GpuRigidBodyBatch
impl Sync for GpuRigidBodyBatch
impl Unpin for GpuRigidBodyBatch
impl UnsafeUnpin for GpuRigidBodyBatch
impl UnwindSafe for GpuRigidBodyBatch
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more