pub struct BodyObservation {
pub body_index: usize,
pub position: Vec3Fix,
pub velocity: Vec3Fix,
pub rotation: QuatFix,
pub angular_velocity: Vec3Fix,
pub sleeping: bool,
pub in_contact: bool,
}Expand description
Typed, read-only observation of a single body’s law-relevant state.
Public入口 for PhysicsWorld::observe_body / PhysicsWorld::observe_bodies
— 「Law が読む形の観測型」 observation 以前は blob の
parse か field 直読みしかなく、公開 interface が無かった
Fields§
§body_index: usizeBody index this observation was taken from.
⚠️ フレーム内でのみ安定 — PhysicsWorld::remove_body は
swap_remove なので、body の生成・破棄を跨いで同じ index が同じ
body を指す保証はない
position: Vec3FixPosition (center of mass).
velocity: Vec3FixLinear velocity.
rotation: QuatFixOrientation.
angular_velocity: Vec3FixAngular velocity.
sleeping: boolWhether the body is currently asleep (island manager).
in_contact: boolWhether the body has at least one active contact this frame
(Begin or Persist, from crate::event::EventCollector).
⚠️ grounded ではない — 一般 body に地面接触の定義は無いため、
「何らかの body と接触している」という弱い述語に留める
Trait Implementations§
Source§impl Clone for BodyObservation
impl Clone for BodyObservation
impl Copy for BodyObservation
Source§impl Debug for BodyObservation
impl Debug for BodyObservation
Source§impl PartialEq for BodyObservation
impl PartialEq for BodyObservation
impl StructuralPartialEq for BodyObservation
Auto Trait Implementations§
impl Freeze for BodyObservation
impl RefUnwindSafe for BodyObservation
impl Send for BodyObservation
impl Sync for BodyObservation
impl Unpin for BodyObservation
impl UnsafeUnpin for BodyObservation
impl UnwindSafe for BodyObservation
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