FERRETGame engine over Babylon.js
Ferret

@ferret/physics-impact

elastic and inelastic collisions, rest thresholds, sticking, impact events.

5 exports · source in packages/physics-impact/src

Functions

impact function

function impact(): Capability

packages/physics-impact/src/index.ts:37

Interfaces

ImpactEvent interface

interface ImpactEvent
a: Body
b: Body
entityA?: unknown
entityB?: unknown
point: Vec3
normal: Vec3
impulse: numbernormal impulse over the step, N·s
speed: numberclosing speed, m/s
restitution: numberthe restitution the hit was solved with (0 when below the threshold)
energyLost: numberkinetic 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 ImpactFalloff
from: number
to: number
factor: number

packages/physics-impact/src/kernels.ts:5

ImpactHookParams interface

interface ImpactHookParams
scoped: 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