[][src]Struct arctk::geom::shape::cube::Cube

pub struct Cube { /* fields omitted */ }

Axis-aligned bounding box geometry. Used for spatial partitioning.

Implementations

impl Cube[src]

#[must_use]pub const fn mins(&self) -> &Pos3[src]

#[must_use]pub const fn maxs(&self) -> &Pos3[src]

#[must_use]pub fn new(mins: Pos3, maxs: Pos3) -> Self[src]

Construct a new instance.

#[must_use]pub fn new_centred(centre: &Pos3, hws: &Vec3) -> Self[src]

Construct a new axis-aligned bounding box centred on a given point with given half widths.

#[must_use]pub fn new_shrink(surfs: &[Mesh]) -> Self[src]

Initialise the boundary encompassing all of the mesh vertices.

#[must_use]pub const fn mins_maxs(&self) -> (Pos3, Pos3)[src]

Get mins and maxs together.

#[must_use]pub fn widths(&self) -> Vec3[src]

Calculate the widths.

#[must_use]pub fn half_widths(&self) -> Vec3[src]

Calculate the half-widths.

#[must_use]pub fn centre(&self) -> Pos3[src]

Calculate the centre position.

#[must_use]pub fn area(&self) -> f64[src]

Calculate the surface area.

#[must_use]pub fn vol(&self) -> f64[src]

Calculate the volume.

#[must_use]pub fn contains(&self, p: &Pos3) -> bool[src]

Determine if the given point if contained.

pub fn shrink(&mut self, f: f64)[src]

Shrink the aabb by a fraction of its lengths, maintaining the central position.

pub fn expand(&mut self, f: f64)[src]

Expand the aabb by a fraction of its lengths, maintaining the central position.

Trait Implementations

impl Clone for Cube[src]

impl Collide for Cube[src]

impl Debug for Cube[src]

impl<'de> Deserialize<'de> for Cube[src]

impl Load for Cube[src]

impl Trace for Cube[src]

Auto Trait Implementations

impl RefUnwindSafe for Cube

impl Send for Cube

impl Sync for Cube

impl Unpin for Cube

impl UnwindSafe for Cube

Blanket Implementations

impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S where
    D: AdaptFrom<S, Swp, Dwp, T>,
    Dwp: WhitePoint,
    Swp: WhitePoint,
    T: Component + Float
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Background for T[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T, U> ConvertInto<U> for T where
    U: ConvertFrom<T>, 
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> Foreground for T[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,