Struct vek::geom::repr_simd::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,
}
Expand description
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: P
X position of the bottom-left-near corner.
y: P
Y position of the bottom-left-near corner.
z: P
Z position of the bottom-left-near corner.
w: E
Width.
h: E
Height, with Y axis going upwards.
d: E
Depth, with Z axis going forwards.
Implementations
Creates a new rectangle from position elements and extent elements.
Gets this rectangle’s position and extent (size).
Returns this rectangle, converted with the given closures (one for position elements, the other for extent elements).
pub fn as_<DP, DE>(self) -> Rect3<DP, DE> where
P: AsPrimitive<DP>,
DP: 'static + Copy,
E: AsPrimitive<DE>,
DE: 'static + Copy,
pub fn as_<DP, DE>(self) -> Rect3<DP, DE> where
P: AsPrimitive<DP>,
DP: 'static + Copy,
E: AsPrimitive<DE>,
DE: 'static + Copy,
Converts this rectangle to a rectangle of another type, using the as
conversion.
Converts this into the matching axis-aligned bounding shape representation.
Does this rectangle contain the given point ?
Does this rectangle fully contain the given one ?
Does this rectangle collide with another ?
Returns this shape so that it contains the given point.
Expands this shape so that it contains the given point.
Gets the smallest rectangle that contains both this one and another.
Gets the largest rectangle contained by both this one and another.
Sets this rectangle to the union of itself with another.
Sets this rectangle to the intersection of itself with another.
pub fn collision_vector_with_rect3(self, other: Self) -> Vec3<T> where
T: One + Div<T, Output = T>,
pub fn collision_vector_with_rect3(self, other: Self) -> Vec3<T> where
T: One + Div<T, Output = T>,
Gets a vector that tells how much self
penetrates other
.
Splits this shape in two, by a straight plane along the
x
axis.
The returned tuple is (low, high)
.
Panics
sp
is assumed to be a position along the
x
axis that is within this shape’s bounds.
Splits this shape in two, by a straight plane along the
y
axis.
The returned tuple is (low, high)
.
Panics
sp
is assumed to be a position along the
y
axis that is within this shape’s bounds.
Splits this shape in two, by a straight plane along the
z
axis.
The returned tuple is (low, high)
.
Panics
sp
is assumed to be a position along the
z
axis that is within this shape’s bounds.
Trait Implementations
impl<'de, P, E> Deserialize<'de> for Rect3<P, E> where
P: Deserialize<'de>,
E: Deserialize<'de>,
impl<'de, P, E> Deserialize<'de> for Rect3<P, E> where
P: Deserialize<'de>,
E: Deserialize<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations
impl<P, E> RefUnwindSafe for Rect3<P, E> where
E: RefUnwindSafe,
P: RefUnwindSafe,
impl<P, E> UnwindSafe for Rect3<P, E> where
E: UnwindSafe,
P: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more