@thatopen/components 2.1.19 → 2.1.21
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/Components/index.d.ts +1 -1
- package/dist/core/ShadowedScene/index.d.ts +59 -0
- package/dist/core/ShadowedScene/src/distance-renderer.d.ts +67 -0
- package/dist/core/ShadowedScene/src/index.d.ts +1 -0
- package/dist/core/Types/src/base-scene.d.ts +4 -0
- package/dist/core/index.d.ts +1 -0
- package/dist/ifc/IfcRelationsIndexer/src/relToAttributesMap.d.ts +1 -1
- package/dist/ifc/IfcRelationsIndexer/src/types.d.ts +4 -2
- package/dist/index.cjs +61 -21
- package/dist/index.mjs +3286 -2970
- package/dist/namespace.d.ts +1687 -1555
- package/package.json +2 -2
|
@@ -6,7 +6,7 @@ export declare class Components implements Disposable {
|
|
|
6
6
|
/**
|
|
7
7
|
* The version of the @thatopen/components library.
|
|
8
8
|
*/
|
|
9
|
-
static readonly release = "2.1.
|
|
9
|
+
static readonly release = "2.1.21";
|
|
10
10
|
/** {@link Disposable.onDisposed} */
|
|
11
11
|
readonly onDisposed: Event<void>;
|
|
12
12
|
/**
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { SimpleScene, SimpleSceneConfig } from "../Worlds";
|
|
2
|
+
import { DistanceRenderer } from "./src";
|
|
3
|
+
import { Disposable } from "../Types";
|
|
4
|
+
/**
|
|
5
|
+
* Configuration interface for the {@link ShadowedScene}. Defines properties for directional and ambient lights,
|
|
6
|
+
* as well as shadows.
|
|
7
|
+
*/
|
|
8
|
+
export interface ShadowedSceneConfig extends SimpleSceneConfig {
|
|
9
|
+
shadows: {
|
|
10
|
+
cascade: number;
|
|
11
|
+
resolution: number;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* A scene that supports efficient cast shadows.
|
|
16
|
+
*/
|
|
17
|
+
export declare class ShadowedScene extends SimpleScene implements Disposable {
|
|
18
|
+
private _distanceRenderer?;
|
|
19
|
+
/**
|
|
20
|
+
* Whether the bias property should be set automatically depending on the shadow distance.
|
|
21
|
+
*/
|
|
22
|
+
autoBias: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Configuration interface for the {@link ShadowedScene}.
|
|
25
|
+
* Defines properties for directional and ambient lights, as well as shadows.
|
|
26
|
+
*/
|
|
27
|
+
config: Required<ShadowedSceneConfig>;
|
|
28
|
+
private _lightsWithShadow;
|
|
29
|
+
private _isComputingShadows;
|
|
30
|
+
private _shadowsEnabled;
|
|
31
|
+
private _bias;
|
|
32
|
+
/**
|
|
33
|
+
* The getter for the bias to prevent artifacts (stripes). It usually ranges between 0 and -0.005.
|
|
34
|
+
*/
|
|
35
|
+
get bias(): number;
|
|
36
|
+
/**
|
|
37
|
+
* The setter for the bias to prevent artifacts (stripes). It usually ranges between 0 and -0.005.
|
|
38
|
+
*/
|
|
39
|
+
set bias(value: number);
|
|
40
|
+
/**
|
|
41
|
+
* Getter to see whether the shadows are enabled or not in this scene instance.
|
|
42
|
+
*/
|
|
43
|
+
get shadowsEnabled(): boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Setter to control whether the shadows are enabled or not in this scene instance.
|
|
46
|
+
*/
|
|
47
|
+
set shadowsEnabled(value: boolean);
|
|
48
|
+
/**
|
|
49
|
+
* Getter to get the renderer used to determine the farthest distance from the camera.
|
|
50
|
+
*/
|
|
51
|
+
get distanceRenderer(): DistanceRenderer;
|
|
52
|
+
/** {@link Configurable.setup} */
|
|
53
|
+
setup(config?: Partial<ShadowedSceneConfig>): void;
|
|
54
|
+
/** {@link Disposable.dispose} */
|
|
55
|
+
dispose(): void;
|
|
56
|
+
/** Update all the shadows of the scene. */
|
|
57
|
+
updateShadows(): Promise<void>;
|
|
58
|
+
private recomputeShadows;
|
|
59
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import * as THREE from "three";
|
|
2
|
+
import { Event, World } from "../../Types";
|
|
3
|
+
import { Components } from "../../Components";
|
|
4
|
+
/**
|
|
5
|
+
* A base renderer to determine visibility on screen.
|
|
6
|
+
*/
|
|
7
|
+
export declare class DistanceRenderer {
|
|
8
|
+
/** {@link Disposable.onDisposed} */
|
|
9
|
+
readonly onDisposed: Event<string>;
|
|
10
|
+
/**
|
|
11
|
+
* Fires after making the visibility check to the meshes. It lists the
|
|
12
|
+
* meshes that are currently visible, and the ones that were visible
|
|
13
|
+
* just before but not anymore.
|
|
14
|
+
*/
|
|
15
|
+
readonly onDistanceComputed: Event<number>;
|
|
16
|
+
/**
|
|
17
|
+
* Objects that won't be taken into account in the distance check.
|
|
18
|
+
*/
|
|
19
|
+
excludedObjects: Set<THREE.Object3D<THREE.Object3DEventMap>>;
|
|
20
|
+
/**
|
|
21
|
+
* Whether this renderer is active or not. If not, it won't render anything.
|
|
22
|
+
*/
|
|
23
|
+
enabled: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Render the internal scene used to determine the object visibility. Used
|
|
26
|
+
* for debugging purposes.
|
|
27
|
+
*/
|
|
28
|
+
renderDebugFrame: boolean;
|
|
29
|
+
/** The components instance to which this renderer belongs. */
|
|
30
|
+
components: Components;
|
|
31
|
+
/**
|
|
32
|
+
* The scene where the distance is computed.
|
|
33
|
+
*/
|
|
34
|
+
scene: THREE.Scene;
|
|
35
|
+
/**
|
|
36
|
+
* The camera used to compute the distance.
|
|
37
|
+
*/
|
|
38
|
+
camera: THREE.OrthographicCamera;
|
|
39
|
+
/**
|
|
40
|
+
* The material used to compute the distance.
|
|
41
|
+
*/
|
|
42
|
+
depthMaterial: THREE.ShaderMaterial;
|
|
43
|
+
/** The world instance to which this renderer belongs. */
|
|
44
|
+
readonly world: World;
|
|
45
|
+
/** The THREE.js renderer used to make the visibility test. */
|
|
46
|
+
readonly renderer: THREE.WebGLRenderer;
|
|
47
|
+
protected readonly worker: Worker;
|
|
48
|
+
private _width;
|
|
49
|
+
private _height;
|
|
50
|
+
private readonly _postQuad;
|
|
51
|
+
private readonly tempRT;
|
|
52
|
+
private readonly resultRT;
|
|
53
|
+
private readonly bufferSize;
|
|
54
|
+
private readonly _buffer;
|
|
55
|
+
protected _isWorkerBusy: boolean;
|
|
56
|
+
constructor(components: Components, world: World);
|
|
57
|
+
/** {@link Disposable.dispose} */
|
|
58
|
+
dispose(): void;
|
|
59
|
+
/**
|
|
60
|
+
* The function that the culler uses to reprocess the scene. Generally it's
|
|
61
|
+
* better to call needsUpdate, but you can also call this to force it.
|
|
62
|
+
* @param force if true, it will refresh the scene even if needsUpdate is
|
|
63
|
+
* not true.
|
|
64
|
+
*/
|
|
65
|
+
compute: () => Promise<void>;
|
|
66
|
+
private handleWorkerMessage;
|
|
67
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./distance-renderer";
|
|
@@ -14,6 +14,10 @@ export declare abstract class BaseScene extends BaseWorldItem implements Disposa
|
|
|
14
14
|
* It should be implemented by subclasses.
|
|
15
15
|
*/
|
|
16
16
|
abstract three: THREE.Object3D;
|
|
17
|
+
/** The set of directional lights managed by this scene component. */
|
|
18
|
+
directionalLights: Map<string, THREE.DirectionalLight>;
|
|
19
|
+
/** The set of ambient lights managed by this scene component. */
|
|
20
|
+
ambientLights: Map<string, THREE.AmbientLight>;
|
|
17
21
|
protected constructor(components: Components);
|
|
18
22
|
/** {@link Disposable.dispose} */
|
|
19
23
|
dispose(): void;
|
package/dist/core/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { InverseAttribute } from "./types";
|
|
2
|
-
export declare const relToAttributesMap: Map<160246688 | 2655215786 | 919958153 | 1307041759 | 4186316022 | 781010003 | 307848117 | 3242617779 | 279856033 | 1204542856, {
|
|
2
|
+
export declare const relToAttributesMap: Map<160246688 | 2655215786 | 919958153 | 1307041759 | 4186316022 | 781010003 | 307848117 | 3242617779 | 279856033 | 1204542856 | 2857406711, {
|
|
3
3
|
forRelating: InverseAttribute;
|
|
4
4
|
forRelated: InverseAttribute;
|
|
5
5
|
}>;
|
|
@@ -24,7 +24,8 @@ export type InverseAttributes = [
|
|
|
24
24
|
"HasControlElements",
|
|
25
25
|
"AssignedToFlowElement",
|
|
26
26
|
"ConnectedTo",
|
|
27
|
-
"ConnectedFrom"
|
|
27
|
+
"ConnectedFrom",
|
|
28
|
+
"ReferencedBy"
|
|
28
29
|
];
|
|
29
30
|
export type InverseAttribute = InverseAttributes[number];
|
|
30
31
|
/**
|
|
@@ -40,6 +41,7 @@ export type IfcRelations = [
|
|
|
40
41
|
typeof WEBIFC.IFCRELDEFINESBYTEMPLATE,
|
|
41
42
|
typeof WEBIFC.IFCRELCONTAINEDINSPATIALSTRUCTURE,
|
|
42
43
|
typeof WEBIFC.IFCRELFLOWCONTROLELEMENTS,
|
|
43
|
-
typeof WEBIFC.IFCRELCONNECTSELEMENTS
|
|
44
|
+
typeof WEBIFC.IFCRELCONNECTSELEMENTS,
|
|
45
|
+
typeof WEBIFC.IFCRELASSIGNSTOPRODUCT
|
|
44
46
|
];
|
|
45
47
|
export type IfcRelation = IfcRelations[number];
|