Skip to content

NgtsAdaptiveEvents

Credits: AdaptiveEvents from Drei

NgtsAdaptiveEvents is a port of Drei’s AdaptiveEvents which dynamically toggles event handling based on the canvas’ performance settings. When performance degrades, event handling is disabled to reduce computational overhead.

This is particularly useful when combined with NgtsAdaptiveDpr and controls that support the regress flag (like NgtsOrbitControls).

Usage

import { NgtsAdaptiveEvents } from 'angular-three-soba/performances';
<ngts-adaptive-events />

Example with Controls

<ngts-adaptive-dpr [pixelated]="true" />
<ngts-adaptive-events />
<ngts-orbit-controls [options]="{ regress: true }" />

When the camera is moving (regress is triggered), events are disabled to improve performance during the interaction.