phyz-collision
GJK/EPA collision detection for phyz.
Narrow-phase distance and penetration between convex shapes, plus a sweep-and-prune broad phase.
| Function | Purpose |
|---|---|
gjk_distance, gjk_distance_rot |
separating distance between disjoint convex shapes |
epa_penetration, epa_penetration_rot |
penetration depth and normal when they overlap |
sweep_and_prune |
broad-phase AABB pair pruning |
Shapes are described by Geometry (Sphere, Capsule, Box, Cylinder,
Mesh, Plane) and bounded by AABB. Results come back as Collision
records that phyz-contact turns into forces.
Example
use ;
use Vec3;
let a = Sphere ;
let b = Sphere ;
let d = gjk_distance;
// Broad phase over a set of AABBs.
let boxes = vec!;
let pairs = sweep_and_prune;
Part of phyz
phyz is an open-source differentiable
multi-physics simulation workspace in pure Rust. Each crate is independent —
adding this one does not pull in the rest.
Licensed under MIT.