pub struct SoaRigidBody {Show 15 fields
pub count: usize,
pub pos_x: Vec<f64>,
pub pos_y: Vec<f64>,
pub pos_z: Vec<f64>,
pub vel_x: Vec<f64>,
pub vel_y: Vec<f64>,
pub vel_z: Vec<f64>,
pub quat_x: Vec<f64>,
pub quat_y: Vec<f64>,
pub quat_z: Vec<f64>,
pub quat_w: Vec<f64>,
pub omega_x: Vec<f64>,
pub omega_y: Vec<f64>,
pub omega_z: Vec<f64>,
pub inv_mass: Vec<f64>,
}Expand description
Rigid body data in Structure-of-Arrays (SoA) layout.
This layout maps directly to GPU buffer uploads where each quantity (position, velocity, quaternion, etc.) occupies a contiguous memory region, enabling vectorized (SIMD-width) processing in CUDA/WGSL kernels.
Fields§
§count: usizeNumber of bodies.
pos_x: Vec<f64>§pos_y: Vec<f64>§pos_z: Vec<f64>§vel_x: Vec<f64>§vel_y: Vec<f64>§vel_z: Vec<f64>§quat_x: Vec<f64>§quat_y: Vec<f64>§quat_z: Vec<f64>§quat_w: Vec<f64>§omega_x: Vec<f64>§omega_y: Vec<f64>§omega_z: Vec<f64>§inv_mass: Vec<f64>Implementations§
Source§impl SoaRigidBody
impl SoaRigidBody
Sourcepub fn from_slice(states: &[RigidBodyState]) -> Self
pub fn from_slice(states: &[RigidBodyState]) -> Self
Build an SoA buffer from a slice of RigidBodyState values.
Sourcepub fn to_vec(&self) -> Vec<RigidBodyState>
pub fn to_vec(&self) -> Vec<RigidBodyState>
Convert back to a Vec<RigidBodyState>.
Auto Trait Implementations§
impl Freeze for SoaRigidBody
impl RefUnwindSafe for SoaRigidBody
impl Send for SoaRigidBody
impl Sync for SoaRigidBody
impl Unpin for SoaRigidBody
impl UnsafeUnpin for SoaRigidBody
impl UnwindSafe for SoaRigidBody
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> 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