You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Background: I wrote my own Bounds struct, because I overlooked that collision-rs already has an Aabb3 that is just what I need (didn't associate bounding boxes with collision detection, so I ignored the lib...).
For a 'go-to' CG math wrapper I'd expect bounding boxes and perhaps also some other features of collision-rs.
The text was updated successfully, but these errors were encountered:
In my project the most useful collision test is (Ray, Aabb). I don't like the way collision-rs handles this case though, returning Option<Point3<f32>> instead of just Option<f32>.
match aabb.collide(ray){
ray::Collision::Hit(t)if t > 0.0 => {println!("Hit at distance {} from ray origin", t);let _pt = ray.pos + t * ray.dir;},
ray::Collision::Hit(_) => {println!("It's behind you!");},
ray::Collision::Miss => {},}
Background: I wrote my own
Bounds
struct, because I overlooked thatcollision-rs
already has anAabb3
that is just what I need (didn't associate bounding boxes with collision detection, so I ignored the lib...).For a 'go-to' CG math wrapper I'd expect bounding boxes and perhaps also some other features of
collision-rs
.The text was updated successfully, but these errors were encountered: