pub struct Frustum {
pub center: Vector,
pub radius: f32,
pub wfov: f32,
pub hfov: f32,
pub xrot: f32,
pub yrot: f32,
}
Expand description
Single-precision frustum
Fields
center: Vector
The center of the frustum
radius: f32
The radius of the frustum
wfov: f32
The fov in x
hfov: f32
the fov in y
xrot: f32
how much rotated from facing “straight forward” in x
yrot: f32
how much rotated from facing “straight forward” in y
Implementations
sourceimpl Frustum
impl Frustum
sourcepub fn new(
center: Vector,
radius: f32,
xrot: f32,
yrot: f32,
wfov: f32,
hfov: f32
) -> Frustum
pub fn new(
center: Vector,
radius: f32,
xrot: f32,
yrot: f32,
wfov: f32,
hfov: f32
) -> Frustum
Create a new viewing frustum.
center
- The center of the frustum cone.radius
- How far can you see?xrot
- Direction facing on x axis (radians).yrot
- Direction facing on y axis (radians).wfov
- The fov on the X axis (radians).hfov
- The fov on the Y axis (radians).
sourcepub fn collide_bbox(&self, bbox: BBox) -> bool
pub fn collide_bbox(&self, bbox: BBox) -> bool
sourcepub fn collide_bcube(&self, bcube: BCube) -> bool
pub fn collide_bcube(&self, bcube: BCube) -> bool
If viewing frustum collides with the bounding box.
sourcepub fn collide_point(&self, point: Vector) -> bool
pub fn collide_point(&self, point: Vector) -> bool
If viewing frustum collides with a point.
Trait Implementations
impl Copy for Frustum
impl StructuralPartialEq for Frustum
Auto Trait Implementations
impl RefUnwindSafe for Frustum
impl Send for Frustum
impl Sync for Frustum
impl Unpin for Frustum
impl UnwindSafe for Frustum
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more