Trait BVol

Source
pub trait BVol {
    // Required methods
    fn get_aabb(&self) -> Aabb;
    fn culls_this_plane(&self, plane: &Vec4) -> bool;

    // Provided methods
    fn is_inside_frustum(&self, frustum: Frustum) -> bool { ... }
    fn coherent_test_is_volume_outside_frustum(
        &self,
        frustum: &Frustum,
        lpindex: u32,
    ) -> (bool, u32) { ... }
}
Expand description

Bounding volume trait.

Required Methods§

Source

fn get_aabb(&self) -> Aabb

Returns an AABB that contains the bounding volume.

Source

fn culls_this_plane(&self, plane: &Vec4) -> bool

Checks if the given bounding volume is culled by this plane.

Returns true if it does, false otherwise.

Provided Methods§

Source

fn is_inside_frustum(&self, frustum: Frustum) -> bool

Source

fn coherent_test_is_volume_outside_frustum( &self, frustum: &Frustum, lpindex: u32, ) -> (bool, u32)

Checks if bounding volume is outside the frustum “coherently”.

In order for a bounding volume to be inside the frustum, it must not be culled by any plane.

Coherence is provided by the lpindex argument, which should be the index of the first plane found that culls this volume, given as part of the return value of this function.

Returns true if the volume is outside the frustum, false otherwise.

Returns the index of first plane found that culls this volume, to cache and use later as a short circuit.

Implementors§