pub struct PlacedBox {
pub id: String,
pub instance: usize,
pub position: Point3<f64>,
pub dimensions: Vector3<f64>,
pub mass: Option<f64>,
pub cog_offset: Option<Vector3<f64>>,
}Expand description
A placed box with position and dimensions.
Fields§
§id: StringUnique identifier.
instance: usizeInstance index.
position: Point3<f64>Position (bottom-left-front corner).
dimensions: Vector3<f64>Dimensions (width, depth, height) after orientation applied.
mass: Option<f64>Mass of the box (optional).
cog_offset: Option<Vector3<f64>>Center of gravity offset from geometric center (optional).
Implementations§
Source§impl PlacedBox
impl PlacedBox
Sourcepub fn new(
id: impl Into<String>,
instance: usize,
position: Point3<f64>,
dimensions: Vector3<f64>,
) -> Self
pub fn new( id: impl Into<String>, instance: usize, position: Point3<f64>, dimensions: Vector3<f64>, ) -> Self
Creates a new placed box.
Sourcepub fn with_cog_offset(self, offset: Vector3<f64>) -> Self
pub fn with_cog_offset(self, offset: Vector3<f64>) -> Self
Sets the center of gravity offset from geometric center.
Sourcepub fn center_of_gravity(&self) -> Point3<f64>
pub fn center_of_gravity(&self) -> Point3<f64>
Returns the center of gravity.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PlacedBox
impl RefUnwindSafe for PlacedBox
impl Send for PlacedBox
impl Sync for PlacedBox
impl Unpin for PlacedBox
impl UnwindSafe for PlacedBox
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
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.