box3d_rust/geometry/
mod.rs1mod capsule;
17mod sphere;
18pub(crate) mod types;
19
20pub use capsule::{
21 collide_mover_and_capsule, compute_capsule_aabb, compute_capsule_mass,
22 compute_swept_capsule_aabb, overlap_capsule, ray_cast_capsule, shape_cast_capsule,
23};
24pub use sphere::{
25 collide_mover_and_sphere, compute_sphere_aabb, compute_sphere_mass, compute_swept_sphere_aabb,
26 overlap_sphere, ray_cast_hollow_sphere, ray_cast_sphere, shape_cast_sphere,
27};
28pub use types::{
29 default_surface_material, Capsule, CollisionPlane, MassData, PlaneResult, PlaneSolverResult,
30 RayCastInput, ShapeCastInput, ShapeExtent, ShapeType, Sphere, SurfaceMaterial,
31 SURFACE_MATERIAL_SIZE,
32};
33
34pub use crate::distance::CastOutput;
35pub use crate::hull::{
36 collide_mover_and_hull, compute_hull_aabb, compute_hull_mass, compute_swept_hull_aabb,
37 overlap_hull, ray_cast_hull, shape_cast_hull,
38};
39
40use crate::constants::huge;
41use crate::math_functions::{is_valid_float, is_valid_vec3};
42
43pub fn is_valid_ray(input: &RayCastInput) -> bool {
45 is_valid_vec3(input.origin)
46 && is_valid_vec3(input.translation)
47 && is_valid_float(input.max_fraction)
48 && 0.0 <= input.max_fraction
49 && input.max_fraction < huge()
50}