pub struct GpuRigidBody {
pub position: [f32; 3],
pub velocity: [f32; 3],
pub orientation: [f32; 4],
pub angular_velocity: [f32; 3],
pub mass: f32,
pub inv_inertia: [f32; 9],
}Expand description
A single rigid body stored in GPU-friendly packed arrays of f32.
Orientation is stored as a unit quaternion [x, y, z, w].
The inverse inertia tensor is stored in row-major order as a 3×3 matrix.
Fields§
§position: [f32; 3]World-space position (metres).
velocity: [f32; 3]Linear velocity (m/s).
orientation: [f32; 4]Orientation quaternion [x, y, z, w].
angular_velocity: [f32; 3]Angular velocity in world space (rad/s).
mass: f32Mass in kilograms.
inv_inertia: [f32; 9]Inverse of the body-space inertia tensor, row-major (3×3).
Implementations§
Trait Implementations§
Source§impl Clone for GpuRigidBody
impl Clone for GpuRigidBody
Source§fn clone(&self) -> GpuRigidBody
fn clone(&self) -> GpuRigidBody
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 moreAuto Trait Implementations§
impl Freeze for GpuRigidBody
impl RefUnwindSafe for GpuRigidBody
impl Send for GpuRigidBody
impl Sync for GpuRigidBody
impl Unpin for GpuRigidBody
impl UnsafeUnpin for GpuRigidBody
impl UnwindSafe for GpuRigidBody
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