dampenRotation2D

View sourcedampenRotation2D(world: World): void

Damps the angular rotation of every matching 2D entity.

Damping2DPlugin registers this exact function directly in the repeating AppSchedule.Update schedule. The registration does not specify a system group, so the schedule’s default group is used. The plugin also installs the required Angular2DDamping resource.

The query requires exactly Rotation2D. Before iterating, the system reads world.getResource(Angular2DDamping).value and calculates the multiplier 1 - value. It multiplies each rotation’s scalar value by that multiplier in place. The resource must exist; a missing resource causes resource lookup to throw.

Examples

import { AppSchedule } from '@wimaengine/core'
import { dampenRotation2D } from '@wimaengine/damping'

app.registerSystem({
  schedule: AppSchedule.Update,
  system: dampenRotation2D
})
// Damping2DPlugin already installs this system and Angular2DDamping.

Parameters

NameDescriptionDefault
world

Update world containing Rotation2D and Angular2DDamping.

—