dampenRotation3D

View sourcedampenRotation3D(world: World): void

Damps the angular rotation of every matching 3D entity.

Damping3DPlugin 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 Angular3DDamping resource.

The query requires exactly Rotation3D. Before iterating, the system reads world.getResource(Angular3DDamping).value and calculates the multiplier 1 - value. It multiplies the queried rotation’s x, y, and z fields by that multiplier directly, so the Rotation3D component is mutated in place. The resource must exist; a missing resource causes resource lookup to throw.

Examples

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

app.registerSystem({
  schedule: AppSchedule.Update,
  system: dampenRotation3D
})
// Damping3DPlugin already installs this system and Angular3DDamping.

Parameters

NameDescriptionDefault
world

Update world containing Rotation3D and Angular3DDamping.

—