Examples
import { PhysicsProperties, canCollide } from '@wimaengine/narrowphase'
const dynamic = new PhysicsProperties()
dynamic.invmass = 1
const staticBody = new PhysicsProperties()
canCollide(dynamic, staticBody) // trueFunction
canCollide(propA: PhysicsProperties, propB: PhysicsProperties): booleanChecks whether two bodies should proceed to narrowphase collision testing.
Both bodies must pass the bidirectional collision filter: propA.group must
overlap propB.mask, and propB.group must overlap propA.mask. At least
one body must have a non-zero inverse mass, and a pair is skipped when both
bodies are sleeping.
The helper reads the values from PhysicsProperties but does not
change either object or inspect the bodies’ Collider2D shapes. The
group and mask fields are expected to be compatible BigInt bit fields.
import { PhysicsProperties, canCollide } from '@wimaengine/narrowphase'
const dynamic = new PhysicsProperties()
dynamic.invmass = 1
const staticBody = new PhysicsProperties()
canCollide(dynamic, staticBody) // true