drawContacts

View sourcedrawContacts(world: World): void

Draws white markers for the current contact points in Contacts.

Physics2DDebuggerPlugin registers this exact function directly in the repeating AppSchedule.Update schedule when its drawContacts option is enabled. The system reads each manifold’s contactData.contactPoints and uses CollisionData#contactNo to decide whether to draw the second point. The first contact slot is always drawn; a second slot is drawn only when contactNo === 2. Each marker is a white filled arc with radius 5 from angle 0 to Math.PI, so the implementation draws semicircular markers, not full circles.

The main-window entity is found through EntityHandle and MainWindow, and its canvas is resolved through the Windows resource. The world must provide the Contacts and Windows resources and a main-window match. A missing canvas or unavailable 2D context causes an immediate return without drawing any contact markers.

Examples

import { AppSchedule } from '@wimaengine/core'
import { drawContacts } from '@wimaengine/physics'

app.registerSystem({
  schedule: AppSchedule.Update,
  system: drawContacts
})
// Physics2DDebuggerPlugin registers this when drawContacts is enabled.

Parameters

NameDescriptionDefault
world

World containing Contacts and the main window.

—