@thatopen/components 2.4.11 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (162) hide show
  1. package/README.md +92 -92
  2. package/dist/index.cjs +18440 -25937
  3. package/dist/index.d.ts +4537 -6
  4. package/dist/index.min.cjs +3 -3
  5. package/dist/index.min.mjs +3 -3
  6. package/dist/index.mjs +18442 -25939
  7. package/package.json +58 -60
  8. package/dist/core/Clipper/index.d.ts +0 -142
  9. package/dist/core/Clipper/src/clipper-config.d.ts +0 -33
  10. package/dist/core/Clipper/src/index.d.ts +0 -1
  11. package/dist/core/Clipper/src/simple-plane.d.ts +0 -99
  12. package/dist/core/Components/index.d.ts +0 -93
  13. package/dist/core/ConfigManager/index.d.ts +0 -21
  14. package/dist/core/ConfigManager/src/configurator.d.ts +0 -13
  15. package/dist/core/ConfigManager/src/index.d.ts +0 -1
  16. package/dist/core/Cullers/index.d.ts +0 -56
  17. package/dist/core/Cullers/src/culler-renderer-config.d.ts +0 -74
  18. package/dist/core/Cullers/src/culler-renderer.d.ts +0 -76
  19. package/dist/core/Cullers/src/index.d.ts +0 -3
  20. package/dist/core/Cullers/src/mesh-culler-renderer.d.ts +0 -59
  21. package/dist/core/Cullers/src/screen-culler-helper.d.ts +0 -1
  22. package/dist/core/Disposer/index.d.ts +0 -45
  23. package/dist/core/Grids/index.d.ts +0 -46
  24. package/dist/core/Grids/src/index.d.ts +0 -2
  25. package/dist/core/Grids/src/simple-grid-config.d.ts +0 -80
  26. package/dist/core/Grids/src/simple-grid.d.ts +0 -48
  27. package/dist/core/MiniMap/index.d.ts +0 -50
  28. package/dist/core/MiniMap/src/index.d.ts +0 -2
  29. package/dist/core/MiniMap/src/mini-map-config.d.ts +0 -112
  30. package/dist/core/MiniMap/src/mini-map.d.ts +0 -100
  31. package/dist/core/OrthoPerspectiveCamera/index.d.ts +0 -65
  32. package/dist/core/OrthoPerspectiveCamera/src/first-person-mode.d.ts +0 -16
  33. package/dist/core/OrthoPerspectiveCamera/src/index.d.ts +0 -5
  34. package/dist/core/OrthoPerspectiveCamera/src/orbit-mode.d.ts +0 -16
  35. package/dist/core/OrthoPerspectiveCamera/src/plan-mode.d.ts +0 -20
  36. package/dist/core/OrthoPerspectiveCamera/src/projections.d.ts +0 -45
  37. package/dist/core/OrthoPerspectiveCamera/src/types.d.ts +0 -26
  38. package/dist/core/Raycasters/index.d.ts +0 -43
  39. package/dist/core/Raycasters/src/index.d.ts +0 -2
  40. package/dist/core/Raycasters/src/mouse.d.ts +0 -24
  41. package/dist/core/Raycasters/src/simple-raycaster.d.ts +0 -54
  42. package/dist/core/ShadowedScene/index.d.ts +0 -57
  43. package/dist/core/ShadowedScene/src/distance-renderer.d.ts +0 -67
  44. package/dist/core/ShadowedScene/src/index.d.ts +0 -1
  45. package/dist/core/Types/index.d.ts +0 -1
  46. package/dist/core/Types/src/async-event.d.ts +0 -32
  47. package/dist/core/Types/src/base-camera.d.ts +0 -28
  48. package/dist/core/Types/src/base-renderer.d.ts +0 -65
  49. package/dist/core/Types/src/base-scene.d.ts +0 -25
  50. package/dist/core/Types/src/base-world-item.d.ts +0 -23
  51. package/dist/core/Types/src/base.d.ts +0 -19
  52. package/dist/core/Types/src/component-with-ui.d.ts +0 -18
  53. package/dist/core/Types/src/component.d.ts +0 -13
  54. package/dist/core/Types/src/config-types.d.ts +0 -47
  55. package/dist/core/Types/src/data-map.d.ts +0 -73
  56. package/dist/core/Types/src/data-set.d.ts +0 -58
  57. package/dist/core/Types/src/event-manager.d.ts +0 -30
  58. package/dist/core/Types/src/event.d.ts +0 -32
  59. package/dist/core/Types/src/index.d.ts +0 -15
  60. package/dist/core/Types/src/interfaces.d.ts +0 -117
  61. package/dist/core/Types/src/world.d.ts +0 -34
  62. package/dist/core/Viewpoints/index.d.ts +0 -38
  63. package/dist/core/Viewpoints/src/index.d.ts +0 -2
  64. package/dist/core/Viewpoints/src/types.d.ts +0 -36
  65. package/dist/core/Viewpoints/src/viewpoint.d.ts +0 -197
  66. package/dist/core/Viewpoints/src/viewpoints-config.d.ts +0 -23
  67. package/dist/core/Worlds/index.d.ts +0 -54
  68. package/dist/core/Worlds/src/index.d.ts +0 -5
  69. package/dist/core/Worlds/src/simple-camera.d.ts +0 -62
  70. package/dist/core/Worlds/src/simple-renderer.d.ts +0 -54
  71. package/dist/core/Worlds/src/simple-scene-config.d.ts +0 -59
  72. package/dist/core/Worlds/src/simple-scene.d.ts +0 -25
  73. package/dist/core/Worlds/src/simple-world.d.ts +0 -79
  74. package/dist/core/index.d.ts +0 -13
  75. package/dist/fragments/BoundingBoxer/index.d.ts +0 -208
  76. package/dist/fragments/Classifier/index.d.ts +0 -197
  77. package/dist/fragments/Exploder/index.d.ts +0 -50
  78. package/dist/fragments/FragmentsManager/index.d.ts +0 -152
  79. package/dist/fragments/Hider/index.d.ts +0 -38
  80. package/dist/fragments/IfcGeometryTiler/index.d.ts +0 -103
  81. package/dist/fragments/IfcGeometryTiler/src/base-types.d.ts +0 -29
  82. package/dist/fragments/IfcGeometryTiler/src/index.d.ts +0 -2
  83. package/dist/fragments/IfcGeometryTiler/src/streaming-settings.d.ts +0 -20
  84. package/dist/fragments/IfcLoader/index.d.ts +0 -116
  85. package/dist/fragments/IfcLoader/src/civil-reader.d.ts +0 -15
  86. package/dist/fragments/IfcLoader/src/ifc-fragment-settings.d.ts +0 -41
  87. package/dist/fragments/IfcLoader/src/ifc-metadata-reader.d.ts +0 -5
  88. package/dist/fragments/IfcLoader/src/index.d.ts +0 -5
  89. package/dist/fragments/IfcLoader/src/spatial-ids-finder.d.ts +0 -5
  90. package/dist/fragments/IfcLoader/src/spatial-structure.d.ts +0 -8
  91. package/dist/fragments/IfcLoader/src/transform-helper.d.ts +0 -5
  92. package/dist/fragments/IfcLoader/src/units.d.ts +0 -10
  93. package/dist/fragments/IfcPropertiesTiler/index.d.ts +0 -66
  94. package/dist/fragments/IfcPropertiesTiler/src/index.d.ts +0 -1
  95. package/dist/fragments/IfcPropertiesTiler/src/streaming-settings.d.ts +0 -11
  96. package/dist/fragments/index.d.ts +0 -8
  97. package/dist/ifc/IfcFinder/index.d.ts +0 -50
  98. package/dist/ifc/IfcFinder/src/ifc-basic-query.d.ts +0 -35
  99. package/dist/ifc/IfcFinder/src/ifc-finder-query.d.ts +0 -96
  100. package/dist/ifc/IfcFinder/src/ifc-property-query.d.ts +0 -36
  101. package/dist/ifc/IfcFinder/src/ifc-query-group.d.ts +0 -69
  102. package/dist/ifc/IfcFinder/src/index.d.ts +0 -4
  103. package/dist/ifc/IfcFinder/src/types.d.ts +0 -84
  104. package/dist/ifc/IfcIsolator/index.d.ts +0 -24
  105. package/dist/ifc/IfcJsonExporter/index.d.ts +0 -26
  106. package/dist/ifc/IfcJsonExporter/src/ifc-geometry-types.d.ts +0 -4
  107. package/dist/ifc/IfcJsonExporter/src/index.d.ts +0 -1
  108. package/dist/ifc/IfcPropertiesManager/index.d.ts +0 -289
  109. package/dist/ifc/IfcPropertiesManager/src/index.d.ts +0 -3
  110. package/dist/ifc/IfcPropertiesManager/src/rel-attrs.d.ts +0 -7
  111. package/dist/ifc/IfcPropertiesManager/src/rel-names.d.ts +0 -3
  112. package/dist/ifc/IfcPropertiesManager/src/types.d.ts +0 -18
  113. package/dist/ifc/IfcRelationsIndexer/index.d.ts +0 -195
  114. package/dist/ifc/IfcRelationsIndexer/src/index.d.ts +0 -2
  115. package/dist/ifc/IfcRelationsIndexer/src/newVersion.d.ts +0 -51
  116. package/dist/ifc/IfcRelationsIndexer/src/relToAttributesMap.d.ts +0 -5
  117. package/dist/ifc/IfcRelationsIndexer/src/types.d.ts +0 -73
  118. package/dist/ifc/Utils/ifc-categories.d.ts +0 -7
  119. package/dist/ifc/Utils/ifc-category-case.d.ts +0 -3
  120. package/dist/ifc/Utils/ifc-category-map.d.ts +0 -6
  121. package/dist/ifc/Utils/ifc-elements-map.d.ts +0 -11
  122. package/dist/ifc/Utils/index.d.ts +0 -5
  123. package/dist/ifc/Utils/properties-utils.d.ts +0 -25
  124. package/dist/ifc/index.d.ts +0 -6
  125. package/dist/measurement/MeasurementUtils/index.d.ts +0 -105
  126. package/dist/measurement/index.d.ts +0 -1
  127. package/dist/namespace.d.ts +0 -6018
  128. package/dist/openbim/BCFTopics/index.d.ts +0 -114
  129. package/dist/openbim/BCFTopics/src/Comment.d.ts +0 -40
  130. package/dist/openbim/BCFTopics/src/Topic.d.ts +0 -127
  131. package/dist/openbim/BCFTopics/src/bcf-topics-config.d.ts +0 -121
  132. package/dist/openbim/BCFTopics/src/importers/extensions.d.ts +0 -2
  133. package/dist/openbim/BCFTopics/src/importers/index.d.ts +0 -1
  134. package/dist/openbim/BCFTopics/src/index.d.ts +0 -5
  135. package/dist/openbim/BCFTopics/src/types.d.ts +0 -19
  136. package/dist/openbim/IDSSpecifications/index.d.ts +0 -60
  137. package/dist/openbim/IDSSpecifications/src/Specification.d.ts +0 -40
  138. package/dist/openbim/IDSSpecifications/src/exporters/parameter.d.ts +0 -2
  139. package/dist/openbim/IDSSpecifications/src/facets/Attribute.d.ts +0 -13
  140. package/dist/openbim/IDSSpecifications/src/facets/Classification.d.ts +0 -21
  141. package/dist/openbim/IDSSpecifications/src/facets/Entity.d.ts +0 -15
  142. package/dist/openbim/IDSSpecifications/src/facets/Facet.d.ts +0 -26
  143. package/dist/openbim/IDSSpecifications/src/facets/Material.d.ts +0 -10
  144. package/dist/openbim/IDSSpecifications/src/facets/PartOf.d.ts +0 -26
  145. package/dist/openbim/IDSSpecifications/src/facets/Property.d.ts +0 -25
  146. package/dist/openbim/IDSSpecifications/src/facets/index.d.ts +0 -5
  147. package/dist/openbim/IDSSpecifications/src/importers/attribute.d.ts +0 -3
  148. package/dist/openbim/IDSSpecifications/src/importers/classification.d.ts +0 -3
  149. package/dist/openbim/IDSSpecifications/src/importers/entity.d.ts +0 -3
  150. package/dist/openbim/IDSSpecifications/src/importers/index.d.ts +0 -3
  151. package/dist/openbim/IDSSpecifications/src/importers/parameter.d.ts +0 -2
  152. package/dist/openbim/IDSSpecifications/src/importers/property.d.ts +0 -3
  153. package/dist/openbim/IDSSpecifications/src/index.d.ts +0 -3
  154. package/dist/openbim/IDSSpecifications/src/types.d.ts +0 -70
  155. package/dist/openbim/index.d.ts +0 -2
  156. package/dist/utils/bbox.d.ts +0 -7
  157. package/dist/utils/geometry.d.ts +0 -1
  158. package/dist/utils/index.d.ts +0 -6
  159. package/dist/utils/materials.d.ts +0 -4
  160. package/dist/utils/section-generator.d.ts +0 -31
  161. package/dist/utils/uuid.d.ts +0 -6
  162. package/dist/utils/vertex-picker.d.ts +0 -116
@@ -1,76 +0,0 @@
1
- import * as THREE from "three";
2
- import { Components } from "../../Components";
3
- import { AsyncEvent, Configurable, Event, World } from "../../Types";
4
- import { CullerRendererConfig, CullerRendererConfigManager } from "./culler-renderer-config";
5
- /**
6
- * A base renderer to determine visibility on screen.
7
- */
8
- export declare class CullerRenderer implements Configurable<CullerRendererConfigManager, CullerRendererConfig> {
9
- /** {@link Configurable.onSetup} */
10
- readonly onSetup: Event<unknown>;
11
- /** {@link Disposable.onDisposed} */
12
- readonly onDisposed: Event<string>;
13
- /**
14
- * Fires after making the visibility check to the meshes. It lists the
15
- * meshes that are currently visible, and the ones that were visible
16
- * just before but not anymore.
17
- */
18
- readonly onViewUpdated: Event<any> | AsyncEvent<any>;
19
- /**
20
- * Whether this renderer is active or not. If not, it won't render anything.
21
- */
22
- enabled: boolean;
23
- /**
24
- * Needs to check whether there are objects that need to be hidden or shown.
25
- * You can bind this to the camera movement, to a certain interval, etc.
26
- */
27
- needsUpdate: boolean;
28
- /** The components instance to which this renderer belongs. */
29
- components: Components;
30
- /** The render target used to render the visibility scene. */
31
- renderTarget: THREE.WebGLRenderTarget<THREE.Texture>;
32
- /**
33
- * The size of the buffer where the result of the visibility check is stored.
34
- */
35
- bufferSize: number;
36
- /**
37
- * The buffer when the result of the visibility check is stored.
38
- */
39
- buffer: Uint8Array;
40
- /**
41
- * Flag to indicate if the renderer shouldn't update the visibility.
42
- */
43
- preventUpdate: boolean;
44
- /** {@link Configurable.config} */
45
- config: CullerRendererConfigManager;
46
- /** {@link Configurable.isSetup} */
47
- isSetup: boolean;
48
- /** The world instance to which this renderer belongs. */
49
- readonly world: World;
50
- /** The THREE.js renderer used to make the visibility test. */
51
- readonly renderer: THREE.WebGLRenderer;
52
- protected _defaultConfig: CullerRendererConfig;
53
- protected readonly worker: Worker;
54
- protected readonly scene: THREE.Scene;
55
- private _availableColor;
56
- protected _isWorkerBusy: boolean;
57
- constructor(components: Components, world: World);
58
- /** {@link Disposable.dispose} */
59
- dispose(): void;
60
- /**
61
- * The function that the culler uses to reprocess the scene. Generally it's
62
- * better to call needsUpdate, but you can also call this to force it.
63
- * @param force if true, it will refresh the scene even if needsUpdate is
64
- * not true.
65
- */
66
- updateVisibility: (force?: boolean) => Promise<void>;
67
- setup(config?: Partial<CullerRendererConfig>): void;
68
- protected getAvailableColor(): {
69
- r: number;
70
- g: number;
71
- b: number;
72
- code: string;
73
- };
74
- protected increaseColor(): void;
75
- protected decreaseColor(): void;
76
- }
@@ -1,3 +0,0 @@
1
- export * from "./culler-renderer";
2
- export * from "./mesh-culler-renderer";
3
- export * from "./screen-culler-helper";
@@ -1,59 +0,0 @@
1
- import * as THREE from "three";
2
- import { CullerRenderer } from "./culler-renderer";
3
- import { Components } from "../../Components";
4
- import { Event, World, Disposable } from "../../Types";
5
- /**
6
- * A renderer to hide/show meshes depending on their visibility from the user's point of view.
7
- */
8
- export declare class MeshCullerRenderer extends CullerRenderer implements Disposable {
9
- /**
10
- * Event triggered when the visibility of meshes is updated.
11
- * Contains two sets: seen and unseen.
12
- */
13
- readonly onViewUpdated: Event<{
14
- seen: Set<THREE.Mesh>;
15
- unseen: Set<THREE.Mesh>;
16
- }>;
17
- /**
18
- * Map of color code to THREE.InstancedMesh.
19
- * Used to keep track of color-coded meshes.
20
- */
21
- colorMeshes: Map<string, THREE.InstancedMesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.InstancedMeshEventMap>>;
22
- /**
23
- * @deprecated use config.threshold instead.
24
- */
25
- get threshold(): number;
26
- /**
27
- * @deprecated use config.threshold instead.
28
- */
29
- set threshold(value: number);
30
- private _colorCodeMeshMap;
31
- private _meshIDColorCodeMap;
32
- private _currentVisibleMeshes;
33
- private _recentlyHiddenMeshes;
34
- private readonly _transparentMat;
35
- constructor(components: Components, world: World);
36
- /** {@link Disposable.dispose} */
37
- dispose(): void;
38
- /**
39
- * Adds a mesh to the culler. When the mesh is not visibile anymore, it will be removed from the scene. When it's visible again, it will be added to the scene.
40
- * @param mesh - The mesh to add. It can be a regular THREE.Mesh or an instance of THREE.InstancedMesh.
41
- */
42
- add(mesh: THREE.Mesh | THREE.InstancedMesh): void;
43
- /**
44
- * Removes a mesh from the culler, so its visibility is not controlled by the culler anymore.
45
- * When the mesh is removed, it will be hidden from the scene and its color-coded mesh will be destroyed.
46
- * @param mesh - The mesh to remove. It can be a regular THREE.Mesh or an instance of THREE.InstancedMesh.
47
- */
48
- remove(mesh: THREE.Mesh | THREE.InstancedMesh): void;
49
- /**
50
- * Updates the given instanced meshes inside the culler. You should use this if you change the count property, e.g. when changing the visibility of fragments.
51
- *
52
- * @param meshes - The meshes to update.
53
- *
54
- * @returns {void}
55
- */
56
- updateInstanced(meshes: Iterable<THREE.InstancedMesh>): void;
57
- private handleWorkerMessage;
58
- private getAvailableMaterial;
59
- }
@@ -1 +0,0 @@
1
- export declare function readPixelsAsync(gl: WebGL2RenderingContext, x: number, y: number, w: number, h: number, format: any, type: any, dest: ArrayBufferView): Promise<ArrayBufferView>;
@@ -1,45 +0,0 @@
1
- import * as THREE from "three";
2
- import { Components } from "../Components";
3
- import { Component } from "../Types";
4
- /**
5
- * A tool to safely remove meshes, geometries, materials and other items from memory to [prevent memory leaks](https://threejs.org/docs/#manual/en/introduction/How-to-dispose-of-objects).
6
- */
7
- export declare class Disposer extends Component {
8
- private _disposedComponents;
9
- /** {@link Component.enabled} */
10
- enabled: boolean;
11
- /**
12
- * A unique identifier for the component.
13
- * This UUID is used to register the component within the Components system.
14
- */
15
- static readonly uuid: "76e9cd8e-ad8f-4753-9ef6-cbc60f7247fe";
16
- constructor(components: Components);
17
- /**
18
- * Return the UUIDs of all disposed components.
19
- */
20
- get(): Set<string>;
21
- /**
22
- * Removes a mesh, its geometry and its materials from memory. If you are
23
- * using any of these in other parts of the application, make sure that you
24
- * remove them from the mesh before disposing it.
25
- *
26
- * @param object - the [object](https://threejs.org/docs/#api/en/core/Object3D)
27
- * to remove.
28
- *
29
- * @param materials - whether to dispose the materials of the mesh.
30
- *
31
- * @param recursive - whether to recursively dispose the children of the mesh.
32
- */
33
- destroy(object: THREE.Object3D, materials?: boolean, recursive?: boolean): void;
34
- /**
35
- * Disposes a geometry from memory.
36
- *
37
- * @param geometry - the
38
- * [geometry](https://threejs.org/docs/#api/en/core/BufferGeometry)
39
- * to remove.
40
- */
41
- disposeGeometry(geometry: THREE.BufferGeometry): void;
42
- private disposeGeometryAndMaterials;
43
- private disposeChildren;
44
- private static disposeMaterial;
45
- }
@@ -1,46 +0,0 @@
1
- import { Component, Disposable, World, Event } from "../Types";
2
- import { SimpleGrid } from "./src";
3
- import { Components } from "../Components";
4
- export * from "./src";
5
- /**
6
- * A component that manages grid instances. Each grid is associated with a unique world. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/Grids). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/Grids).
7
- */
8
- export declare class Grids extends Component implements Disposable {
9
- /**
10
- * A unique identifier for the component.
11
- * This UUID is used to register the component within the Components system.
12
- */
13
- static readonly uuid: "d1e814d5-b81c-4452-87a2-f039375e0489";
14
- /**
15
- * A map of world UUIDs to their corresponding grid instances.
16
- */
17
- list: Map<string, SimpleGrid>;
18
- /** {@link Disposable.onDisposed} */
19
- readonly onDisposed: Event<unknown>;
20
- /** {@link Component.enabled} */
21
- enabled: boolean;
22
- constructor(components: Components);
23
- /**
24
- * Creates a new grid for the given world.
25
- * Throws an error if a grid already exists for the world.
26
- *
27
- * @param world - The world to create the grid for.
28
- * @returns The newly created grid.
29
- *
30
- * @throws Will throw an error if a grid already exists for the given world.
31
- */
32
- create(world: World): SimpleGrid;
33
- /**
34
- * Deletes the grid associated with the given world.
35
- * If a grid does not exist for the given world, this method does nothing.
36
- *
37
- * @param world - The world for which to delete the grid.
38
- *
39
- * @remarks
40
- * This method will dispose of the grid and remove it from the internal list.
41
- * If the world is disposed before calling this method, the grid will be automatically deleted.
42
- */
43
- delete(world: World): void;
44
- /** {@link Disposable.dispose} */
45
- dispose(): void;
46
- }
@@ -1,2 +0,0 @@
1
- export * from "./simple-grid";
2
- export * from "./simple-grid-config";
@@ -1,80 +0,0 @@
1
- import * as THREE from "three";
2
- import { BooleanSettingsControl, ColorSettingsControl, NumberSettingControl } from "../../Types";
3
- import { Configurator } from "../../ConfigManager";
4
- import { SimpleGrid } from "./simple-grid";
5
- type SimpleGridConfigType = {
6
- visible: BooleanSettingsControl;
7
- color: ColorSettingsControl;
8
- primarySize: NumberSettingControl;
9
- secondarySize: NumberSettingControl;
10
- distance: NumberSettingControl;
11
- };
12
- /**
13
- * Configuration interface for the {@link SimpleGrid}.
14
- */
15
- export interface SimpleGridConfig {
16
- /**
17
- * Whether the grid is visible or not.
18
- */
19
- visible: boolean;
20
- /**
21
- * The color of the grid lines.
22
- */
23
- color: THREE.Color;
24
- /**
25
- * The size of the primary grid lines.
26
- */
27
- primarySize: number;
28
- /**
29
- * The size of the secondary grid lines.
30
- */
31
- secondarySize: number;
32
- /**
33
- * The distance at which the grid lines start to fade away.
34
- */
35
- distance: number;
36
- }
37
- export declare class SimpleGridConfigManager extends Configurator<SimpleGrid, SimpleGridConfigType> {
38
- protected _config: SimpleGridConfigType;
39
- /**
40
- * Whether the grid is visible or not.
41
- */
42
- get visible(): boolean;
43
- /**
44
- * Whether the grid is visible or not.
45
- */
46
- set visible(value: boolean);
47
- /**
48
- * The color of the grid lines.
49
- */
50
- get color(): THREE.Color;
51
- /**
52
- * The color of the grid lines.
53
- */
54
- set color(value: THREE.Color);
55
- /**
56
- * The size of the primary grid lines.
57
- */
58
- get primarySize(): number;
59
- /**
60
- * The size of the primary grid lines.
61
- */
62
- set primarySize(value: number);
63
- /**
64
- * The size of the secondary grid lines.
65
- */
66
- get secondarySize(): number;
67
- /**
68
- * The size of the secondary grid lines.
69
- */
70
- set secondarySize(value: number);
71
- /**
72
- * The distance at which the grid lines start to fade away.
73
- */
74
- get distance(): number;
75
- /**
76
- * The distance at which the grid lines start to fade away.
77
- */
78
- set distance(value: number);
79
- }
80
- export {};
@@ -1,48 +0,0 @@
1
- import * as THREE from "three";
2
- import { Hideable, Event, World, Disposable, Configurable } from "../../Types";
3
- import { Components } from "../../Components";
4
- import { SimpleGridConfig, SimpleGridConfigManager } from "./simple-grid-config";
5
- /**
6
- * An infinite grid. Created by [fyrestar](https://github.com/Fyrestar/THREE.InfiniteGridHelper) and translated to typescript by [dkaraush](https://github.com/dkaraush/THREE.InfiniteGridHelper/blob/master/InfiniteGridHelper.ts).
7
- */
8
- export declare class SimpleGrid implements Hideable, Disposable, Configurable<SimpleGridConfigManager, SimpleGridConfig> {
9
- /** {@link Disposable.onDisposed} */
10
- readonly onDisposed: Event<unknown>;
11
- /** {@link Configurable.onSetup} */
12
- readonly onSetup: Event<unknown>;
13
- /** {@link Configurable.isSetup} */
14
- isSetup: boolean;
15
- /** The world instance to which this Raycaster belongs. */
16
- world: World;
17
- /** The components instance to which this grid belongs. */
18
- components: Components;
19
- /** {@link Configurable.config} */
20
- config: SimpleGridConfigManager;
21
- protected _defaultConfig: SimpleGridConfig;
22
- /** {@link Hideable.visible} */
23
- get visible(): boolean;
24
- /** {@link Hideable.visible} */
25
- set visible(visible: boolean);
26
- /** The material of the grid. */
27
- get material(): THREE.ShaderMaterial;
28
- /**
29
- * Whether the grid should fade away with distance. Recommended to be true for
30
- * perspective cameras and false for orthographic cameras.
31
- */
32
- get fade(): boolean;
33
- /**
34
- * Whether the grid should fade away with distance. Recommended to be true for
35
- * perspective cameras and false for orthographic cameras.
36
- */
37
- set fade(active: boolean);
38
- /** The Three.js mesh that contains the infinite grid. */
39
- readonly three: THREE.Mesh;
40
- private _fade;
41
- constructor(components: Components, world: World);
42
- /** {@link Configurable.setup} */
43
- setup(config?: Partial<SimpleGridConfig>): void;
44
- /** {@link Disposable.dispose} */
45
- dispose(): void;
46
- private setupEvents;
47
- private updateZoom;
48
- }
@@ -1,50 +0,0 @@
1
- import { MiniMap } from "./src";
2
- import { Component, Updateable, World, Event, Disposable } from "../Types";
3
- import { Components } from "../Components";
4
- export * from "./src";
5
- /**
6
- * A component that manages multiple {@link MiniMap} instances, each associated with a unique world ID. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/MiniMap). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/MiniMaps).
7
- */
8
- export declare class MiniMaps extends Component implements Updateable, Disposable {
9
- /**
10
- * A unique identifier for the component.
11
- * This UUID is used to register the component within the Components system.
12
- */
13
- static readonly uuid: "39ad6aad-84c8-4adf-a1e0-7f25313a9e7f";
14
- /** {@link Updateable.onAfterUpdate} */
15
- readonly onAfterUpdate: Event<unknown>;
16
- /** {@link Updateable.onBeforeUpdate} */
17
- readonly onBeforeUpdate: Event<unknown>;
18
- /** {@link Disposable.onDisposed} */
19
- readonly onDisposed: Event<unknown>;
20
- /** {@link Configurable.onSetup} */
21
- readonly onSetup: Event<unknown>;
22
- /** {@link Component.enabled} */
23
- enabled: boolean;
24
- /**
25
- * A collection of {@link MiniMap} instances, each associated with a unique world ID.
26
- */
27
- list: Map<string, MiniMap>;
28
- constructor(components: Components);
29
- /**
30
- * Creates a new {@link MiniMap} instance associated with the given world.
31
- * If a {@link MiniMap} instance already exists for the given world, an error will be thrown.
32
- *
33
- * @param world - The {@link World} for which to create a {@link MiniMap} instance.
34
- * @returns The newly created {@link MiniMap} instance.
35
- * @throws Will throw an error if a {@link MiniMap} instance already exists for the given world.
36
- */
37
- create(world: World): MiniMap;
38
- /**
39
- * Deletes a {@link MiniMap} instance associated with the given world ID.
40
- * If a {@link MiniMap} instance does not exist for the given ID, nothing happens.
41
- *
42
- * @param id - The unique identifier of the world for which to delete the {@link MiniMap} instance.
43
- * @returns {void}
44
- */
45
- delete(id: string): void;
46
- /** {@link Disposable.dispose} */
47
- dispose(): void;
48
- /** {@link Updateable.update} */
49
- update(): void;
50
- }
@@ -1,2 +0,0 @@
1
- export * from "./mini-map";
2
- export * from "./mini-map-config";
@@ -1,112 +0,0 @@
1
- import * as THREE from "three";
2
- import { BooleanSettingsControl, ColorSettingsControl, NumberSettingControl } from "../../Types";
3
- import { Configurator } from "../../ConfigManager";
4
- import { MiniMap } from "./index";
5
- type MiniMapConfigType = {
6
- visible: BooleanSettingsControl;
7
- lockRotation: BooleanSettingsControl;
8
- zoom: NumberSettingControl;
9
- frontOffset: NumberSettingControl;
10
- sizeX: NumberSettingControl;
11
- sizeY: NumberSettingControl;
12
- backgroundColor: ColorSettingsControl;
13
- };
14
- /**
15
- * Configuration interface for the {@link MiniMap}.
16
- */
17
- export interface MiniMapConfig {
18
- /**
19
- * Whether the minimap is visible or not.
20
- */
21
- visible: boolean;
22
- /**
23
- * Whether to lock the rotation of the top camera in the minimap.
24
- */
25
- lockRotation: boolean;
26
- /**
27
- * The zoom of the camera in the minimap.
28
- */
29
- zoom: number;
30
- /**
31
- * The front offset of the minimap.
32
- * It determines how much the minimap's view is offset from the camera's view.
33
- * By pushing the map to the front, what the user sees on screen corresponds with what they see on the map
34
- */
35
- frontOffset: number;
36
- /**
37
- * The horizontal dimension of the minimap.
38
- */
39
- sizeX: number;
40
- /**
41
- * The vertical dimension of the minimap.
42
- */
43
- sizeY: number;
44
- /**
45
- * The color of the background of the minimap.
46
- */
47
- backgroundColor: THREE.Color;
48
- }
49
- export declare class MiniMapConfigManager extends Configurator<MiniMap, MiniMapConfigType> {
50
- protected _config: MiniMapConfigType;
51
- /**
52
- * Whether the minimap is visible or not.
53
- */
54
- get visible(): boolean;
55
- /**
56
- * Whether the minimap is visible or not.
57
- */
58
- set visible(value: boolean);
59
- /**
60
- * Whether to lock the rotation of the top camera in the minimap.
61
- */
62
- get lockRotation(): boolean;
63
- /**
64
- * Whether to lock the rotation of the top camera in the minimap.
65
- */
66
- set lockRotation(value: boolean);
67
- /**
68
- * The zoom of the camera in the minimap.
69
- */
70
- get zoom(): number;
71
- /**
72
- * The zoom of the camera in the minimap.
73
- */
74
- set zoom(value: number);
75
- /**
76
- * The front offset of the minimap.
77
- * It determines how much the minimap's view is offset from the camera's view.
78
- * By pushing the map to the front, what the user sees on screen corresponds with what they see on the map
79
- */
80
- get frontOffset(): number;
81
- /**
82
- * The front offset of the minimap.
83
- * It determines how much the minimap's view is offset from the camera's view.
84
- * By pushing the map to the front, what the user sees on screen corresponds with what they see on the map
85
- */
86
- set frontOffset(value: number);
87
- /**
88
- * The horizontal dimension of the minimap.
89
- */
90
- get sizeX(): number;
91
- /**
92
- * The horizontal dimension of the minimap.
93
- */
94
- set sizeX(value: number);
95
- /**
96
- * The vertical dimension of the minimap.
97
- */
98
- get sizeY(): number;
99
- /**
100
- * The vertical dimension of the minimap.
101
- */
102
- set sizeY(value: number);
103
- /**
104
- * The color of the background of the minimap.
105
- */
106
- get backgroundColor(): THREE.Color;
107
- /**
108
- * The color of the background of the minimap.
109
- */
110
- set backgroundColor(value: THREE.Color);
111
- }
112
- export {};
@@ -1,100 +0,0 @@
1
- import * as THREE from "three";
2
- import { Resizeable, Updateable, World, Event, Disposable, Configurable } from "../../Types";
3
- import { MiniMapConfig, MiniMapConfigManager } from "./mini-map-config";
4
- import { Components } from "../../Components";
5
- /**
6
- * A class representing a 2D minimap of a 3D world.
7
- */
8
- export declare class MiniMap implements Resizeable, Updateable, Disposable, Configurable<MiniMapConfigManager, MiniMapConfig> {
9
- /** {@link Disposable.onDisposed} */
10
- readonly onDisposed: Event<unknown>;
11
- /** {@link Updateable.onAfterUpdate} */
12
- readonly onAfterUpdate: Event<unknown>;
13
- /** {@link Updateable.onBeforeUpdate} */
14
- readonly onBeforeUpdate: Event<unknown>;
15
- /** {@link Resizeable.onResize} */
16
- readonly onResize: Event<THREE.Vector2>;
17
- /** {@link Configurable.onSetup} */
18
- readonly onSetup: Event<unknown>;
19
- /**
20
- * The front offset of the minimap.
21
- * It determines how much the minimap's view is offset from the camera's view.
22
- * By pushing the map to the front, what the user sees on screen corresponds with what they see on the map
23
- */
24
- frontOffset: number;
25
- /**
26
- * The override material for the minimap.
27
- * It is used to render the depth information of the world onto the minimap.
28
- */
29
- overrideMaterial: THREE.MeshDepthMaterial;
30
- /**
31
- * The background color of the minimap.
32
- * It is used to set the background color of the minimap's renderer.
33
- */
34
- backgroundColor: THREE.Color;
35
- /**
36
- * The WebGL renderer for the minimap.
37
- * It is used to render the minimap onto the screen.
38
- */
39
- renderer: THREE.WebGLRenderer;
40
- /**
41
- * A flag indicating whether the minimap is enabled.
42
- * If disabled, the minimap will not update or render.
43
- */
44
- enabled: boolean;
45
- /**
46
- * The world in which the minimap is displayed.
47
- * It provides access to the 3D scene, camera, and other relevant world elements.
48
- */
49
- world: World;
50
- /** {@link Configurable.config} */
51
- config: MiniMapConfigManager;
52
- /** {@link Configurable.isSetup} */
53
- isSetup: boolean;
54
- protected _defaultConfig: MiniMapConfig;
55
- private _lockRotation;
56
- private _size;
57
- private _camera;
58
- private _plane;
59
- private _tempVector1;
60
- private _tempVector2;
61
- private _tempTarget;
62
- private readonly down;
63
- /**
64
- * Gets or sets whether the minimap rotation is locked.
65
- * When rotation is locked, the minimap will always face the same direction as the camera.
66
- */
67
- get lockRotation(): boolean;
68
- /**
69
- * Sets whether the minimap rotation is locked.
70
- * When rotation is locked, the minimap will always face the same direction as the camera.
71
- * @param active - If `true`, rotation is locked. If `false`, rotation is not locked.
72
- */
73
- set lockRotation(active: boolean);
74
- /**
75
- * Gets the current zoom level of the minimap.
76
- * The zoom level determines how much of the world is visible on the minimap.
77
- * @returns The current zoom level of the minimap.
78
- */
79
- get zoom(): number;
80
- /**
81
- * Sets the zoom level of the minimap.
82
- * The zoom level determines how much of the world is visible on the minimap.
83
- * @param value - The new zoom level of the minimap.
84
- */
85
- set zoom(value: number);
86
- constructor(world: World, components: Components);
87
- /** {@link Disposable.dispose} */
88
- dispose(): void;
89
- /** Returns the camera used by the MiniMap */
90
- get(): THREE.OrthographicCamera;
91
- /** {@link Updateable.update} */
92
- update(): void;
93
- /** {@link Resizeable.getSize} */
94
- getSize(): THREE.Vector2;
95
- /** {@link Resizeable.resize} */
96
- resize(size?: THREE.Vector2): void;
97
- /** {@link Configurable.setup} */
98
- setup(config?: Partial<MiniMapConfig>): void;
99
- private updatePlanes;
100
- }