@thatopen/components 2.0.11 → 2.0.12
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.
- package/dist/core/Clipper/index.d.ts +1 -1
- package/dist/core/Clipper/src/simple-plane.d.ts +16 -16
- package/dist/core/Components/index.d.ts +2 -2
- package/dist/core/Cullers/index.d.ts +3 -3
- package/dist/core/Cullers/src/culler-renderer.d.ts +1 -1
- package/dist/core/Cullers/src/mesh-culler-renderer.d.ts +6 -6
- package/dist/core/Disposer/index.d.ts +1 -1
- package/dist/core/Grids/index.d.ts +10 -9
- package/dist/core/Grids/src/simple-grid.d.ts +16 -4
- package/dist/core/MiniMap/index.d.ts +20 -19
- package/dist/core/MiniMap/src/index.d.ts +16 -16
- package/dist/core/OrthoPerspectiveCamera/index.d.ts +8 -8
- package/dist/core/Raycasters/index.d.ts +2 -1
- package/dist/core/Raycasters/src/mouse.d.ts +1 -4
- package/dist/core/Raycasters/src/simple-raycaster.d.ts +9 -11
- package/dist/core/Types/src/base-camera.d.ts +1 -1
- package/dist/core/Types/src/base-renderer.d.ts +19 -19
- package/dist/core/Types/src/base-scene.d.ts +3 -3
- package/dist/core/Worlds/index.d.ts +15 -15
- package/dist/core/Worlds/src/simple-camera.d.ts +1 -1
- package/dist/core/Worlds/src/simple-scene.d.ts +3 -3
- package/dist/fragments/BoundingBoxer/index.d.ts +151 -1
- package/dist/fragments/Classifier/index.d.ts +133 -0
- package/dist/fragments/Exploder/index.d.ts +39 -2
- package/dist/fragments/FragmentsManager/index.d.ts +45 -6
- package/dist/fragments/Hider/index.d.ts +28 -0
- package/dist/fragments/IfcGeometryTiler/index.d.ts +62 -4
- package/dist/fragments/IfcGeometryTiler/src/base-types.d.ts +14 -0
- package/dist/fragments/IfcGeometryTiler/src/index.d.ts +0 -1
- package/dist/fragments/IfcGeometryTiler/src/streaming-settings.d.ts +11 -5
- package/dist/fragments/IfcLoader/index.d.ts +89 -4
- package/dist/fragments/IfcLoader/src/ifc-fragment-settings.d.ts +14 -0
- package/dist/fragments/IfcPropertiesTiler/index.d.ts +44 -4
- package/dist/fragments/IfcPropertiesTiler/src/index.d.ts +1 -0
- package/dist/fragments/IfcPropertiesTiler/src/streaming-settings.d.ts +11 -0
- package/dist/ifc/IfcJsonExporter/index.d.ts +7 -2
- package/dist/ifc/IfcJsonExporter/src/ifc-geometry-types.d.ts +3 -0
- package/dist/ifc/IfcJsonExporter/src/index.d.ts +1 -0
- package/dist/ifc/IfcPropertiesManager/index.d.ts +195 -11
- package/dist/ifc/IfcRelationsIndexer/index.d.ts +20 -11
- package/dist/ifc/Utils/ifc-category-map.d.ts +3 -0
- package/dist/ifc/Utils/ifc-elements-map.d.ts +8 -0
- package/dist/index.cjs +5 -5
- package/dist/index.mjs +3564 -2892
- package/dist/measurement/MeasurementUtils/index.d.ts +76 -0
- package/dist/measurement/index.d.ts +1 -1
- package/dist/namespace.d.ts +2578 -1722
- package/package.json +1 -1
- package/dist/fragments/IfcGeometryTiler/src/fragment-props-stream-converter.d.ts +0 -27
- package/dist/measurement/Utils/index.d.ts +0 -24
|
@@ -4,7 +4,7 @@ import { SimplePlane } from "./src";
|
|
|
4
4
|
import { Components } from "../Components";
|
|
5
5
|
export * from "./src";
|
|
6
6
|
/**
|
|
7
|
-
* A lightweight component to easily create and handle [clipping planes](https://threejs.org/docs/#api/en/materials/Material.clippingPlanes).
|
|
7
|
+
* A lightweight component to easily create, delete and handle [clipping planes](https://threejs.org/docs/#api/en/materials/Material.clippingPlanes). 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/Clipper). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/Clipper).
|
|
8
8
|
*
|
|
9
9
|
* @param components - the instance of {@link Components} used.
|
|
10
10
|
* E.g. {@link SimplePlane}.
|
|
@@ -2,7 +2,7 @@ import * as THREE from "three";
|
|
|
2
2
|
import { Hideable, Disposable, Event, World } from "../../Types";
|
|
3
3
|
import { Components } from "../../Components";
|
|
4
4
|
/**
|
|
5
|
-
* Each of the planes created by the clipper.
|
|
5
|
+
* Each of the clipping planes created by the clipper.
|
|
6
6
|
*/
|
|
7
7
|
export declare class SimplePlane implements Disposable, Hideable {
|
|
8
8
|
/** Event that fires when the user starts dragging a clipping plane. */
|
|
@@ -61,24 +61,24 @@ export declare class SimplePlane implements Disposable, Hideable {
|
|
|
61
61
|
/** Sets the size of the clipping plane representation. */
|
|
62
62
|
set size(size: number);
|
|
63
63
|
/**
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
64
|
+
* Getter for the helper object of the clipping plane.
|
|
65
|
+
* The helper object is a THREE.Object3D that contains the clipping plane mesh and other related objects.
|
|
66
|
+
* It is used for positioning, rotating, and scaling the clipping plane in the 3D scene.
|
|
67
|
+
*
|
|
68
|
+
* @returns {THREE.Object3D} The helper object of the clipping plane.
|
|
69
|
+
*/
|
|
70
70
|
get helper(): THREE.Object3D<THREE.Object3DEventMap>;
|
|
71
71
|
constructor(components: Components, world: World, origin: THREE.Vector3, normal: THREE.Vector3, material: THREE.Material, size?: number, activateControls?: boolean);
|
|
72
72
|
/**
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
73
|
+
* Sets the clipping plane's normal and origin from the given normal and point.
|
|
74
|
+
* This method resets the clipping plane's state, updates the normal and origin,
|
|
75
|
+
* and positions the helper object accordingly.
|
|
76
|
+
*
|
|
77
|
+
* @param normal - The new normal vector for the clipping plane.
|
|
78
|
+
* @param point - The new origin point for the clipping plane.
|
|
79
|
+
*
|
|
80
|
+
* @returns {void}
|
|
81
|
+
*/
|
|
82
82
|
setFromNormalAndCoplanarPoint(normal: THREE.Vector3, point: THREE.Vector3): void;
|
|
83
83
|
/** {@link Updateable.update} */
|
|
84
84
|
update: () => void;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { Component, Disposable, Event } from "../Types";
|
|
2
2
|
/**
|
|
3
|
-
* The entry point of the Components library. It can create and access all the components of the library globally, update all the updatable components automatically and dispose all the components, preventing memory leaks.
|
|
3
|
+
* The entry point of the Components library. It can create, delete and access all the components of the library globally, update all the updatable components automatically and dispose all the components, preventing memory leaks.
|
|
4
4
|
*/
|
|
5
5
|
export declare class Components implements Disposable {
|
|
6
6
|
/**
|
|
7
7
|
* The version of the @thatopen/components library.
|
|
8
8
|
*/
|
|
9
|
-
static readonly release = "2.0.
|
|
9
|
+
static readonly release = "2.0.12";
|
|
10
10
|
/** {@link Disposable.onDisposed} */
|
|
11
11
|
readonly onDisposed: Event<void>;
|
|
12
12
|
/**
|
|
@@ -3,7 +3,7 @@ import { MeshCullerRenderer, CullerRendererSettings } from "./src";
|
|
|
3
3
|
import { Component, Event, Disposable, World } from "../Types";
|
|
4
4
|
export * from "./src";
|
|
5
5
|
/**
|
|
6
|
-
* A component that
|
|
6
|
+
* A component that provides culling functionality for meshes in a 3D scene. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/Cullers). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/Cullers).
|
|
7
7
|
*/
|
|
8
8
|
export declare class Cullers extends Component implements Disposable {
|
|
9
9
|
/**
|
|
@@ -12,8 +12,8 @@ export declare class Cullers extends Component implements Disposable {
|
|
|
12
12
|
*/
|
|
13
13
|
static readonly uuid: "69f2a50d-c266-44fc-b1bd-fa4d34be89e6";
|
|
14
14
|
/**
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
* An event that is triggered when the Cullers component is disposed.
|
|
16
|
+
*/
|
|
17
17
|
readonly onDisposed: Event<unknown>;
|
|
18
18
|
private _enabled;
|
|
19
19
|
/**
|
|
@@ -2,7 +2,7 @@ import * as THREE from "three";
|
|
|
2
2
|
import { Components } from "../../Components";
|
|
3
3
|
import { AsyncEvent, Event, World } from "../../Types";
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* Settings to configure the CullerRenderer.
|
|
6
6
|
*/
|
|
7
7
|
export interface CullerRendererSettings {
|
|
8
8
|
/**
|
|
@@ -3,7 +3,7 @@ import { CullerRenderer, CullerRendererSettings } from "./culler-renderer";
|
|
|
3
3
|
import { Components } from "../../Components";
|
|
4
4
|
import { Event, World, Disposable } from "../../Types";
|
|
5
5
|
/**
|
|
6
|
-
* A renderer to
|
|
6
|
+
* A renderer to hide/show meshes depending on their visibility from the user's point of view.
|
|
7
7
|
*/
|
|
8
8
|
export declare class MeshCullerRenderer extends CullerRenderer implements Disposable {
|
|
9
9
|
/**
|
|
@@ -45,11 +45,11 @@ export declare class MeshCullerRenderer extends CullerRenderer implements Dispos
|
|
|
45
45
|
*/
|
|
46
46
|
add(mesh: THREE.Mesh | THREE.InstancedMesh): void;
|
|
47
47
|
/**
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
48
|
+
* Removes a mesh from the culler, so its visibility is not controlled by the culler anymore.
|
|
49
|
+
* When the mesh is removed, it will be hidden from the scene and its color-coded mesh will be destroyed.
|
|
50
|
+
* @param mesh - The mesh to remove. It can be a regular THREE.Mesh or an instance of THREE.InstancedMesh.
|
|
51
|
+
* @returns {void}
|
|
52
|
+
*/
|
|
53
53
|
remove(mesh: THREE.Mesh | THREE.InstancedMesh): void;
|
|
54
54
|
private handleWorkerMessage;
|
|
55
55
|
private getAvailableMaterial;
|
|
@@ -2,7 +2,7 @@ import * as THREE from "three";
|
|
|
2
2
|
import { Components } from "../Components";
|
|
3
3
|
import { Component } from "../Types";
|
|
4
4
|
/**
|
|
5
|
-
* A tool to safely remove meshes and
|
|
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
6
|
*/
|
|
7
7
|
export declare class Disposer extends Component {
|
|
8
8
|
private _disposedComponents;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { Component, Disposable, World, Event } from "../Types";
|
|
2
2
|
import { GridConfig, SimpleGrid } from "./src";
|
|
3
3
|
import { Components } from "../Components";
|
|
4
|
+
export * from "./src";
|
|
4
5
|
/**
|
|
5
|
-
* A component that manages
|
|
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).
|
|
6
7
|
*/
|
|
7
8
|
export declare class Grids extends Component implements Disposable {
|
|
8
9
|
/**
|
|
@@ -24,14 +25,14 @@ export declare class Grids extends Component implements Disposable {
|
|
|
24
25
|
enabled: boolean;
|
|
25
26
|
constructor(components: Components);
|
|
26
27
|
/**
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
28
|
+
* Creates a new grid for the given world.
|
|
29
|
+
* Throws an error if a grid already exists for the world.
|
|
30
|
+
*
|
|
31
|
+
* @param world - The world to create the grid for.
|
|
32
|
+
* @returns The newly created grid.
|
|
33
|
+
*
|
|
34
|
+
* @throws Will throw an error if a grid already exists for the given world.
|
|
35
|
+
*/
|
|
35
36
|
create(world: World): SimpleGrid;
|
|
36
37
|
/**
|
|
37
38
|
* Deletes the grid associated with the given world.
|
|
@@ -1,17 +1,29 @@
|
|
|
1
1
|
import * as THREE from "three";
|
|
2
2
|
import { Hideable, Event, World, Disposable } from "../../Types";
|
|
3
3
|
import { Components } from "../../Components";
|
|
4
|
+
/**
|
|
5
|
+
* Configuration interface for the {@link SimpleGrid} class.
|
|
6
|
+
*/
|
|
4
7
|
export interface GridConfig {
|
|
8
|
+
/**
|
|
9
|
+
* The color of the grid lines.
|
|
10
|
+
*/
|
|
5
11
|
color: THREE.Color;
|
|
12
|
+
/**
|
|
13
|
+
* The size of the primary grid lines.
|
|
14
|
+
*/
|
|
6
15
|
size1: number;
|
|
16
|
+
/**
|
|
17
|
+
* The size of the secondary grid lines.
|
|
18
|
+
*/
|
|
7
19
|
size2: number;
|
|
20
|
+
/**
|
|
21
|
+
* The distance at which the grid lines start to fade away.
|
|
22
|
+
*/
|
|
8
23
|
distance: number;
|
|
9
24
|
}
|
|
10
25
|
/**
|
|
11
|
-
* An infinite grid. Created by
|
|
12
|
-
* [fyrestar](https://github.com/Fyrestar/THREE.InfiniteGridHelper)
|
|
13
|
-
* and translated to typescript by
|
|
14
|
-
* [dkaraush](https://github.com/dkaraush/THREE.InfiniteGridHelper/blob/master/InfiniteGridHelper.ts).
|
|
26
|
+
* 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).
|
|
15
27
|
*/
|
|
16
28
|
export declare class SimpleGrid implements Hideable, Disposable {
|
|
17
29
|
/** {@link Disposable.onDisposed} */
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { MiniMap } from "./src";
|
|
2
2
|
import { Component, Updateable, World, Event, Disposable } from "../Types";
|
|
3
3
|
import { Components } from "../Components";
|
|
4
|
+
export * from "./src";
|
|
4
5
|
/**
|
|
5
|
-
* A component that manages multiple {@link MiniMap} instances, each associated with a unique world ID.
|
|
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).
|
|
6
7
|
*/
|
|
7
8
|
export declare class MiniMaps extends Component implements Updateable, Disposable {
|
|
8
9
|
/**
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
* A unique identifier for the component.
|
|
11
|
+
* This UUID is used to register the component within the Components system.
|
|
12
|
+
*/
|
|
12
13
|
static readonly uuid: "39ad6aad-84c8-4adf-a1e0-7f25313a9e7f";
|
|
13
14
|
/** {@link Updateable.onAfterUpdate} */
|
|
14
15
|
readonly onAfterUpdate: Event<unknown>;
|
|
@@ -19,26 +20,26 @@ export declare class MiniMaps extends Component implements Updateable, Disposabl
|
|
|
19
20
|
/** {@link Component.enabled} */
|
|
20
21
|
enabled: boolean;
|
|
21
22
|
/**
|
|
22
|
-
|
|
23
|
-
|
|
23
|
+
* A collection of {@link MiniMap} instances, each associated with a unique world ID.
|
|
24
|
+
*/
|
|
24
25
|
list: Map<string, MiniMap>;
|
|
25
26
|
constructor(components: Components);
|
|
26
27
|
/**
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
28
|
+
* Creates a new {@link MiniMap} instance associated with the given world.
|
|
29
|
+
* If a {@link MiniMap} instance already exists for the given world, an error will be thrown.
|
|
30
|
+
*
|
|
31
|
+
* @param world - The {@link World} for which to create a {@link MiniMap} instance.
|
|
32
|
+
* @returns The newly created {@link MiniMap} instance.
|
|
33
|
+
* @throws Will throw an error if a {@link MiniMap} instance already exists for the given world.
|
|
34
|
+
*/
|
|
34
35
|
create(world: World): MiniMap;
|
|
35
36
|
/**
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
37
|
+
* Deletes a {@link MiniMap} instance associated with the given world ID.
|
|
38
|
+
* If a {@link MiniMap} instance does not exist for the given ID, nothing happens.
|
|
39
|
+
*
|
|
40
|
+
* @param id - The unique identifier of the world for which to delete the {@link MiniMap} instance.
|
|
41
|
+
* @returns {void}
|
|
42
|
+
*/
|
|
42
43
|
delete(id: string): void;
|
|
43
44
|
/** {@link Disposable.dispose} */
|
|
44
45
|
dispose(): void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as THREE from "three";
|
|
2
2
|
import { Resizeable, Updateable, World, Event, Disposable } from "../../Types";
|
|
3
3
|
/**
|
|
4
|
-
* A class representing a 2D minimap
|
|
4
|
+
* A class representing a 2D minimap of a 3D world.
|
|
5
5
|
*/
|
|
6
6
|
export declare class MiniMap implements Resizeable, Updateable, Disposable {
|
|
7
7
|
/** {@link Disposable.onDisposed} */
|
|
@@ -52,27 +52,27 @@ export declare class MiniMap implements Resizeable, Updateable, Disposable {
|
|
|
52
52
|
private _tempTarget;
|
|
53
53
|
private readonly down;
|
|
54
54
|
/**
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
55
|
+
* Gets or sets whether the minimap rotation is locked.
|
|
56
|
+
* When rotation is locked, the minimap will always face the same direction as the camera.
|
|
57
|
+
*/
|
|
58
58
|
get lockRotation(): boolean;
|
|
59
59
|
/**
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
60
|
+
* Sets whether the minimap rotation is locked.
|
|
61
|
+
* When rotation is locked, the minimap will always face the same direction as the camera.
|
|
62
|
+
* @param active - If `true`, rotation is locked. If `false`, rotation is not locked.
|
|
63
|
+
*/
|
|
64
64
|
set lockRotation(active: boolean);
|
|
65
65
|
/**
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
66
|
+
* Gets the current zoom level of the minimap.
|
|
67
|
+
* The zoom level determines how much of the world is visible on the minimap.
|
|
68
|
+
* @returns The current zoom level of the minimap.
|
|
69
|
+
*/
|
|
70
70
|
get zoom(): number;
|
|
71
71
|
/**
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
72
|
+
* Sets the zoom level of the minimap.
|
|
73
|
+
* The zoom level determines how much of the world is visible on the minimap.
|
|
74
|
+
* @param value - The new zoom level of the minimap.
|
|
75
|
+
*/
|
|
76
76
|
set zoom(value: number);
|
|
77
77
|
constructor(world: World);
|
|
78
78
|
/** {@link Disposable.dispose} */
|
|
@@ -4,7 +4,7 @@ import { SimpleCamera } from "..";
|
|
|
4
4
|
import { NavigationMode, NavModeID, ProjectionManager } from "./src";
|
|
5
5
|
export * from "./src";
|
|
6
6
|
/**
|
|
7
|
-
* A flexible camera that uses [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls) to
|
|
7
|
+
* A flexible camera that uses [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls) to control the camera in 2D and 3D. It supports multiple navigation modes, such as 2D floor plan navigation, first person and 3D orbit. This class extends the SimpleCamera class and adds additional functionality for managing different camera projections and navigation modes. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/OrthoPerspectiveCamera). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/OrthoPerspectiveCamera).
|
|
8
8
|
*/
|
|
9
9
|
export declare class OrthoPerspectiveCamera extends SimpleCamera {
|
|
10
10
|
/**
|
|
@@ -27,13 +27,13 @@ export declare class OrthoPerspectiveCamera extends SimpleCamera {
|
|
|
27
27
|
protected _mode: NavigationMode | null;
|
|
28
28
|
private previousSize;
|
|
29
29
|
/**
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
30
|
+
* Getter for the current navigation mode.
|
|
31
|
+
* Throws an error if the mode is not found or the camera is not initialized.
|
|
32
|
+
*
|
|
33
|
+
* @returns {NavigationMode} The current navigation mode.
|
|
34
|
+
*
|
|
35
|
+
* @throws {Error} Throws an error if the mode is not found or the camera is not initialized.
|
|
36
|
+
*/
|
|
37
37
|
get mode(): NavigationMode;
|
|
38
38
|
constructor(components: Components);
|
|
39
39
|
/** {@link Disposable.dispose} */
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { Component, Disposable, World, Event } from "../Types";
|
|
2
2
|
import { SimpleRaycaster } from "./src";
|
|
3
3
|
import { Components } from "../Components";
|
|
4
|
+
export * from "./src";
|
|
4
5
|
/**
|
|
5
|
-
* A component that manages
|
|
6
|
+
* A component that manages a raycaster for each world and automatically disposes it when its corresponding world is disposed. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/Raycasters). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/Raycasters).
|
|
6
7
|
*/
|
|
7
8
|
export declare class Raycasters extends Component implements Disposable {
|
|
8
9
|
/**
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import * as THREE from "three";
|
|
2
2
|
import { Disposable, Event } from "../../Types";
|
|
3
3
|
/**
|
|
4
|
-
* A helper to easily get the real position of the mouse in the Three.js canvas
|
|
5
|
-
* to work with tools like the
|
|
6
|
-
* [raycaster](https://threejs.org/docs/#api/en/core/Raycaster), even if it has
|
|
7
|
-
* been transformed through CSS or doesn't occupy the whole screen.
|
|
4
|
+
* A helper to easily get the real position of the mouse in the Three.js canvas to work with tools like the [raycaster](https://threejs.org/docs/#api/en/core/Raycaster), even if it has been transformed through CSS or doesn't occupy the whole screen.
|
|
8
5
|
*/
|
|
9
6
|
export declare class Mouse implements Disposable {
|
|
10
7
|
dom: HTMLCanvasElement;
|
|
@@ -3,9 +3,7 @@ import { Components } from "../../Components";
|
|
|
3
3
|
import { Event, World, Disposable } from "../../Types";
|
|
4
4
|
import { Mouse } from "./mouse";
|
|
5
5
|
/**
|
|
6
|
-
* A simple [raycaster](https://threejs.org/docs/#api/en/core/Raycaster)
|
|
7
|
-
* that allows to easily get items from the scene using the mouse and touch
|
|
8
|
-
* events.
|
|
6
|
+
* A simple [raycaster](https://threejs.org/docs/#api/en/core/Raycaster) that allows to easily get items from the scene using the mouse and touch events.
|
|
9
7
|
*/
|
|
10
8
|
export declare class SimpleRaycaster implements Disposable {
|
|
11
9
|
/** {@link Component.enabled} */
|
|
@@ -40,14 +38,14 @@ export declare class SimpleRaycaster implements Disposable {
|
|
|
40
38
|
*/
|
|
41
39
|
castRay(items?: THREE.Object3D[]): THREE.Intersection | null;
|
|
42
40
|
/**
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
41
|
+
* Casts a ray from a given origin in a given direction and returns the first item found.
|
|
42
|
+
* This method also takes into account the clipping planes used by the renderer.
|
|
43
|
+
*
|
|
44
|
+
* @param origin - The origin of the ray.
|
|
45
|
+
* @param direction - The direction of the ray.
|
|
46
|
+
* @param items - The meshes to query. If not provided, it will query all the meshes stored in {@link World.meshes}.
|
|
47
|
+
* @returns The first intersection found or `null` if no intersection was found.
|
|
48
|
+
*/
|
|
51
49
|
castRayFromVector(origin: THREE.Vector3, direction: THREE.Vector3, items?: THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>[]): THREE.Intersection<THREE.Object3D<THREE.Object3DEventMap>> | null;
|
|
52
50
|
private intersect;
|
|
53
51
|
private filterClippingPlanes;
|
|
@@ -3,7 +3,7 @@ import CameraControls from "camera-controls";
|
|
|
3
3
|
import { BaseWorldItem } from "./base-world-item";
|
|
4
4
|
import { CameraControllable } from "./interfaces";
|
|
5
5
|
/**
|
|
6
|
-
* Abstract class representing a camera in
|
|
6
|
+
* Abstract class representing a camera in a 3D world. All cameras should use this class as a base.
|
|
7
7
|
*/
|
|
8
8
|
export declare abstract class BaseCamera extends BaseWorldItem {
|
|
9
9
|
/**
|
|
@@ -40,26 +40,26 @@ export declare abstract class BaseRenderer extends BaseWorldItem implements Upda
|
|
|
40
40
|
*/
|
|
41
41
|
clippingPlanes: THREE.Plane[];
|
|
42
42
|
/**
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
43
|
+
* Updates the clipping planes and triggers the `onClippingPlanesUpdated` event.
|
|
44
|
+
*
|
|
45
|
+
* @remarks
|
|
46
|
+
* This method is typically called when there is a change to the list of clipping planes
|
|
47
|
+
* used by the active renderer.
|
|
48
|
+
*/
|
|
49
49
|
updateClippingPlanes(): void;
|
|
50
50
|
/**
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
51
|
+
* Sets or removes a clipping plane from the renderer.
|
|
52
|
+
*
|
|
53
|
+
* @param active - A boolean indicating whether the clipping plane should be active or not.
|
|
54
|
+
* @param plane - The clipping plane to be added or removed.
|
|
55
|
+
* @param isLocal - An optional boolean indicating whether the clipping plane is local to the object. If not provided, it defaults to `false`.
|
|
56
|
+
*
|
|
57
|
+
* @remarks
|
|
58
|
+
* This method adds or removes a clipping plane from the `clippingPlanes` array.
|
|
59
|
+
* If `active` is `true` and the plane is not already in the array, it is added.
|
|
60
|
+
* If `active` is `false` and the plane is in the array, it is removed.
|
|
61
|
+
* The `three.clippingPlanes` property is then updated to reflect the current state of the `clippingPlanes` array,
|
|
62
|
+
* excluding any planes marked as local.
|
|
63
|
+
*/
|
|
64
64
|
setPlane(active: boolean, plane: THREE.Plane, isLocal?: boolean): void;
|
|
65
65
|
}
|
|
@@ -10,9 +10,9 @@ export declare abstract class BaseScene extends BaseWorldItem implements Disposa
|
|
|
10
10
|
/** {@link Disposable.onDisposed} */
|
|
11
11
|
readonly onDisposed: Event<unknown>;
|
|
12
12
|
/**
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
* Abstract property representing the three.js object associated with this scene.
|
|
14
|
+
* It should be implemented by subclasses.
|
|
15
|
+
*/
|
|
16
16
|
abstract three: THREE.Object3D;
|
|
17
17
|
protected constructor(components: Components);
|
|
18
18
|
/** {@link Disposable.dispose} */
|
|
@@ -3,7 +3,7 @@ import { Components } from "../Components";
|
|
|
3
3
|
import { SimpleWorld } from "./src";
|
|
4
4
|
export * from "./src";
|
|
5
5
|
/**
|
|
6
|
-
* A class representing a collection of worlds within a game engine. It manages the creation, deletion, and update of worlds.
|
|
6
|
+
* A class representing a collection of worlds within a game engine. It manages the creation, deletion, and update of worlds. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/Worlds). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/Worlds).
|
|
7
7
|
*/
|
|
8
8
|
export declare class Worlds extends Component implements Updateable, Disposable {
|
|
9
9
|
/**
|
|
@@ -46,22 +46,22 @@ export declare class Worlds extends Component implements Updateable, Disposable
|
|
|
46
46
|
*/
|
|
47
47
|
create<T extends BaseScene = BaseScene, U extends BaseCamera = BaseCamera, S extends BaseRenderer = BaseRenderer>(): SimpleWorld<T, U, S>;
|
|
48
48
|
/**
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
49
|
+
* Deletes a world from the list of worlds.
|
|
50
|
+
*
|
|
51
|
+
* @param {World} world - The world to be deleted.
|
|
52
|
+
*
|
|
53
|
+
* @throws {Error} - Throws an error if the provided world is not found in the list.
|
|
54
|
+
*
|
|
55
|
+
* @returns {void}
|
|
56
|
+
*/
|
|
57
57
|
delete(world: World): void;
|
|
58
58
|
/**
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
59
|
+
* Disposes of the Worlds component and all its managed worlds.
|
|
60
|
+
* This method sets the enabled flag to false, disposes of all worlds, clears the list,
|
|
61
|
+
* and triggers the onDisposed event.
|
|
62
|
+
*
|
|
63
|
+
* @returns {void}
|
|
64
|
+
*/
|
|
65
65
|
dispose(): void;
|
|
66
66
|
/** {@link Updateable.update} */
|
|
67
67
|
update(delta?: number): void | Promise<void>;
|
|
@@ -3,7 +3,7 @@ import CameraControls from "camera-controls";
|
|
|
3
3
|
import { Disposable, Updateable, Event, BaseCamera } from "../../Types";
|
|
4
4
|
import { Components } from "../../Components";
|
|
5
5
|
/**
|
|
6
|
-
* A basic camera that uses [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls) to
|
|
6
|
+
* A basic camera that uses [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls) to control the camera in 2D and 3D. Check out it's API to find out what features it offers.
|
|
7
7
|
*/
|
|
8
8
|
export declare class SimpleCamera extends BaseCamera implements Updateable, Disposable {
|
|
9
9
|
/** {@link Updateable.onBeforeUpdate} */
|
|
@@ -29,9 +29,9 @@ export declare class SimpleScene extends BaseScene implements Configurable<{}> {
|
|
|
29
29
|
/** {@link Configurable.onSetup} */
|
|
30
30
|
readonly onSetup: Event<SimpleScene>;
|
|
31
31
|
/**
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
* Configuration interface for the {@link SimpleScene}.
|
|
33
|
+
* Defines properties for directional and ambient lights.
|
|
34
|
+
*/
|
|
35
35
|
config: Required<SimpleSceneConfig>;
|
|
36
36
|
constructor(components: Components);
|
|
37
37
|
/** {@link Configurable.setup} */
|