Frustum

Struct Frustum 

Source
pub struct Frustum {
    pub planes: [Plane; 6],
    pub corners: [Vector3<f32>; 8],
}

Fields§

§planes: [Plane; 6]

0 - left, 1 - right, 2 - top, 3 - bottom, 4 - far, 5 - near

§corners: [Vector3<f32>; 8]

Implementations§

Source§

impl Frustum

Source

pub const LEFT: usize = 0usize

Source

pub const RIGHT: usize = 1usize

Source

pub const TOP: usize = 2usize

Source

pub const BOTTOM: usize = 3usize

Source

pub const FAR: usize = 4usize

Source

pub const NEAR: usize = 5usize

Source

pub fn from_view_projection_matrix(m: Matrix4<f32>) -> Option<Self>

Source

pub fn left(&self) -> &Plane

Source

pub fn right(&self) -> &Plane

Source

pub fn top(&self) -> &Plane

Source

pub fn bottom(&self) -> &Plane

Source

pub fn far(&self) -> &Plane

Source

pub fn near(&self) -> &Plane

Source

pub fn planes(&self) -> &[Plane]

Source

pub fn left_top_front_corner(&self) -> Vector3<f32>

Source

pub fn left_bottom_front_corner(&self) -> Vector3<f32>

Source

pub fn right_bottom_front_corner(&self) -> Vector3<f32>

Source

pub fn right_top_front_corner(&self) -> Vector3<f32>

Source

pub fn left_top_back_corner(&self) -> Vector3<f32>

Source

pub fn left_bottom_back_corner(&self) -> Vector3<f32>

Source

pub fn right_bottom_back_corner(&self) -> Vector3<f32>

Source

pub fn right_top_back_corner(&self) -> Vector3<f32>

Source

pub fn corners(&self) -> [Vector3<f32>; 8]

Source

pub fn near_plane_center(&self) -> Vector3<f32>

Source

pub fn far_plane_center(&self) -> Vector3<f32>

Source

pub fn view_direction(&self) -> Vector3<f32>

Source

pub fn center(&self) -> Vector3<f32>

Source

pub fn is_intersects_point_cloud(&self, points: &[Vector3<f32>]) -> bool

Source

pub fn is_intersects_aabb(&self, aabb: &AxisAlignedBoundingBox) -> bool

Source

pub fn is_intersects_aabb_offset( &self, aabb: &AxisAlignedBoundingBox, offset: Vector3<f32>, ) -> bool

Source

pub fn is_intersects_aabb_transform( &self, aabb: &AxisAlignedBoundingBox, transform: &Matrix4<f32>, ) -> bool

👎Deprecated since 0.29.0: this method does not handle all cases and could give weird results
Source

pub fn is_contains_point(&self, pt: Vector3<f32>) -> bool

Source

pub fn is_intersects_sphere(&self, p: Vector3<f32>, r: f32) -> bool

Trait Implementations§

Source§

impl Clone for Frustum

Source§

fn clone(&self) -> Frustum

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Frustum

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Frustum

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl PartialEq for Frustum

Source§

fn eq(&self, other: &Frustum) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for Frustum

Source§

impl StructuralPartialEq for Frustum

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

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

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Scalar for T
where T: 'static + Clone + PartialEq + Debug,