FlyCameraOptions
Defined in: packages/wtc-gl/src/core/FlyCamera.ts:35
Options for creating a FlyCamera. Every property is optional.
Properties
| Property | Type | Description |
|---|---|---|
acceleration | number | How quickly the speed changes while a speed key is held, in units per second². Default the starting speed |
accelerationDecay | number | How quickly a boost or brake returns to speed once let go: the difference is scaled by e^(−accelerationDecay × seconds). Default 4 |
accelerationMode | boolean | Use 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 |
damping | number | How quickly turning dies away once let go: the rate is scaled by e^(−damping × seconds). Default 6 |
element | HTMLElement | The element that listens for pointer input. Default document.body |
enabled | boolean | Whether input steers the camera. It keeps flying either way. Default true |
holdDelay | number | The seconds a press is held before dragging steers, so clicks don't. Default 0.1 |
keys | Partial<FlyCameraKeys> | Keys to replace the defaults, by action. See FlyCameraKeys. |
keyTarget | EventTarget | What listens for key input. Default window |
maxReverseSpeed | number | The fastest it can reverse, holding down in accelerationMode. 0 stops it reversing. Default maxSpeed / 2 |
maxSpeed | number | The fastest that speeding up can go. Default speed * 10 |
rampTime | number | The seconds a held key takes to reach its full rate. Default 0.9 |
rollSpeed | number | The roll rate with a roll key held, in radians per second. Default 1 |
speed | number | The forward speed, in units per second. Default 1 |
stickRadius | number | The distance, in CSS pixels, a drag needs to turn at the full rate. Default 200 |
turnSpeed | number | The turn rate at full stick, or with a turn key held, in radians per second. Default 1 |