import { EventDispatcher } from "three" ; import { PointerBehaviour } from "../input" ; /**
 * JSON representation of pointer settings.
 */ export interface PointerSettingsJSON { behaviour : PointerBehaviour ; sensitivity : number ; } /**
 * Pointer settings.
 */ export class PointerSettings extends EventDispatcher { /**
     * The pointer behaviour.
     */ private behaviour : PointerBehaviour ; /**
     * The baseline pointer sensitivity.
     */ private sensitivity : number ; /**
     * Constructs new pointer settings.
     */ constructor ( ) { super ( ) ; this . behaviour = PointerBehaviour . DEFAULT ; this . sensitivity = 1e-3 ; } return getBehaviour ( ) { return this . behaviour ; } param value setBehaviour ( value ) { this . behaviour = value ; this . dispatchEvent ( { type : "change" } ) ; } return getSensitivity ( ) { return this . sensitivity ; } param value setSensitivity ( value ) { this . sensitivity = value ; this . dispatchEvent ( { type : "change" } ) ; } param settings return copy ( settings ) { this . behaviour = settings . getBehaviour ( ) ; this . sensitivity = settings . getSensitivity ( ) ; return this ; } return clone ( ) { const clone = new PointerSettings ( ) ; return clone . copy ( this ) ; } param json return fromJSON ( json ) { this . behaviour = json . behaviour ; this . sensitivity = json . sensitivity ; return this ; } toJSON ( ) { return { behaviour : this . behaviour , sensitivity : this . sensitivity } ; } }