collide-sphere 0.3.1

Sphere collider implementation for the collide crate
Documentation

Collide: Sphere

crates.io docs.rs

Sphere collider for the collide ecosystem. Dimension-generic (2D/3D/N-D).

The simplest and most efficient collider type: center + radius. Collision detection is a single distance check. Use dedicated sphere-only collision layers for optimal performance compared to more general types like capsules or convex shapes.

Usage

use collide::Collider;
use collide_sphere::Sphere;

let a = Sphere::new(center_a, 1.0);
let b = Sphere::new(center_b, 1.5);

if a.check_collision(&b) {
    let info = a.collision_info(&b).unwrap();
}

Features

  • ray — enables Collider<Ray> for ray intersection support