pub struct Frustum {
pub planes: [Plane; 6],
pub corners: [Matrix<f32, Const<3>, Const<1>, ArrayStorage<f32, 3, 1>>; 8],
}
Fields§
§planes: [Plane; 6]
0 - left, 1 - right, 2 - top, 3 - bottom, 4 - far, 5 - near
corners: [Matrix<f32, Const<3>, Const<1>, ArrayStorage<f32, 3, 1>>; 8]
Implementations§
Source§impl Frustum
impl Frustum
pub const LEFT: usize = 0usize
pub const RIGHT: usize = 1usize
pub const TOP: usize = 2usize
pub const BOTTOM: usize = 3usize
pub const FAR: usize = 4usize
pub const NEAR: usize = 5usize
pub fn from_view_projection_matrix( m: Matrix<f32, Const<4>, Const<4>, ArrayStorage<f32, 4, 4>>, ) -> Option<Frustum>
pub fn left(&self) -> &Plane
pub fn right(&self) -> &Plane
pub fn top(&self) -> &Plane
pub fn bottom(&self) -> &Plane
pub fn far(&self) -> &Plane
pub fn near(&self) -> &Plane
pub fn planes(&self) -> &[Plane]
pub fn left_top_front_corner( &self, ) -> Matrix<f32, Const<3>, Const<1>, ArrayStorage<f32, 3, 1>>
pub fn left_bottom_front_corner( &self, ) -> Matrix<f32, Const<3>, Const<1>, ArrayStorage<f32, 3, 1>>
pub fn right_bottom_front_corner( &self, ) -> Matrix<f32, Const<3>, Const<1>, ArrayStorage<f32, 3, 1>>
pub fn right_top_front_corner( &self, ) -> Matrix<f32, Const<3>, Const<1>, ArrayStorage<f32, 3, 1>>
pub fn left_top_back_corner( &self, ) -> Matrix<f32, Const<3>, Const<1>, ArrayStorage<f32, 3, 1>>
pub fn left_bottom_back_corner( &self, ) -> Matrix<f32, Const<3>, Const<1>, ArrayStorage<f32, 3, 1>>
pub fn right_bottom_back_corner( &self, ) -> Matrix<f32, Const<3>, Const<1>, ArrayStorage<f32, 3, 1>>
pub fn right_top_back_corner( &self, ) -> Matrix<f32, Const<3>, Const<1>, ArrayStorage<f32, 3, 1>>
pub fn corners( &self, ) -> [Matrix<f32, Const<3>, Const<1>, ArrayStorage<f32, 3, 1>>; 8]
pub fn near_plane_center( &self, ) -> Matrix<f32, Const<3>, Const<1>, ArrayStorage<f32, 3, 1>>
pub fn far_plane_center( &self, ) -> Matrix<f32, Const<3>, Const<1>, ArrayStorage<f32, 3, 1>>
pub fn view_direction( &self, ) -> Matrix<f32, Const<3>, Const<1>, ArrayStorage<f32, 3, 1>>
pub fn center(&self) -> Matrix<f32, Const<3>, Const<1>, ArrayStorage<f32, 3, 1>>
pub fn is_intersects_point_cloud( &self, points: &[Matrix<f32, Const<3>, Const<1>, ArrayStorage<f32, 3, 1>>], ) -> bool
pub fn is_intersects_aabb(&self, aabb: &AxisAlignedBoundingBox) -> bool
pub fn is_intersects_aabb_offset( &self, aabb: &AxisAlignedBoundingBox, offset: Matrix<f32, Const<3>, Const<1>, ArrayStorage<f32, 3, 1>>, ) -> bool
pub fn is_intersects_aabb_transform( &self, aabb: &AxisAlignedBoundingBox, transform: &Matrix<f32, Const<4>, Const<4>, ArrayStorage<f32, 4, 4>>, ) -> bool
👎Deprecated since 0.29.0: this method does not handle all cases and could give weird results
pub fn is_contains_point( &self, pt: Matrix<f32, Const<3>, Const<1>, ArrayStorage<f32, 3, 1>>, ) -> bool
pub fn is_intersects_sphere( &self, p: Matrix<f32, Const<3>, Const<1>, ArrayStorage<f32, 3, 1>>, r: f32, ) -> bool
Trait Implementations§
Source§impl Visit for Frustum
impl Visit for Frustum
Source§fn visit(&mut self, name: &str, visitor: &mut Visitor) -> Result<(), VisitError>
fn visit(&mut self, name: &str, visitor: &mut Visitor) -> Result<(), VisitError>
Read or write this value, depending on whether Visitor::is_reading() is true or false. Read more
impl Copy for Frustum
impl StructuralPartialEq for Frustum
Auto Trait Implementations§
impl Freeze for Frustum
impl RefUnwindSafe for Frustum
impl Send for Frustum
impl Sync for Frustum
impl Unpin for Frustum
impl UnwindSafe for Frustum
Blanket Implementations§
Source§impl<T> AsyncTaskResult for T
impl<T> AsyncTaskResult for T
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<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts self reference as a reference to
Any
. Could be used to downcast a trait object
to a particular type.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts self reference as a reference to
Any
. Could be used to downcast a trait object
to a particular type.fn into_any(self: Box<T>) -> Box<dyn Any>
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> FieldValue for Twhere
T: 'static,
impl<T> FieldValue for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> MessageData for T
impl<T> MessageData for T
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian()
.Source§impl<T> ScriptMessagePayload for T
impl<T> ScriptMessagePayload for T
Source§fn as_any_ref(&self) -> &(dyn Any + 'static)
fn as_any_ref(&self) -> &(dyn Any + 'static)
Returns
self
as &dyn Any
Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Returns
self
as &dyn Any
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.