@ferret/physics-impact
elastic and inelastic collisions, rest thresholds, sticking, impact events.
Read the guide: how to use it →
Functions
impact function
function impact(): Capabilitypackages/physics-impact/src/index.ts:37
Interfaces
ImpactEvent interface
interface ImpactEventa: Body | |
b: Body | |
entityA?: unknown | |
entityB?: unknown | |
point: Vec3 | |
normal: Vec3 | |
impulse: number | normal impulse over the step, N·s |
speed: number | closing speed, m/s |
restitution: number | the restitution the hit was solved with (0 when below the threshold) |
energyLost: number | kinetic energy turned into heat and deformation, J: ½·μ·(1 − e²)·v² with the reduced mass μ |
stuck: boolean |
packages/physics-impact/src/index.ts:19
ImpactFalloff interface
interface ImpactFallofffrom: number | |
to: number | |
factor: number |
packages/physics-impact/src/kernels.ts:5
ImpactHookParams interface
interface ImpactHookParamsscoped: ScopedSnapshot | |
zones?: ZonesData |
packages/physics-impact/src/kernels.ts:6
Constants
IMPACT_DEFAULTS const
const IMPACT_DEFAULTS: { threshold: number | undefined; scale: number; falloff: ImpactFalloff | undefined; stick: boolean; minEventSpeed: number; }packages/physics-impact/src/index.ts:33