diff --git a/src/core/renderer/API.md b/src/core/renderer/API.md index d68cbce61..1d1da551a 100644 --- a/src/core/renderer/API.md +++ b/src/core/renderer/API.md @@ -85,7 +85,7 @@ Base class for all 3D Tiles content loaders. Handles fetching and parsing tile c ### .fetchOptions ```js -fetchOptions: Object +fetchOptions: Object = {} ``` Options passed to `fetch` when loading tile content. @@ -94,7 +94,7 @@ Options passed to `fetch` when loading tile content. ### .workingPath ```js -workingPath: string +workingPath: string = '' ``` Base URL used to resolve relative external URLs. @@ -348,17 +348,17 @@ are in use each frame and evicts unused items when the cache exceeds its size li ### .unloadPriorityCallback ```js -unloadPriorityCallback: ( a: any, b: any ) => number | null +unloadPriorityCallback: ( a: any, b: any ) => number | null = null ``` Comparator used to determine eviction order. Items that sort last are evicted first. -Defaults to `null` (eviction order is by last-used time). +When `null`, eviction order is by last-used time. ### .minSize ```js -minSize: number +minSize: number = 6000 ``` Minimum number of items to keep in the cache after eviction. @@ -367,7 +367,7 @@ Minimum number of items to keep in the cache after eviction. ### .maxSize ```js -maxSize: number +maxSize: number = 8000 ``` Maximum number of items before eviction is triggered. @@ -376,7 +376,7 @@ Maximum number of items before eviction is triggered. ### .minBytesSize ```js -minBytesSize: number +minBytesSize: number = ~322MB ``` Minimum total bytes to retain after eviction. @@ -387,7 +387,7 @@ Minimum total bytes to retain after eviction. ### .maxBytesSize ```js -maxBytesSize: number +maxBytesSize: number = ~430MB ``` Maximum total bytes before eviction is triggered. @@ -398,7 +398,7 @@ Maximum total bytes before eviction is triggered. ### .unloadPercent ```js -unloadPercent: number +unloadPercent: number = 0.05 ``` Fraction of excess items/bytes to unload per eviction pass. @@ -407,7 +407,7 @@ Fraction of excess items/bytes to unload per eviction pass. ### .autoMarkUnused ```js -autoMarkUnused: boolean +autoMarkUnused: boolean = true ``` If true, items are automatically marked as unused at the start of each eviction pass. @@ -551,7 +551,7 @@ returns whether tasks are queued or actively running ### .maxJobs ```js -maxJobs: number +maxJobs: number = 6 ``` Maximum number of jobs that can run concurrently. @@ -560,7 +560,7 @@ Maximum number of jobs that can run concurrently. ### .autoUpdate ```js -autoUpdate: boolean +autoUpdate: boolean = true ``` If true, job runs are automatically scheduled after `add` and after each job completes. @@ -569,11 +569,11 @@ If true, job runs are automatically scheduled after `add` and after each job com ### .priorityCallback ```js -priorityCallback: ( a: any, b: any ) => number | null +priorityCallback: ( a: any, b: any ) => number | null = null ``` Comparator used to sort queued items. Higher-priority items should sort last -(i.e. return positive when `itemA` should run before `itemB`). Defaults to `null`. +(i.e. return positive when `itemA` should run before `itemB`). ### .sort @@ -773,7 +773,7 @@ The loaded root tileset object, or null if not yet loaded. ### .fetchOptions ```js -fetchOptions: RequestInit +fetchOptions: RequestInit = {} ``` Options passed to `fetch` when loading tile and tileset resources. @@ -863,7 +863,7 @@ Loading and rendering statistics updated each frame. Fields: ### .errorTarget ```js -errorTarget: number +errorTarget: number = 16 ``` Target screen-space error in pixels to aim for when updating the geometry. Tiles will @@ -875,7 +875,7 @@ of the 3D Tiles specification for more information. ### .displayActiveTiles ```js -displayActiveTiles: boolean +displayActiveTiles: boolean = false ``` "Active tiles" are those that are loaded and available but not necessarily visible. @@ -888,7 +888,7 @@ camera view not accounted for by the tiles renderer. ### .maxDepth ```js -maxDepth: number +maxDepth: number = Infinity ``` Maximum depth in the tile hierarchy to traverse. Tiles deeper than this are skipped. @@ -897,7 +897,7 @@ Maximum depth in the tile hierarchy to traverse. Tiles deeper than this are skip ### .optimizedLoadStrategy ```js -optimizedLoadStrategy: boolean +optimizedLoadStrategy: boolean = false ``` **Experimental.** Enables an optimized tile loading strategy that loads only the tiles @@ -907,9 +907,6 @@ tiles to load first. Prevents visual gaps and flashing during camera movement. Based in part on [Cesium Native tile selection](https://cesium.com/learn/cesium-native/ref-doc/selection-algorithm-details.html). -Default is `false`, which uses the previous approach of loading all parent and sibling -tiles for guaranteed smooth transitions. - > [!WARNING] > Setting is currently incompatible with plugins that split tiles and on-the-fly generate and > dispose of child tiles including the `ImageOverlayPlugin` `enableTileSplitting` setting, @@ -919,7 +916,7 @@ tiles for guaranteed smooth transitions. ### .loadSiblings ```js -loadSiblings: boolean +loadSiblings: boolean = true ``` **Experimental.** When `true`, sibling tiles are loaded together to prevent gaps during @@ -933,7 +930,7 @@ Only applies when `optimizedLoadStrategy` is enabled. ### .loadAncestors ```js -loadAncestors: boolean +loadAncestors: boolean = false ``` **Experimental.** When `true`, ancestor tiles are queued for download and displayed as a @@ -947,7 +944,7 @@ Only applies when `optimizedLoadStrategy` is enabled. ### .maxTilesProcessed ```js -maxTilesProcessed: number +maxTilesProcessed: number = 250 ``` The number of tiles to process immediately when traversing the tile set to determine diff --git a/src/core/renderer/loaders/LoaderBase.js b/src/core/renderer/loaders/LoaderBase.js index 476892a2b..dbaf54513 100644 --- a/src/core/renderer/loaders/LoaderBase.js +++ b/src/core/renderer/loaders/LoaderBase.js @@ -10,12 +10,14 @@ export class LoaderBase { /** * Options passed to `fetch` when loading tile content. * @type {Object} + * @default {} */ this.fetchOptions = {}; /** * Base URL used to resolve relative external URLs. * @type {string} + * @default '' */ this.workingPath = ''; diff --git a/src/core/renderer/tiles/TilesRendererBase.js b/src/core/renderer/tiles/TilesRendererBase.js index b83701be2..a8e552df6 100644 --- a/src/core/renderer/tiles/TilesRendererBase.js +++ b/src/core/renderer/tiles/TilesRendererBase.js @@ -403,6 +403,7 @@ export class TilesRendererBase { /** * Options passed to `fetch` when loading tile and tileset resources. * @type {RequestInit} + * @default {} */ this.fetchOptions = {}; this.plugins = []; @@ -544,6 +545,7 @@ export class TilesRendererBase { * {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification#geometric-error geometric error section} * of the 3D Tiles specification for more information. * @type {number} + * @default 16 */ this.errorTarget = 16.0; this._errorThreshold = Infinity; @@ -555,12 +557,14 @@ export class TilesRendererBase { * Setting this to `true` keeps them in the scene so they can be rendered from an outside * camera view not accounted for by the tiles renderer. * @type {boolean} + * @default false */ this.displayActiveTiles = false; /** * Maximum depth in the tile hierarchy to traverse. Tiles deeper than this are skipped. * @type {number} + * @default Infinity */ this.maxDepth = Infinity; @@ -571,14 +575,12 @@ export class TilesRendererBase { * tiles to load first. Prevents visual gaps and flashing during camera movement. * * Based in part on {@link https://cesium.com/learn/cesium-native/ref-doc/selection-algorithm-details.html Cesium Native tile selection}. - * - * Default is `false`, which uses the previous approach of loading all parent and sibling - * tiles for guaranteed smooth transitions. * @warn Setting is currently incompatible with plugins that split tiles and on-the-fly generate and * dispose of child tiles including the `ImageOverlayPlugin` `enableTileSplitting` setting, * `QuantizedMeshPlugin`, & `ImageFormatPlugin` subclasses (XYZ, TMS, etc). Any tile sets * that share caches or queues must also use the same setting. * @type {boolean} + * @default false */ this.optimizedLoadStrategy = false; @@ -590,6 +592,7 @@ export class TilesRendererBase { * * Only applies when `optimizedLoadStrategy` is enabled. * @type {boolean} + * @default true */ this.loadSiblings = true; @@ -601,6 +604,7 @@ export class TilesRendererBase { * * Only applies when `optimizedLoadStrategy` is enabled. * @type {boolean} + * @default false */ this.loadAncestors = false; @@ -610,6 +614,7 @@ export class TilesRendererBase { * at once when a new tile set is available, while higher values process more tiles * immediately so data can be downloaded and displayed sooner. * @type {number} + * @default 250 */ this.maxTilesProcessed = 250; diff --git a/src/core/renderer/utilities/LRUCache.js b/src/core/renderer/utilities/LRUCache.js index 47e252c83..d90501e11 100644 --- a/src/core/renderer/utilities/LRUCache.js +++ b/src/core/renderer/utilities/LRUCache.js @@ -22,8 +22,9 @@ class LRUCache { /** * Comparator used to determine eviction order. Items that sort last are evicted first. - * Defaults to `null` (eviction order is by last-used time). + * When `null`, eviction order is by last-used time. * @type {UnloadPriorityCallback|null} + * @default null */ get unloadPriorityCallback() { @@ -60,12 +61,14 @@ class LRUCache { /** * Minimum number of items to keep in the cache after eviction. * @type {number} + * @default 6000 */ this.minSize = 6000; /** * Maximum number of items before eviction is triggered. * @type {number} + * @default 8000 */ this.maxSize = 8000; @@ -73,6 +76,7 @@ class LRUCache { * Minimum total bytes to retain after eviction. * @note Only works with three.js r166 or higher. * @type {number} + * @default ~322MB */ this.minBytesSize = 0.3 * GIGABYTE_BYTES; @@ -80,18 +84,21 @@ class LRUCache { * Maximum total bytes before eviction is triggered. * @note Only works with three.js r166 or higher. * @type {number} + * @default ~430MB */ this.maxBytesSize = 0.4 * GIGABYTE_BYTES; /** * Fraction of excess items/bytes to unload per eviction pass. * @type {number} + * @default 0.05 */ this.unloadPercent = 0.05; /** * If true, items are automatically marked as unused at the start of each eviction pass. * @type {boolean} + * @default true */ this.autoMarkUnused = true; diff --git a/src/core/renderer/utilities/PriorityQueue.js b/src/core/renderer/utilities/PriorityQueue.js index 8648f4801..c802364e7 100644 --- a/src/core/renderer/utilities/PriorityQueue.js +++ b/src/core/renderer/utilities/PriorityQueue.js @@ -60,10 +60,10 @@ export class PriorityQueue { /** * Callback used to schedule when to run jobs next, so more work doesn't happen in a - * single frame than there is time for. Defaults to `requestAnimationFrame`. Should be - * overridden in scenarios where `requestAnimationFrame` is not reliable, such as when - * running in WebXR. + * single frame than there is time for. Should be overridden in scenarios where + * `requestAnimationFrame` is not reliable, such as when running in WebXR. * @type {SchedulingCallback} + * @default requestAnimationFrame * @deprecated */ get schedulingCallback() { @@ -84,6 +84,7 @@ export class PriorityQueue { /** * Maximum number of jobs that can run concurrently. * @type {number} + * @default 6 */ this.maxJobs = 6; @@ -95,13 +96,15 @@ export class PriorityQueue { /** * If true, job runs are automatically scheduled after `add` and after each job completes. * @type {boolean} + * @default true */ this.autoUpdate = true; /** * Comparator used to sort queued items. Higher-priority items should sort last - * (i.e. return positive when `itemA` should run before `itemB`). Defaults to `null`. + * (i.e. return positive when `itemA` should run before `itemB`). * @type {PriorityCallback|null} + * @default null */ this.priorityCallback = null; diff --git a/src/three/plugins/API.md b/src/three/plugins/API.md index ad44bc574..26a5f7b56 100644 --- a/src/three/plugins/API.md +++ b/src/three/plugins/API.md @@ -709,7 +709,7 @@ order, and an unlit rendering mode. Color modes are available via the static ### .getDebugColor ```js -getDebugColor: ( val: number, target: Color ) => void +getDebugColor: ( val: number, target: Color ) => void = ( value, target ) => target.setRGB( value, value, value ) ``` Maps a normalized [0, 1] value to a `Color` for debug visualizations. Defaults to diff --git a/src/three/plugins/DebugTilesPlugin.js b/src/three/plugins/DebugTilesPlugin.js index 36b251ece..31012de8f 100644 --- a/src/three/plugins/DebugTilesPlugin.js +++ b/src/three/plugins/DebugTilesPlugin.js @@ -262,6 +262,7 @@ export class DebugTilesPlugin { * a black-to-white gradient. Replace with a custom function to use a different color * ramp. * @type {GetDebugColorCallback} + * @default ( value, target ) => target.setRGB( value, value, value ) */ this.getDebugColor = ( value, target ) => { diff --git a/src/three/renderer/API.md b/src/three/renderer/API.md index 8045c311d..f14388094 100644 --- a/src/three/renderer/API.md +++ b/src/three/renderer/API.md @@ -107,25 +107,25 @@ animation. Use `toggle()` to animate the transition. ### .orthographicPositionalZoom ```js -orthographicPositionalZoom: boolean +orthographicPositionalZoom: boolean = true ``` -When true, the orthographic camera position is offset backwards along the view direction so it does not clip into terrain. Default is true. +When true, the orthographic camera position is offset backwards along the view direction so it does not clip into terrain. ### .orthographicOffset ```js -orthographicOffset: number +orthographicOffset: number = 50 ``` -Distance the orthographic camera is pushed back when `orthographicPositionalZoom` is true. Default is 50. +Distance the orthographic camera is pushed back when `orthographicPositionalZoom` is true. ### .fixedPoint ```js -fixedPoint: Vector3 +fixedPoint: Vector3 = new Vector3() ``` World-space point that remains visually fixed during the transition. @@ -134,28 +134,28 @@ World-space point that remains visually fixed during the transition. ### .duration ```js -duration: number +duration: number = 200 ``` -Duration of the animated transition in milliseconds. Default is 200. +Duration of the animated transition in milliseconds. ### .autoSync ```js -autoSync: boolean +autoSync: boolean = true ``` -When true, cameras are synced automatically before each `update` call. Default is true. +When true, cameras are synced automatically before each `update` call. ### .easeFunction ```js -easeFunction: function +easeFunction: function = x => x ``` -Easing function applied to the raw transition alpha. Receives and returns a value in [0, 1]. Default is the identity function. +Easing function applied to the raw transition alpha. Receives and returns a value in [0, 1]. ### .constructor @@ -467,7 +467,7 @@ right-click-to-rotate, and optional damping/inertia. Works with any Three.js sce ### .enabled ```js -enabled: boolean +enabled: boolean = true ``` Whether the controls are active. When set to false, all input is ignored @@ -477,157 +477,157 @@ and inertia is cleared. ### .cameraRadius ```js -cameraRadius: number +cameraRadius: number = 5 ``` -Minimum camera distance above the surface in world units. Prevents clipping into terrain. Default is 5. +Minimum camera distance above the surface in world units. Prevents clipping into terrain. ### .rotationSpeed ```js -rotationSpeed: number +rotationSpeed: number = 1 ``` -Rotation sensitivity multiplier. Default is 1. +Rotation sensitivity multiplier. ### .minAltitude ```js -minAltitude: number +minAltitude: number = 0 ``` -Minimum camera angle above the horizon in radians. Default is 0. +Minimum camera angle above the horizon in radians. ### .maxAltitude ```js -maxAltitude: number +maxAltitude: number = 0.45 * Math.PI ``` -Maximum camera angle above the horizon in radians. Default is 0.45π. +Maximum camera angle above the horizon in radians. ### .minDistance ```js -minDistance: number +minDistance: number = 10 ``` -Minimum zoom distance in world units. Default is 10. +Minimum zoom distance in world units. ### .maxDistance ```js -maxDistance: number +maxDistance: number = Infinity ``` -Maximum zoom distance in world units. Default is Infinity. +Maximum zoom distance in world units. ### .minZoom ```js -minZoom: number +minZoom: number = 0 ``` -Minimum orthographic zoom level. Default is 0. +Minimum orthographic zoom level. ### .maxZoom ```js -maxZoom: number +maxZoom: number = Infinity ``` -Maximum orthographic zoom level. Default is Infinity. +Maximum orthographic zoom level. ### .zoomSpeed ```js -zoomSpeed: number +zoomSpeed: number = 1 ``` -Zoom sensitivity multiplier. Default is 1. +Zoom sensitivity multiplier. ### .adjustHeight ```js -adjustHeight: boolean +adjustHeight: boolean = true ``` -When true, the camera height is automatically adjusted to avoid clipping into the terrain. Default is true. +When true, the camera height is automatically adjusted to avoid clipping into the terrain. ### .enableDamping ```js -enableDamping: boolean +enableDamping: boolean = false ``` -When true, camera movements decelerate gradually after input ends. Default is false. +When true, camera movements decelerate gradually after input ends. ### .dampingFactor ```js -dampingFactor: number +dampingFactor: number = 0.15 ``` -Rate of inertia decay per frame when damping is enabled. Lower values produce longer coasting. Default is 0.15. +Rate of inertia decay per frame when damping is enabled. Lower values produce longer coasting. ### .fallbackPlane ```js -fallbackPlane: Plane +fallbackPlane: Plane = new Plane( UP, 0 ) ``` -Fallback plane used for drag/zoom when no scene geometry is hit. Default is the XZ plane (y=0). +Fallback plane used for drag/zoom when no scene geometry is hit. ### .useFallbackPlane ```js -useFallbackPlane: boolean +useFallbackPlane: boolean = true ``` -When true, the fallback plane is used when raycasting misses scene geometry. Default is true. +When true, the fallback plane is used when raycasting misses scene geometry. ### .enableFlight ```js -enableFlight: boolean +enableFlight: boolean = false ``` When true, enables keyboard flight: W/A/S/D and arrow keys move forward/back/strafe, Q/E move up/down, and Shift multiplies speed by `flightSpeedMultiplier`. Right-click or Shift+left-click enters free-look mode, rotating the camera in place without requiring a surface hit. Only -supported for perspective cameras. Default is false. +supported for perspective cameras. ### .flightSpeed ```js -flightSpeed: number +flightSpeed: number = 10 ``` -Base camera speed in world units per second during keyboard flight. Default is 10. +Base camera speed in world units per second during keyboard flight. ### .flightSpeedMultiplier ```js -flightSpeedMultiplier: number +flightSpeedMultiplier: number = 4 ``` -Speed multiplier applied when the fast key is held during flight. Default is 4. +Speed multiplier applied when the fast key is held during flight. ### .constructor @@ -775,25 +775,25 @@ The inverse of `ellipsoidFrame`. ### .nearMargin ```js -nearMargin: number +nearMargin: number = 0.25 ``` -Fraction of the near plane distance added as a buffer. Default is 0.25. +Fraction of the near plane distance added as a buffer. ### .farMargin ```js -farMargin: number +farMargin: number = 0 ``` -Fraction of the far plane distance added as a buffer. Default is 0. +Fraction of the far plane distance added as a buffer. ### .globeInertia ```js -globeInertia: Quaternion +globeInertia: Quaternion = new Quaternion() ``` Accumulated globe rotation inertia quaternion. Applied each frame when globe inertia is active. @@ -802,7 +802,7 @@ Accumulated globe rotation inertia quaternion. Applied each frame when globe ine ### .globeInertiaFactor ```js -globeInertiaFactor: number +globeInertiaFactor: number = 0 ``` Magnitude of the current globe rotation inertia. Decays to zero over time. @@ -811,16 +811,16 @@ Magnitude of the current globe rotation inertia. Decays to zero over time. ### .ellipsoid ```js -ellipsoid: Ellipsoid +ellipsoid: Ellipsoid = WGS84_ELLIPSOID ``` -The ellipsoid model used for surface interaction and up-direction calculation. Defaults to WGS84. +The ellipsoid model used for surface interaction and up-direction calculation. ### .ellipsoidGroup ```js -ellipsoidGroup: Group +ellipsoidGroup: Group = new Group() ``` The Three.js group whose world matrix defines the ellipsoid's coordinate frame. @@ -926,7 +926,7 @@ Add `tiles.group` to your scene and call `tiles.update()` each frame. ### .autoDisableRendererCulling ```js -autoDisableRendererCulling: boolean +autoDisableRendererCulling: boolean = true ``` If `true`, all tile meshes automatically have `frustumCulled` set to `false` since the @@ -948,12 +948,11 @@ tileset frame. ### .ellipsoid ```js -ellipsoid: Ellipsoid +ellipsoid: Ellipsoid = WGS84_ELLIPSOID ``` -The ellipsoid definition used for the tileset. Defaults to WGS84 and may be -overridden by the `3DTILES_ellipsoid` extension. Specified in the local frame of -`TilesRenderer.group`. +The ellipsoid definition used for the tileset. May be overridden by the +`3DTILES_ellipsoid` extension. Specified in the local frame of `TilesRenderer.group`. ### .cameras @@ -968,7 +967,7 @@ Array of cameras registered with this renderer. ### .manager ```js -manager: LoadingManager +manager: LoadingManager = new LoadingManager() ``` The `LoadingManager` used when loading tile geometry. diff --git a/src/three/renderer/controls/CameraTransitionManager.js b/src/three/renderer/controls/CameraTransitionManager.js index 7e37d147c..3b526a198 100644 --- a/src/three/renderer/controls/CameraTransitionManager.js +++ b/src/three/renderer/controls/CameraTransitionManager.js @@ -104,38 +104,44 @@ export class CameraTransitionManager extends EventDispatcher { // settings /** - * When true, the orthographic camera position is offset backwards along the view direction so it does not clip into terrain. Default is true. + * When true, the orthographic camera position is offset backwards along the view direction so it does not clip into terrain. * @type {boolean} + * @default true */ this.orthographicPositionalZoom = true; /** - * Distance the orthographic camera is pushed back when `orthographicPositionalZoom` is true. Default is 50. + * Distance the orthographic camera is pushed back when `orthographicPositionalZoom` is true. * @type {number} + * @default 50 */ this.orthographicOffset = 50; /** * World-space point that remains visually fixed during the transition. * @type {Vector3} + * @default new Vector3() */ this.fixedPoint = new Vector3(); /** - * Duration of the animated transition in milliseconds. Default is 200. + * Duration of the animated transition in milliseconds. * @type {number} + * @default 200 */ this.duration = 200; /** - * When true, cameras are synced automatically before each `update` call. Default is true. + * When true, cameras are synced automatically before each `update` call. * @type {boolean} + * @default true */ this.autoSync = true; /** - * Easing function applied to the raw transition alpha. Receives and returns a value in [0, 1]. Default is the identity function. + * Easing function applied to the raw transition alpha. Receives and returns a value in [0, 1]. * @type {Function} + * @default x => x */ this.easeFunction = x => x; diff --git a/src/three/renderer/controls/EnvironmentControls.js b/src/three/renderer/controls/EnvironmentControls.js index 38d2f5953..11ff11844 100644 --- a/src/three/renderer/controls/EnvironmentControls.js +++ b/src/three/renderer/controls/EnvironmentControls.js @@ -68,6 +68,7 @@ export class EnvironmentControls extends EventDispatcher { * Whether the controls are active. When set to false, all input is ignored * and inertia is cleared. * @type {boolean} + * @default true */ get enabled() { @@ -109,86 +110,100 @@ export class EnvironmentControls extends EventDispatcher { this._enabled = true; /** - * Minimum camera distance above the surface in world units. Prevents clipping into terrain. Default is 5. + * Minimum camera distance above the surface in world units. Prevents clipping into terrain. * @type {number} + * @default 5 */ this.cameraRadius = 5; /** - * Rotation sensitivity multiplier. Default is 1. + * Rotation sensitivity multiplier. * @type {number} + * @default 1 */ this.rotationSpeed = 1; /** - * Minimum camera angle above the horizon in radians. Default is 0. + * Minimum camera angle above the horizon in radians. * @type {number} + * @default 0 */ this.minAltitude = 0; /** - * Maximum camera angle above the horizon in radians. Default is 0.45π. + * Maximum camera angle above the horizon in radians. * @type {number} + * @default 0.45 * Math.PI */ this.maxAltitude = 0.45 * Math.PI; /** - * Minimum zoom distance in world units. Default is 10. + * Minimum zoom distance in world units. * @type {number} + * @default 10 */ this.minDistance = 10; /** - * Maximum zoom distance in world units. Default is Infinity. + * Maximum zoom distance in world units. * @type {number} + * @default Infinity */ this.maxDistance = Infinity; /** - * Minimum orthographic zoom level. Default is 0. + * Minimum orthographic zoom level. * @type {number} + * @default 0 */ this.minZoom = 0; /** - * Maximum orthographic zoom level. Default is Infinity. + * Maximum orthographic zoom level. * @type {number} + * @default Infinity */ this.maxZoom = Infinity; /** - * Zoom sensitivity multiplier. Default is 1. + * Zoom sensitivity multiplier. * @type {number} + * @default 1 */ this.zoomSpeed = 1; /** - * When true, the camera height is automatically adjusted to avoid clipping into the terrain. Default is true. + * When true, the camera height is automatically adjusted to avoid clipping into the terrain. * @type {boolean} + * @default true */ this.adjustHeight = true; /** - * When true, camera movements decelerate gradually after input ends. Default is false. + * When true, camera movements decelerate gradually after input ends. * @type {boolean} + * @default false */ this.enableDamping = false; /** - * Rate of inertia decay per frame when damping is enabled. Lower values produce longer coasting. Default is 0.15. + * Rate of inertia decay per frame when damping is enabled. Lower values produce longer coasting. * @type {number} + * @default 0.15 */ this.dampingFactor = 0.15; /** - * Fallback plane used for drag/zoom when no scene geometry is hit. Default is the XZ plane (y=0). + * Fallback plane used for drag/zoom when no scene geometry is hit. * @type {Plane} + * @default new Plane( UP, 0 ) */ this.fallbackPlane = new Plane( new Vector3( 0, 1, 0 ), 0 ); /** - * When true, the fallback plane is used when raycasting misses scene geometry. Default is true. + * When true, the fallback plane is used when raycasting misses scene geometry. * @type {boolean} + * @default true */ this.useFallbackPlane = true; @@ -196,20 +211,23 @@ export class EnvironmentControls extends EventDispatcher { * When true, enables keyboard flight: W/A/S/D and arrow keys move forward/back/strafe, Q/E move * up/down, and Shift multiplies speed by `flightSpeedMultiplier`. Right-click or Shift+left-click * enters free-look mode, rotating the camera in place without requiring a surface hit. Only - * supported for perspective cameras. Default is false. + * supported for perspective cameras. * @type {boolean} + * @default false */ this.enableFlight = false; /** - * Base camera speed in world units per second during keyboard flight. Default is 10. + * Base camera speed in world units per second during keyboard flight. * @type {number} + * @default 10 */ this.flightSpeed = 10; /** - * Speed multiplier applied when the fast key is held during flight. Default is 4. + * Speed multiplier applied when the fast key is held during flight. * @type {number} + * @default 4 */ this.flightSpeedMultiplier = 4; diff --git a/src/three/renderer/controls/GlobeControls.js b/src/three/renderer/controls/GlobeControls.js index 99a562463..506e7084a 100644 --- a/src/three/renderer/controls/GlobeControls.js +++ b/src/three/renderer/controls/GlobeControls.js @@ -85,14 +85,16 @@ export class GlobeControls extends EnvironmentControls { this.maxZoom = 0.01; /** - * Fraction of the near plane distance added as a buffer. Default is 0.25. + * Fraction of the near plane distance added as a buffer. * @type {number} + * @default 0.25 */ this.nearMargin = 0.25; /** - * Fraction of the far plane distance added as a buffer. Default is 0. + * Fraction of the far plane distance added as a buffer. * @type {number} + * @default 0 */ this.farMargin = 0; this.useFallbackPlane = false; @@ -101,24 +103,28 @@ export class GlobeControls extends EnvironmentControls { /** * Accumulated globe rotation inertia quaternion. Applied each frame when globe inertia is active. * @type {Quaternion} + * @default new Quaternion() */ this.globeInertia = new Quaternion(); /** * Magnitude of the current globe rotation inertia. Decays to zero over time. * @type {number} + * @default 0 */ this.globeInertiaFactor = 0; /** - * The ellipsoid model used for surface interaction and up-direction calculation. Defaults to WGS84. + * The ellipsoid model used for surface interaction and up-direction calculation. * @type {Ellipsoid} + * @default WGS84_ELLIPSOID */ this.ellipsoid = WGS84_ELLIPSOID.clone(); /** * The Three.js group whose world matrix defines the ellipsoid's coordinate frame. * @type {Group} + * @default new Group() */ this.ellipsoidGroup = new Group(); this._ellipsoidFrameInverse = new Matrix4(); diff --git a/src/three/renderer/tiles/TilesRenderer.js b/src/three/renderer/tiles/TilesRenderer.js index 738578c12..e43eea0aa 100644 --- a/src/three/renderer/tiles/TilesRenderer.js +++ b/src/three/renderer/tiles/TilesRenderer.js @@ -57,6 +57,7 @@ export class TilesRenderer extends TilesRendererBase { * tiles renderer performs its own frustum culling. If `displayActiveTiles` is `true` or * multiple cameras are being used, consider setting this to `false`. * @type {boolean} + * @default true */ get autoDisableRendererCulling() { @@ -105,10 +106,10 @@ export class TilesRenderer extends TilesRendererBase { this.group = new TilesGroup( this ); /** - * The ellipsoid definition used for the tileset. Defaults to WGS84 and may be - * overridden by the `3DTILES_ellipsoid` extension. Specified in the local frame of - * `TilesRenderer.group`. + * The ellipsoid definition used for the tileset. May be overridden by the + * `3DTILES_ellipsoid` extension. Specified in the local frame of `TilesRenderer.group`. * @type {Ellipsoid} + * @default WGS84_ELLIPSOID */ this.ellipsoid = WGS84_ELLIPSOID.clone(); @@ -129,6 +130,7 @@ export class TilesRenderer extends TilesRendererBase { /** * The `LoadingManager` used when loading tile geometry. * @type {LoadingManager} + * @default new LoadingManager() */ this.manager = new LoadingManager(); diff --git a/utils/docs/RenderDocsUtils.js b/utils/docs/RenderDocsUtils.js index 9c8b43b27..b123de73b 100644 --- a/utils/docs/RenderDocsUtils.js +++ b/utils/docs/RenderDocsUtils.js @@ -265,7 +265,8 @@ export function renderMember( doc, callbackMap = {} ) { const type = formatType( doc.type, callbackMap ); const readonly = doc.readonly ? 'readonly ' : ''; - lines.push( `${ readonly }${ doc.name }: ${ type }` ); + const defaultStr = doc.defaultvalue !== undefined ? ` = ${ doc.defaultvalue }` : ''; + lines.push( `${ readonly }${ doc.name }: ${ type }${ defaultStr }` ); lines.push( '```' ); lines.push( '' );