pub struct BodyState {
pub linear_velocity: Vec2,
pub angular_velocity: f32,
pub flags: u32,
pub delta_position: Vec2,
pub delta_rotation: Rot,
}Expand description
Body state, designed for fast conversion to and from SIMD via scatter-gather. Only awake dynamic and kinematic bodies have a body state. Used in the performance critical constraint solver. (b2BodyState, 32 bytes)
The solver operates on the body state. The body state array does not hold static bodies; their delta rotation is identity via a dummy state.
Fields§
§linear_velocity: Vec2§angular_velocity: f32§flags: u32body_flags bits. Important flags: locking, dynamic.
delta_position: Vec2Using delta position reduces round-off error far from the origin
delta_rotation: RotUsing delta rotation because the solver cannot access the full rotation on static bodies and must use zero delta rotation (c,s) = (1,0)
Trait Implementations§
impl Copy for BodyState
impl StructuralPartialEq for BodyState
Auto Trait Implementations§
impl Freeze for BodyState
impl RefUnwindSafe for BodyState
impl Send for BodyState
impl Sync for BodyState
impl Unpin for BodyState
impl UnsafeUnpin for BodyState
impl UnwindSafe for BodyState
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