use-collision
One-dimensional collision, restitution, impulse, and kinetic-energy helpers for RustUse.
Install
[]
= "0.0.1"
Foundation
use-collision provides small, dependency-free helpers for scalar one-dimensional collision calculations.
Inputs are expected to be SI-style numeric values:
- kilograms for mass
- meters per second for velocity
- kilogram meters per second for momentum
- joules for kinetic energy
- newton-seconds for impulse
The coefficient of restitution is modeled as a scalar in [0.0, 1.0].
Example
use ;
let body_a = new.unwrap;
let body_b = new.unwrap;
let collision = new.unwrap;
assert_eq!;
assert_eq!;
When to use directly
Choose use-collision when you need small, reusable helpers for one-dimensional collision outcomes, restitution, collision impulse, and kinetic-energy changes.
Scope
- The crate focuses on scalar collision relations, coefficient of restitution, kinetic-energy changes, and impulse.
- Momentum and broader impulse utilities belong in
use-momentum. - Vector operations belong in
use-vector. - Simulation loops belong in top-level
use-simulation. - Rigid-body engines, contact solvers, vector mechanics, and game-physics systems are out of scope.
Status
use-collision is a pre-1.0 crate with a deliberately small API.