Class Controls<TEventMap>Abstract

Abstract base class for controls.

Type Parameters

  • TEventMap extends {}

Hierarchy (view full)

Constructors

Properties

domElement: null | HTMLElement

The HTML element used for event listeners. If not provided via the constructor, .connect must be called after domElement has been set.

enabled: boolean

When set to false, the controls will not respond to user input. Default is true.

The 3D object that is managed by the controls.

Methods

  • Adds a listener to an event type.

    Type Parameters

    • T extends string

    Parameters

    Returns void

  • Connects the controls to the DOM. This method has so called "side effects" since it adds the module's event listeners to the DOM.

    Returns void

  • Disconnects the controls from the DOM.

    Returns void

  • Fire an event type.

    Type Parameters

    • T extends string

    Parameters

    Returns void

  • Call this method if you no longer want use to the controls. It frees all internal resources and removes all event listeners.

    Returns void

  • Checks if listener is added to an event type.

    Type Parameters

    • T extends string

    Parameters

    Returns boolean

  • Removes a listener from an event type.

    Type Parameters

    • T extends string

    Parameters

    Returns void

  • Controls should implement this method if they have to update their internal state per simulation step.

    Parameters

    • delta: number

    Returns void