pub struct SweptBox {
pub transform_start: [[f64; 4]; 4],
pub transform_end: [[f64; 4]; 4],
pub half_extents: [f64; 3],
}Expand description
A box swept along a path defined by a start and end transform.
The conservative AABB encloses the box at both the start and end poses.
Fields§
§transform_start: [[f64; 4]; 4]Homogeneous transform (row-major 4x4) at the start of the sweep.
transform_end: [[f64; 4]; 4]Homogeneous transform (row-major 4x4) at the end of the sweep.
half_extents: [f64; 3]Half-extents of the box along its local axes.
Implementations§
Source§impl SweptBox
impl SweptBox
Sourcepub fn new(
transform_start: [[f64; 4]; 4],
transform_end: [[f64; 4]; 4],
half_extents: [f64; 3],
) -> Self
pub fn new( transform_start: [[f64; 4]; 4], transform_end: [[f64; 4]; 4], half_extents: [f64; 3], ) -> Self
Create a new SweptBox.
Sourcepub fn aabb(&self) -> ([f64; 3], [f64; 3])
pub fn aabb(&self) -> ([f64; 3], [f64; 3])
Conservative AABB enclosing the box at both the start and end poses.
All 8 corners of the box are transformed into world space at each endpoint and the result is the union of the two world-space AABBs.
Sourcepub fn aabb_sampled(&self, n_samples: usize) -> ([f64; 3], [f64; 3])
pub fn aabb_sampled(&self, n_samples: usize) -> ([f64; 3], [f64; 3])
Conservative AABB including n_samples intermediate poses.
Sourcepub fn box_volume(&self) -> f64
pub fn box_volume(&self) -> f64
Volume of the box (static).
Sourcepub fn start_translation(&self) -> [f64; 3]
pub fn start_translation(&self) -> [f64; 3]
Translation at the start pose.
Sourcepub fn end_translation(&self) -> [f64; 3]
pub fn end_translation(&self) -> [f64; 3]
Translation at the end pose.
Sourcepub fn displacement(&self) -> [f64; 3]
pub fn displacement(&self) -> [f64; 3]
Displacement vector from start to end translation.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SweptBox
impl RefUnwindSafe for SweptBox
impl Send for SweptBox
impl Sync for SweptBox
impl Unpin for SweptBox
impl UnsafeUnpin for SweptBox
impl UnwindSafe for SweptBox
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.