pub struct Box {
pub min: Vec3,
pub max: Vec3,
}Fields§
§min: Vec3§max: Vec3Implementations§
Source§impl Box
impl Box
Sourcepub fn from_points(p1: Vec3, p2: Vec3) -> Self
pub fn from_points(p1: Vec3, p2: Vec3) -> Self
Box containing the two given points.
Sourcepub fn from_point(p: Vec3) -> Self
pub fn from_point(p: Vec3) -> Self
A box containing a single point.
pub fn size(&self) -> Vec3
pub fn center(&self) -> Vec3
pub fn contains_point(&self, p: Vec3) -> bool
pub fn contains_box(&self, other: &Box) -> bool
Sourcepub fn union_point(&mut self, p: Vec3)
pub fn union_point(&mut self, p: Vec3)
Expand in-place to include the given point.
Sourcepub fn transform(&self, t: &Mat3x4) -> Box
pub fn transform(&self, t: &Mat3x4) -> Box
Transform by axis-aligned affine transform (Mat3x4 * vec4(pt, 1)).
pub fn does_overlap_box(&self, other: &Box) -> bool
Sourcepub fn does_overlap_point_xy(&self, p: Vec3) -> bool
pub fn does_overlap_point_xy(&self, p: Vec3) -> bool
Does the given point project within the XY extent (including equality)?
pub fn is_finite(&self) -> bool
Trait Implementations§
Source§impl AddAssign<Vec3> for Box
impl AddAssign<Vec3> for Box
Source§fn add_assign(&mut self, shift: Vec3)
fn add_assign(&mut self, shift: Vec3)
Performs the
+= operation. Read moreimpl Copy for Box
Source§impl MulAssign<Vec3> for Box
impl MulAssign<Vec3> for Box
Source§fn mul_assign(&mut self, scale: Vec3)
fn mul_assign(&mut self, scale: Vec3)
Performs the
*= operation. Read moreimpl StructuralPartialEq for Box
Auto Trait Implementations§
impl Freeze for Box
impl RefUnwindSafe for Box
impl Send for Box
impl Sync for Box
impl Unpin for Box
impl UnsafeUnpin for Box
impl UnwindSafe for Box
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