Expand description
Geometric primitives and queries for rustsim.
This crate is intentionally tiny and dependency-free. It provides:
Vec2andVec3type aliases over[f64; 2]and[f64; 3]with free-function arithmetic in thevec2andvec3modules.- Axis-aligned bounding boxes
Aabb2,Aabb3. - Segments
Segment2,Segment3with closest-point queries. - Rays
Ray3and planesPlane3with ray-plane intersection. - Triangles
Triangle3with closest-point and ray-triangle intersection (Möller–Trumbore). - Spheres
Sphere3with sphere-vs-AABB / sphere-vs-triangle tests.
All functions are f64. No unsafe. No external crates. No allocation
in hot paths.
Re-exports§
pub use aabb::Aabb2;pub use aabb::Aabb3;pub use ray::Plane3;pub use ray::Ray3;pub use segment::Segment2;pub use segment::Segment3;pub use sphere::Sphere3;pub use triangle::Triangle3;pub use vec2::Vec2;pub use vec3::Vec3;
Modules§
- aabb
- Axis-aligned bounding boxes in 2-D and 3-D.
- prelude
- Convenience re-exports.
- ray
- Rays and planes in 3-D.
- segment
- Line segments in 2-D and 3-D with closest-point queries.
- sphere
- 3-D spheres with overlap tests.
- triangle
- 3-D triangles with closest-point and Möller–Trumbore ray intersection.
- vec2
- 2-D vector helpers.
- vec3
- 3-D vector helpers.