Skip to content

Core

FlyCameraOptions ​

Defined in: packages/wtc-gl/src/core/FlyCamera.ts:35

Options for creating a FlyCamera. Every property is optional.

Properties ​

PropertyTypeDescription
accelerationnumberHow quickly the speed changes while a speed key is held, in units per second². Default the starting speed
accelerationDecaynumberHow quickly a boost or brake returns to speed once let go: the difference is scaled by e^(−accelerationDecay × seconds). Default 4
accelerationModebooleanUse the up and down keys (W, S and the arrows) to boost and brake instead of pitching: holding up speeds up, holding down slows to a stop and then reverses, and letting go returns quickly to speed. Dragging still pitches. Default false
dampingnumberHow quickly turning dies away once let go: the rate is scaled by e^(−damping × seconds). Default 6
elementHTMLElementThe element that listens for pointer input. Default document.body
enabledbooleanWhether input steers the camera. It keeps flying either way. Default true
holdDelaynumberThe seconds a press is held before dragging steers, so clicks don't. Default 0.1
keysPartial<FlyCameraKeys>Keys to replace the defaults, by action. See FlyCameraKeys.
keyTargetEventTargetWhat listens for key input. Default window
maxReverseSpeednumberThe fastest it can reverse, holding down in accelerationMode. 0 stops it reversing. Default maxSpeed / 2
maxSpeednumberThe fastest that speeding up can go. Default speed * 10
rampTimenumberThe seconds a held key takes to reach its full rate. Default 0.9
rollSpeednumberThe roll rate with a roll key held, in radians per second. Default 1
speednumberThe forward speed, in units per second. Default 1
stickRadiusnumberThe distance, in CSS pixels, a drag needs to turn at the full rate. Default 200
turnSpeednumberThe turn rate at full stick, or with a turn key held, in radians per second. Default 1