pub struct SweptObb {
pub center_start: [f64; 3],
pub axes: [[f64; 3]; 3],
pub half_extents: [f64; 3],
pub displacement: [f64; 3],
}Expand description
An oriented bounding box swept linearly along a displacement vector.
The box is described by its centre, three orientation axes (rows of a 3×3 rotation matrix), and half-extents along each local axis. The swept volume is conservative: AABB of start + end OBB.
Fields§
§center_start: [f64; 3]OBB centre at the start.
axes: [[f64; 3]; 3]OBB orientation: three unit axis vectors.
half_extents: [f64; 3]Half-extents along each axis.
displacement: [f64; 3]Displacement vector (center_end = center_start + displacement).
Implementations§
Source§impl SweptObb
impl SweptObb
Sourcepub fn new(
center_start: [f64; 3],
axes: [[f64; 3]; 3],
half_extents: [f64; 3],
displacement: [f64; 3],
) -> Self
pub fn new( center_start: [f64; 3], axes: [[f64; 3]; 3], half_extents: [f64; 3], displacement: [f64; 3], ) -> Self
Create a new SweptObb.
Sourcepub fn center_end(&self) -> [f64; 3]
pub fn center_end(&self) -> [f64; 3]
Centre at the end of the sweep.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SweptObb
impl RefUnwindSafe for SweptObb
impl Send for SweptObb
impl Sync for SweptObb
impl Unpin for SweptObb
impl UnsafeUnpin for SweptObb
impl UnwindSafe for SweptObb
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.