pub struct HyperBox<const D: usize> {
pub half_extents: [f64; D],
}Expand description
D-dimensional axis-aligned box centered at the origin.
half_extents[i] is the half-width along axis i.
Total size along axis i = 2 * half_extents[i].
Fields§
§half_extents: [f64; D]Implementations§
Trait Implementations§
impl<const D: usize> Copy for HyperBox<D>
Source§impl<const D: usize> Shape<D> for HyperBox<D>
impl<const D: usize> Shape<D> for HyperBox<D>
Source§fn support(&self, direction: &SVector<f64, D>) -> SVector<f64, D>
fn support(&self, direction: &SVector<f64, D>) -> SVector<f64, D>
Support function: support(d)[i] = sign(d[i]) * half_extents[i].
O(D) — no vertex enumeration. For a 4D tesseract, this is 4 operations instead of 16 (the vertex count of a tesseract).
Source§fn bounding_sphere(&self) -> (Point<D>, f64)
fn bounding_sphere(&self) -> (Point<D>, f64)
Bounding sphere: (center, radius).
Auto Trait Implementations§
impl<const D: usize> Freeze for HyperBox<D>
impl<const D: usize> RefUnwindSafe for HyperBox<D>
impl<const D: usize> Send for HyperBox<D>
impl<const D: usize> Sync for HyperBox<D>
impl<const D: usize> Unpin for HyperBox<D>
impl<const D: usize> UnsafeUnpin for HyperBox<D>
impl<const D: usize> UnwindSafe for HyperBox<D>
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.