pub struct RigidBody2D {
pub vertices: Vec<Point2>,
pub position: Point2,
pub rotation_rad: f32,
pub kind: BodyKind,
}Expand description
One rigid body’s polygon + pose, captured at one frame.
vertices are expressed in the body’s local frame; the renderer
transforms them via position + rotation_rad so the wire payload
stays compact when a body moves but does not deform.
Fields§
§vertices: Vec<Point2>Polygon corners in the body’s local frame, counter-clockwise.
position: Point2World-space position of the body’s local origin.
rotation_rad: f32Rotation of the body about its local origin, in radians.
kind: BodyKindSemantic class used by the renderer to choose colour / stroke / fill.
Trait Implementations§
Source§impl Clone for RigidBody2D
impl Clone for RigidBody2D
Source§fn clone(&self) -> RigidBody2D
fn clone(&self) -> RigidBody2D
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 moreSource§impl Debug for RigidBody2D
impl Debug for RigidBody2D
Source§impl<'de> Deserialize<'de> for RigidBody2D
impl<'de> Deserialize<'de> for RigidBody2D
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 RigidBody2D
impl PartialEq for RigidBody2D
Source§fn eq(&self, other: &RigidBody2D) -> bool
fn eq(&self, other: &RigidBody2D) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for RigidBody2D
impl Serialize for RigidBody2D
impl StructuralPartialEq for RigidBody2D
Auto Trait Implementations§
impl Freeze for RigidBody2D
impl RefUnwindSafe for RigidBody2D
impl Send for RigidBody2D
impl Sync for RigidBody2D
impl Unpin for RigidBody2D
impl UnsafeUnpin for RigidBody2D
impl UnwindSafe for RigidBody2D
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<C> CloneExpand for Cwhere
C: Clone,
impl<C> CloneExpand for Cwhere
C: Clone,
fn __expand_clone_method(&self, _scope: &mut Scope) -> C
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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