pub struct BodyStateJson {
pub handle: u32,
pub position: [f64; 3],
pub velocity: [f64; 3],
pub orientation: [f64; 4],
pub angular_velocity: [f64; 3],
pub is_sleeping: bool,
pub is_static: bool,
pub tag: Option<String>,
pub schema_version: String,
}Expand description
A serialized representation of a single body’s state as a JSON-ready struct.
Fields§
§handle: u32Body handle.
position: [f64; 3]World-space position [x, y, z].
velocity: [f64; 3]Linear velocity [vx, vy, vz].
orientation: [f64; 4]Orientation quaternion [x, y, z, w].
angular_velocity: [f64; 3]Angular velocity [wx, wy, wz].
is_sleeping: boolWhether body is sleeping.
is_static: boolWhether body is static.
tag: Option<String>Optional user tag.
schema_version: StringSchema version string.
Implementations§
Source§impl BodyStateJson
impl BodyStateJson
Sourcepub fn from_sim_body(body: &SimBodyState) -> Self
pub fn from_sim_body(body: &SimBodyState) -> Self
Create a BodyStateJson from a SimBodyState.
Sourcepub fn to_sim_body(&self) -> SimBodyState
pub fn to_sim_body(&self) -> SimBodyState
Convert back to a SimBodyState.
Trait Implementations§
Source§impl Clone for BodyStateJson
impl Clone for BodyStateJson
Source§fn clone(&self) -> BodyStateJson
fn clone(&self) -> BodyStateJson
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 BodyStateJson
impl Debug for BodyStateJson
Source§impl<'de> Deserialize<'de> for BodyStateJson
impl<'de> Deserialize<'de> for BodyStateJson
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for BodyStateJson
impl PartialEq for BodyStateJson
Source§impl Serialize for BodyStateJson
impl Serialize for BodyStateJson
impl StructuralPartialEq for BodyStateJson
Auto Trait Implementations§
impl Freeze for BodyStateJson
impl RefUnwindSafe for BodyStateJson
impl Send for BodyStateJson
impl Sync for BodyStateJson
impl Unpin for BodyStateJson
impl UnsafeUnpin for BodyStateJson
impl UnwindSafe for BodyStateJson
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<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.