Struct vek::geom::repr_c::Rect3 [] [src]

pub struct Rect3<P, E> {
    pub x: P,
    pub y: P,
    pub z: P,
    pub w: E,
    pub h: E,
    pub d: E,
}

A Rect extended to 3D.

This would have been named Box, but it was "taken" by the standard library already.

You should probably use Aabb because it is less confusing.
See also Rect for a short discussion on the topic.

Fields

X position of the bottom-left-near corner.

Y position of the bottom-left-near corner.

Z position of the bottom-left-near corner.

Width.

Height, with Y axis going upwards.

Depth, with Z axis going forwards.

Methods

impl<P, E> Rect3<P, E>
[src]

[src]

Creates a new rectangle from position elements and extent elements.

[src]

Gets this rectangle's position.

[src]

Gets this rectangle's extent (size).

[src]

Gets this rectangle's position and extent (size).

[src]

Returns this rectangle, converted with the given closures (one for position elements, the other for extent elements).

impl<T> Rect3<T, T> where
    T: Copy + Add<T, Output = T>, 
[src]

[src]

Converts this into the matching axis-aligned bounding shape representation.

[src]

Does this rectangle contain the given point ?

[src]

Does this rectangle fully contain the given one ?

[src]

Does this rectangle collide with another ?

[src]

Gets this rectangle's center.

impl<T> Rect3<T, T> where
    T: Copy + PartialOrd + Sub<T, Output = T> + Add<T, Output = T>, 
[src]

[src]

Returns this shape so that it contains the given point.

[src]

Expands this shape so that it contains the given point.

[src]

Gets the smallest rectangle that contains both this one and another.

[src]

Gets the largest rectangle contained by both this one and another.

[src]

Sets this rectangle to the union of itself with another.

[src]

Sets this rectangle to the intersection of itself with another.

[src]

Gets a vector that tells how much self penetrates other.

[src]

Splits this shape in two, by a straight plane along the axis.
The returned tuple is (low, high).

Panics

sp is assumed to be a position along the axis that is within this shape's bounds.

[src]

Splits this shape in two, by a straight plane along the axis.
The returned tuple is (low, high).

Panics

sp is assumed to be a position along the axis that is within this shape's bounds.

[src]

Splits this shape in two, by a straight plane along the axis.
The returned tuple is (low, high).

Panics

sp is assumed to be a position along the axis that is within this shape's bounds.

Trait Implementations

impl<P: Debug, E: Debug> Debug for Rect3<P, E>
[src]

[src]

Formats the value using the given formatter.

impl<P: Default, E: Default> Default for Rect3<P, E>
[src]

[src]

Returns the "default value" for a type. Read more

impl<P: Clone, E: Clone> Clone for Rect3<P, E>
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl<P: Copy, E: Copy> Copy for Rect3<P, E>
[src]

impl<P: Hash, E: Hash> Hash for Rect3<P, E>
[src]

[src]

Feeds this value into the given [Hasher]. Read more

1.3.0
[src]

Feeds a slice of this type into the given [Hasher]. Read more

impl<P: Eq, E: Eq> Eq for Rect3<P, E>
[src]

impl<P: PartialEq, E: PartialEq> PartialEq for Rect3<P, E>
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

[src]

This method tests for !=.

impl<P, E> From<(Vec3<P>, Extent3<E>)> for Rect3<P, E>
[src]

[src]

Performs the conversion.

impl<T> From<Aabb<T>> for Rect3<T, T> where
    T: Copy + Sub<T, Output = T>, 
[src]

[src]

Performs the conversion.