cgmath-culling

Crates.iocgmath-culling
lib.rscgmath-culling
version0.2.0
sourcesrc
created_at2018-04-30 17:10:33.853809
updated_at2018-05-01 00:05:33.34925
descriptionSmall Frustum Culling crate meant to be used alongside cgmath
homepagehttps://github.com/germangb/cgmath-culling.git
repositoryhttps://github.com/germangb/cgmath-culling.git
max_upload_size
id63181
size26,950
german gömez (germangb)

documentation

README

cgmath frustum culling

Build Status Package Downloads LICENSE

Small frustum culling crate meant to be used alongside the cgmath crate.

Usage

extern crate cgmath;
extern crate cgmath_culling;

use cgmath::{PerspectiveFov, Rad};
use cgmath_culling::{FrustumCuller, BoundingBox, Intersection as Int};

let per = PerspectiveFov { fovy: Rad(3.1415_f32 / 2.0),
                           aspect: 1.0,
                           near: 0.1,
                           far: 100.0 };

let culling = FrustumCuller::from_perspective_fov(per);
let bounding_box = BoundingBox::from_params(Vector3::new(0.0, 0.0, -7.0), Vector3::new(1.0, 1.0, -5.0));

match culling.test_bounding_box(bounding_box) {
    Intersection::Inside | Intersection::Partial => println!("I'm Inside!!!"),
    Intersection::Outside => println!("I'm Outside"),
}

License

MIT

Disclaimer

  • Reference implementation: JOML
Commit count: 28

cargo fmt