PointerWheel

View source

Captures the wheel data emitted by a browser wheel event.

The DOM pointer bridge identifies wheel input as a mouse event, stores the event’s local offset as Vector2 position, and stores the browser’s three-dimensional wheel delta in a Vector3.

Examples

const wheel = new PointerWheel(event)
if (wheel.pointerType === 'mouse') console.log(wheel.delta)

Constructor


constructor(event: WheelEvent)

View source

Sets pointerType to mouse, maps the event offsets to position, and creates delta from the event’s three wheel-axis values.

Parameters

NameDescriptionDefault
event

Browser wheel event to capture.

—

Properties


readonlyposition: Vector2

View source

Local wheel coordinates copied from offsetX and offsetY.

Default: ...

readonlydelta: Vector3

View source

Wheel movement copied from deltaX, deltaY, and deltaZ.