import { EventDispatcher } from "three" ; /**
 * JSON representation of translation settings.
 */ export interface TranslationSettingsJSON { enabled : boolean ; sensitivity : number ; boostMultiplier : number ; damping : number ; } /**
 * Translation settings.
 */ export class TranslationSettings extends EventDispatcher { /**
     * Whether positional translation is enabled.
     */ private enabled : boolean ; /**
     * The translation sensitivity.
     */ private sensitivity : number ; /**
     * The translation boost multiplier.
     */ private boostMultiplier : number ; /**
     * The damping factor. Range is [0.0, +Infinity]. Set to 0 to disable.
     */ private damping : number ; /**
     * Constructs new translation settings.
     */ constructor ( ) { super ( ) ; this . enabled = true ; this . sensitivity = 1.0 ; this . boostMultiplier = 2.0 ; this . damping = 0.0 ; } return isEnabled ( ) { return this . enabled ; } param value setEnabled ( value ) { this . enabled = value ; this . dispatchEvent ( { type : "change" } ) ; } return getSensitivity ( ) { return this . sensitivity ; } param value setSensitivity ( value ) { this . sensitivity = value ; this . dispatchEvent ( { type : "change" } ) ; } return getBoostMultiplier ( ) { return this . boostMultiplier ; } param value setBoostMultiplier ( value ) { this . boostMultiplier = Math . max ( value , 1.0 ) ; this . dispatchEvent ( { type : "change" } ) ; } return getDamping ( ) { return this . damping ; } param value setDamping ( value ) { this . damping = value ; this . dispatchEvent ( { type : "change" } ) ; } param settings return copy ( settings ) { this . enabled = settings . isEnabled ( ) ; this . sensitivity = settings . getSensitivity ( ) ; this . boostMultiplier = settings . getBoostMultiplier ( ) ; this . damping = settings . getDamping ( ) ; return this ; } return clone ( ) { const clone = new TranslationSettings ( ) ; return clone . copy ( this ) ; } param json return fromJSON ( json ) { this . enabled = json . enabled ; this . sensitivity = json . sensitivity ; this . boostMultiplier = json . boostMultiplier ; this . damping = json . damping ; return this ; } toJSON ( ) { return { enabled : this . enabled , sensitivity : this . sensitivity , boostMultiplier : this . boostMultiplier , damping : this . damping } ; } }