Skip to content

ContactCandidate

Defined in: physics/src/types.ts:274

A candidate contact pair, seen from one collider’s side, before any contact exists. Passed to a ContactFilter — no contact normal or contact point is available at this stage, only positions and velocities.

All values are from the start of the physics step being computed, before this step’s movement is applied — for a body that crossed a surface mid-step, they tell you which side it came from.

The same object instance is reused for every filter call; read what you need inside the filter and do not hold a reference to it.

readonly dt: number

Defined in: physics/src/types.ts:284

Duration of the physics step being computed, in seconds.


readonly other: Entity

Defined in: physics/src/types.ts:276

The other entity in the candidate pair.


readonly otherCollider: ColliderComponent

Defined in: physics/src/types.ts:278

The other entity’s collider component.


readonly otherRotation: number

Defined in: physics/src/types.ts:300

Other collider’s world rotation in radians.


readonly otherShapeIndex: number

Defined in: physics/src/types.ts:282

Index of the other participating shape in its collider component.


readonly otherVelocityX: number

Defined in: physics/src/types.ts:302

Other body’s X velocity in pixels/s.


readonly otherVelocityY: number

Defined in: physics/src/types.ts:304

Other body’s Y velocity in pixels/s.


readonly otherX: number

Defined in: physics/src/types.ts:296

Other collider’s world X position in pixels.


readonly otherY: number

Defined in: physics/src/types.ts:298

Other collider’s world Y position in pixels.


readonly selfRotation: number

Defined in: physics/src/types.ts:290

Own collider’s world rotation in radians.


readonly selfShapeIndex: number

Defined in: physics/src/types.ts:280

Index of this participating shape in its collider component.


readonly selfVelocityX: number

Defined in: physics/src/types.ts:292

Own body’s X velocity in pixels/s.


readonly selfVelocityY: number

Defined in: physics/src/types.ts:294

Own body’s Y velocity in pixels/s.


readonly selfX: number

Defined in: physics/src/types.ts:286

Own collider’s world X position in pixels.


readonly selfY: number

Defined in: physics/src/types.ts:288

Own collider’s world Y position in pixels.