vim-web 0.3.39-dev.5 → 0.3.39-dev.7
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/README.md +2 -4
- package/dist/style.css +51 -13
- package/dist/types/core-viewers/ultra/utils/math3d.d.ts +1 -0
- package/dist/types/core-viewers/ultra/viewer/marshal.d.ts +3 -1
- package/dist/types/core-viewers/ultra/viewer/renderer.d.ts +6 -0
- package/dist/types/core-viewers/ultra/viewer/rpcClient.d.ts +8 -3
- package/dist/types/core-viewers/ultra/viewer/rpcSafeClient.d.ts +2 -1
- package/dist/types/core-viewers/ultra/viewer/socketClient.d.ts +14 -4
- package/dist/types/core-viewers/ultra/viewer/viewer.d.ts +1 -0
- package/dist/types/core-viewers/webgl/loader/geometry.d.ts +2 -2
- package/dist/types/core-viewers/webgl/loader/materials/outlineMaterial.d.ts +42 -0
- package/dist/types/core-viewers/webgl/loader/materials/standardMaterial.d.ts +5 -5
- package/dist/types/core-viewers/webgl/loader/materials/viewerMaterials.d.ts +2 -0
- package/dist/types/core-viewers/webgl/loader/mesh.d.ts +2 -2
- package/dist/types/core-viewers/webgl/loader/progressive/g3dSubset.d.ts +3 -1
- package/dist/types/core-viewers/webgl/loader/progressive/insertableSubmesh.d.ts +1 -1
- package/dist/types/core-viewers/webgl/loader/progressive/instancedSubmesh.d.ts +1 -1
- package/dist/types/core-viewers/webgl/utils/boxes.d.ts +1 -1
- package/dist/types/core-viewers/webgl/viewer/gizmos/sectionBox/sectionBoxInputs.d.ts +1 -1
- package/dist/types/core-viewers/webgl/viewer/raycaster.d.ts +1 -1
- package/dist/types/core-viewers/webgl/viewer/rendering/mergePass.d.ts +3 -1
- package/dist/types/core-viewers/webgl/viewer/rendering/outlinePass.d.ts +1 -1
- package/dist/types/core-viewers/webgl/viewer/rendering/renderScene.d.ts +4 -0
- package/dist/types/core-viewers/webgl/viewer/rendering/renderer.d.ts +4 -0
- package/dist/types/core-viewers/webgl/viewer/rendering/renderingComposer.d.ts +59 -10
- package/dist/types/core-viewers/webgl/viewer/rendering/transferPass.d.ts +3 -1
- package/dist/types/core-viewers/webgl/viewer/settings/viewerSettings.d.ts +5 -0
- package/dist/types/react-viewers/errors/errors.d.ts +6 -5
- package/dist/types/react-viewers/{errors → ultra/errors}/fileLoadingError.d.ts +1 -1
- package/dist/types/react-viewers/{errors → ultra/errors}/fileOpeningError.d.ts +1 -1
- package/dist/types/react-viewers/{errors → ultra/errors}/serverCompatibilityError.d.ts +1 -1
- package/dist/types/react-viewers/{errors → ultra/errors}/serverConnectionError.d.ts +1 -1
- package/dist/types/react-viewers/ultra/errors/serverFileDownloadingError.d.ts +2 -0
- package/dist/types/react-viewers/ultra/errors/serverStreamError.d.ts +2 -0
- package/dist/types/react-viewers/ultra/errors/ultraErrors.d.ts +3 -0
- package/dist/vim-web.iife.js +24439 -21259
- package/dist/vim-web.iife.js.map +1 -1
- package/dist/vim-web.js +24441 -21261
- package/dist/vim-web.js.map +1 -1
- package/package.json +3 -3
- package/dist/types/react-viewers/errors/fileDownloadingError.d.ts +0 -2
- package/dist/types/react-viewers/ultra/ultraErrors.d.ts +0 -3
package/README.md
CHANGED
|
@@ -11,13 +11,11 @@ https://www.npmjs.com/package/vim-web
|
|
|
11
11
|
|
|
12
12
|
### WebGL Viewer
|
|
13
13
|
- **[Small - Residence](https://vimaec.github.io/vim-web/webgl)**
|
|
14
|
-
- **[Medium - Medical Tower](https://vimaec.github.io/vim-web/webgl?vim=https://
|
|
15
|
-
- **[Small - Stadium](https://vimaec.github.io/vim-web/webgl?vim=https://vim.azureedge.net/samples/stadium.vim)**
|
|
14
|
+
- **[Medium - Medical Tower](https://vimaec.github.io/vim-web/webgl?vim=https://storage.cdn.vimaec.com/samples/skanska.vim)**
|
|
16
15
|
|
|
17
16
|
### Ultra Viewer
|
|
18
17
|
- **[Small - Residence](https://vimaec.github.io/vim-web/ultra)**
|
|
19
|
-
- **[Medium - Medical Tower](https://vimaec.github.io/vim-web/ultra?vim=https://
|
|
20
|
-
- **[Small - Stadium](https://vimaec.github.io/vim-web/ultra?vim=https://vim.azureedge.net/samples/stadium.vim)**
|
|
18
|
+
- **[Medium - Medical Tower](https://vimaec.github.io/vim-web/ultra?vim=https://storage.cdn.vimaec.com/samples/skanska.vim)**
|
|
21
19
|
|
|
22
20
|
Find detailed camera controls here: [Camera Controls](https://docs.vimaec.com/docs/vim-cloud/webgl-navigation-and-controls-guide).
|
|
23
21
|
|
package/dist/style.css
CHANGED
|
@@ -786,6 +786,9 @@ video:where(.vim-component,.vim-component *) {
|
|
|
786
786
|
.-vc-mr-4 {
|
|
787
787
|
margin-right: -1rem;
|
|
788
788
|
}
|
|
789
|
+
.vc-mb-1 {
|
|
790
|
+
margin-bottom: 0.25rem;
|
|
791
|
+
}
|
|
789
792
|
.vc-mb-2 {
|
|
790
793
|
margin-bottom: 0.5rem;
|
|
791
794
|
}
|
|
@@ -807,8 +810,8 @@ video:where(.vim-component,.vim-component *) {
|
|
|
807
810
|
.vc-mt-2 {
|
|
808
811
|
margin-top: 0.5rem;
|
|
809
812
|
}
|
|
810
|
-
.vc-mt
|
|
811
|
-
margin-top:
|
|
813
|
+
.vc-mt-6 {
|
|
814
|
+
margin-top: 1.5rem;
|
|
812
815
|
}
|
|
813
816
|
.vc-box-content {
|
|
814
817
|
box-sizing: content-box;
|
|
@@ -873,12 +876,12 @@ video:where(.vim-component,.vim-component *) {
|
|
|
873
876
|
.vc-w-\[240px\] {
|
|
874
877
|
width: 240px;
|
|
875
878
|
}
|
|
879
|
+
.vc-w-\[424px\] {
|
|
880
|
+
width: 424px;
|
|
881
|
+
}
|
|
876
882
|
.vc-w-\[72\%\] {
|
|
877
883
|
width: 72%;
|
|
878
884
|
}
|
|
879
|
-
.vc-w-\[80\%\] {
|
|
880
|
-
width: 80%;
|
|
881
|
-
}
|
|
882
885
|
.vc-w-\[90\%\] {
|
|
883
886
|
width: 90%;
|
|
884
887
|
}
|
|
@@ -897,8 +900,8 @@ video:where(.vim-component,.vim-component *) {
|
|
|
897
900
|
.vc-max-w-\[320px\] {
|
|
898
901
|
max-width: 320px;
|
|
899
902
|
}
|
|
900
|
-
.vc-max-w-\[
|
|
901
|
-
max-width:
|
|
903
|
+
.vc-max-w-\[80\%\] {
|
|
904
|
+
max-width: 80%;
|
|
902
905
|
}
|
|
903
906
|
.vc-max-w-\[900px\] {
|
|
904
907
|
max-width: 900px;
|
|
@@ -1149,15 +1152,9 @@ video:where(.vim-component,.vim-component *) {
|
|
|
1149
1152
|
font-size: 0.75rem !important;
|
|
1150
1153
|
line-height: 1rem !important;
|
|
1151
1154
|
}
|
|
1152
|
-
.vc-text-\[12\.8px\] {
|
|
1153
|
-
font-size: 12.8px;
|
|
1154
|
-
}
|
|
1155
1155
|
.vc-text-\[16pt\] {
|
|
1156
1156
|
font-size: 16pt;
|
|
1157
1157
|
}
|
|
1158
|
-
.vc-text-\[20pt\] {
|
|
1159
|
-
font-size: 20pt;
|
|
1160
|
-
}
|
|
1161
1158
|
.vc-text-base {
|
|
1162
1159
|
font-size: 1rem;
|
|
1163
1160
|
line-height: 1.5rem;
|
|
@@ -1393,7 +1390,48 @@ video:where(.vim-component,.vim-component *) {
|
|
|
1393
1390
|
container-type: size;
|
|
1394
1391
|
}
|
|
1395
1392
|
|
|
1393
|
+
.vim-modal {
|
|
1394
|
+
container-type: size;
|
|
1395
|
+
}
|
|
1396
|
+
|
|
1396
1397
|
@container (width > 0px){
|
|
1398
|
+
.vim-message-box .vc-text-xs{
|
|
1399
|
+
font-size: min(5.5cqmin, 0.8rem);
|
|
1400
|
+
line-height: min(6.5cqmin, 1rem);
|
|
1401
|
+
}
|
|
1402
|
+
.vim-message-box .vc-text-sm{
|
|
1403
|
+
font-size: min(6cqmin, 0.875rem);
|
|
1404
|
+
line-height: min(6.5cqmin, 1rem);
|
|
1405
|
+
}
|
|
1406
|
+
.vim-message-box .vc-text-base{
|
|
1407
|
+
font-size: min(6.5cqmin, 1rem);
|
|
1408
|
+
line-height: min(7cqmin, 1.15rem);
|
|
1409
|
+
}
|
|
1410
|
+
.vim-message-box .vc-text-lg{
|
|
1411
|
+
font-size: min(7cqmin, 1.15rem);
|
|
1412
|
+
line-height: min(7.5cqmin, 1.25rem);
|
|
1413
|
+
}
|
|
1414
|
+
.vim-message-box .vc-text-xl{
|
|
1415
|
+
font-size: min(7.5cqmin, 1.25rem);
|
|
1416
|
+
line-height: min(8cqmin, 1.35rem);
|
|
1417
|
+
}
|
|
1418
|
+
.vim-message-box {
|
|
1419
|
+
padding: min(6cqmin, 1.5rem);
|
|
1420
|
+
}
|
|
1421
|
+
|
|
1422
|
+
.vim-message-box .vim-divider{
|
|
1423
|
+
margin-top: min(6cqmin, 1.5rem);
|
|
1424
|
+
margin-bottom: min(6cqmin, 1.5rem);
|
|
1425
|
+
}
|
|
1426
|
+
|
|
1427
|
+
.vim-message-box .vim-footer{
|
|
1428
|
+
margin-top: min(6cqmin, 1.5rem);
|
|
1429
|
+
}
|
|
1430
|
+
|
|
1431
|
+
.vim-message-box .vim-main-text{
|
|
1432
|
+
margin-bottom: min(6cqmin, 1.5rem);
|
|
1433
|
+
}
|
|
1434
|
+
|
|
1397
1435
|
.vim-side-panel-content {
|
|
1398
1436
|
font-size: min(5.5cqmin, 0.8rem);
|
|
1399
1437
|
left: min(5cqmin, 1rem);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Don't modify this file, the RPC generated code depends on its interface.
|
|
3
3
|
*/
|
|
4
|
-
import { Box3, RGB, RGBA, RGBA32, Segment, Vector2, Vector3 } from "../utils/math3d";
|
|
4
|
+
import { Box3, RGB, RGBA, RGBA32, Segment, Vector2, Vector3, Matrix44 } from "../utils/math3d";
|
|
5
5
|
export type HitCheckResult = {
|
|
6
6
|
vimHandle: number;
|
|
7
7
|
nodeIndex: number;
|
|
@@ -27,6 +27,8 @@ export declare class Marshal {
|
|
|
27
27
|
getBuffer(): ArrayBuffer;
|
|
28
28
|
private ensureCapacity;
|
|
29
29
|
writeData(data: ArrayBuffer): void;
|
|
30
|
+
writeMatrix44(data: Matrix44): void;
|
|
31
|
+
readMatrix44(): Matrix44;
|
|
30
32
|
writeBoolean(value: boolean): void;
|
|
31
33
|
readBoolean(): boolean;
|
|
32
34
|
writeInt(value: number): void;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { RGBA } from "../utils/math3d";
|
|
2
2
|
import { RpcSafeClient, SceneSettings } from "./rpcSafeClient";
|
|
3
|
+
import { ClientStreamError } from "./socketClient";
|
|
3
4
|
/**
|
|
4
5
|
* Render settings that extend SceneSettings with additional rendering-specific properties
|
|
5
6
|
*/
|
|
@@ -42,6 +43,11 @@ export declare class Renderer implements IRenderer {
|
|
|
42
43
|
* @param settings - Optional partial render settings to override defaults
|
|
43
44
|
*/
|
|
44
45
|
constructor(rpc: RpcSafeClient, settings?: Partial<RenderSettings>);
|
|
46
|
+
/**
|
|
47
|
+
* Validates the connection to the server by attempting to start a scene.
|
|
48
|
+
* @returns A promise that resolves to a ClientStreamError if the connection fails, or undefined if successful.
|
|
49
|
+
*/
|
|
50
|
+
validateConnection(): Promise<ClientStreamError | undefined>;
|
|
45
51
|
/**
|
|
46
52
|
* Initializes the renderer when connection is established
|
|
47
53
|
* Sets up initial scene settings, ghost color, and IBL rotation
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { SocketClient } from './socketClient';
|
|
2
2
|
import { HitCheckResult, VimStatus } from './marshal';
|
|
3
|
-
import { Box3, RGBA, RGBA32, Segment, Vector2, Vector3 } from '../utils/math3d';
|
|
3
|
+
import { Box3, RGBA, RGBA32, Segment, Vector2, Vector3, Matrix44 } from '../utils/math3d';
|
|
4
4
|
export type MaterialHandle = 4294967295 | 6 | 2 | 0 | 1 | 3 | 4 | 5 | 7 | 8;
|
|
5
5
|
export declare class MaterialHandles {
|
|
6
6
|
static readonly Invalid: MaterialHandle;
|
|
@@ -17,8 +17,10 @@ export declare class MaterialHandles {
|
|
|
17
17
|
export declare const materialHandles: MaterialHandle[];
|
|
18
18
|
export declare class RpcClient {
|
|
19
19
|
private readonly _messenger;
|
|
20
|
+
get url(): string;
|
|
20
21
|
constructor(_messenger: SocketClient);
|
|
21
|
-
readonly API_VERSION = "
|
|
22
|
+
readonly API_VERSION = "5.0.0";
|
|
23
|
+
RPCAddNodeFlags(componentHandle: number, nodes: number[], flags: number): void;
|
|
22
24
|
RPCClearMaterialOverrides(componentHandle: number): void;
|
|
23
25
|
RPCClearScene(): void;
|
|
24
26
|
RPCCreateMaterialInstances(materialHandle: number, smoothness: number, colors: RGBA32[]): Promise<number>;
|
|
@@ -33,6 +35,7 @@ export declare class RpcClient {
|
|
|
33
35
|
RPCGetAPIVersion(): Promise<string>;
|
|
34
36
|
RPCGetBoundingBox(componentHandle: number, nodes: number[]): Promise<Box3>;
|
|
35
37
|
RPCGetCameraPosition(): Promise<Segment>;
|
|
38
|
+
RPCGetIblRotation(): Promise<Matrix44>;
|
|
36
39
|
RPCGetLastError(): Promise<string>;
|
|
37
40
|
RPCGetVimLoadingState(componentHandle: number): Promise<VimStatus>;
|
|
38
41
|
RPCGhost(componentHandle: number, nodes: number[]): void;
|
|
@@ -55,10 +58,12 @@ export declare class RpcClient {
|
|
|
55
58
|
RPCMoveCameraTo(usePosition: boolean, useTarget: boolean, position: Vector3, target: Vector3, blendTime: number): void;
|
|
56
59
|
RPCPauseRendering(pause: boolean): void;
|
|
57
60
|
RPCPerformHitTest(pos: Vector2): Promise<HitCheckResult>;
|
|
61
|
+
RPCRemoveNodeFlags(componentHandle: number, nodes: number[], flags: number): void;
|
|
58
62
|
RPCSetAspectRatio(width: number, height: number): void;
|
|
59
63
|
RPCSetCameraMode(orbit: boolean): void;
|
|
60
64
|
RPCSetCameraPosition(state: Segment, blendTime: number): void;
|
|
61
65
|
RPCSetGhostColor(ghostColor: RGBA): void;
|
|
66
|
+
RPCSetIblRotation(transform: Matrix44): void;
|
|
62
67
|
RPCSetLighting(toneMappingWhitePoint: number, hdrScale: number, hdrBackgroundScale: number, hdrBackgroundSaturation: number, backgroundBlur: number, backgroundColor: RGBA): void;
|
|
63
68
|
RPCSetMaterialOverrides(componentHandle: number, nodes: number[], materialInstanceHandles: number[]): void;
|
|
64
69
|
RPCSetMoveSpeed(speed: number): void;
|
|
@@ -66,7 +71,7 @@ export declare class RpcClient {
|
|
|
66
71
|
RPCShow(componentHandle: number, nodes: number[]): void;
|
|
67
72
|
RPCShowAABBs(componentHandle: number, nodes: number[], colors: RGBA32[]): void;
|
|
68
73
|
RPCShowAll(componentHandle: number): void;
|
|
69
|
-
RPCStartScene(toneMappingWhitePoint: number, hdrScale: number, hdrBackgroundScale: number, hdrBackgroundSaturation: number, backgroundBlur: number, backgroundColor: RGBA):
|
|
74
|
+
RPCStartScene(toneMappingWhitePoint: number, hdrScale: number, hdrBackgroundScale: number, hdrBackgroundSaturation: number, backgroundBlur: number, backgroundColor: RGBA): Promise<boolean>;
|
|
70
75
|
RPCTriggerRenderDocCapture(): void;
|
|
71
76
|
RPCUnloadVim(componentHandle: number): void;
|
|
72
77
|
}
|
|
@@ -33,6 +33,7 @@ export declare enum VimLoadingStatus {
|
|
|
33
33
|
export declare class RpcSafeClient {
|
|
34
34
|
private readonly rpc;
|
|
35
35
|
private readonly batchSize;
|
|
36
|
+
get url(): string;
|
|
36
37
|
constructor(rpc: RpcClient, batchSize?: number);
|
|
37
38
|
/*******************************************************************************
|
|
38
39
|
* SCENE MANAGEMENT METHODS
|
|
@@ -44,7 +45,7 @@ export declare class RpcSafeClient {
|
|
|
44
45
|
* @param settings - Optional partial scene settings to override defaults
|
|
45
46
|
* @remarks If no settings are provided, default values will be used
|
|
46
47
|
*/
|
|
47
|
-
RPCStartScene(settings?: Partial<SceneSettings>):
|
|
48
|
+
RPCStartScene(settings?: Partial<SceneSettings>): Promise<boolean>;
|
|
48
49
|
/**
|
|
49
50
|
* Sets the lighting settings for the scene.
|
|
50
51
|
* @param settings - The lighting settings to apply
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import * as Protocol from './protocol';
|
|
2
2
|
import { Marshal } from './marshal';
|
|
3
3
|
import { ILogger } from './logger';
|
|
4
|
-
export type ClientState = ClientStateConnecting | ClientStateConnected | ClientStateDisconnected | ClientError;
|
|
5
|
-
export type ClientError = ClientStateCompatibilityError | ClientStateConnectionError;
|
|
4
|
+
export type ClientState = ClientStateConnecting | ClientStateConnected | ClientStateDisconnected | ClientStateValidating | ClientError;
|
|
5
|
+
export type ClientError = ClientStateCompatibilityError | ClientStateConnectionError | ClientStreamError;
|
|
6
6
|
export type ClientStateConnecting = {
|
|
7
7
|
status: 'connecting';
|
|
8
8
|
};
|
|
9
|
+
export type ClientStateValidating = {
|
|
10
|
+
status: 'validating';
|
|
11
|
+
};
|
|
9
12
|
export type ClientStateConnected = {
|
|
10
13
|
status: 'connected';
|
|
11
14
|
};
|
|
@@ -24,6 +27,12 @@ export type ClientStateConnectionError = {
|
|
|
24
27
|
error: 'connection';
|
|
25
28
|
serverUrl: string;
|
|
26
29
|
};
|
|
30
|
+
export type ClientStreamError = {
|
|
31
|
+
status: 'error';
|
|
32
|
+
error: 'stream';
|
|
33
|
+
serverUrl: string;
|
|
34
|
+
details: string;
|
|
35
|
+
};
|
|
27
36
|
export declare enum FrameType {
|
|
28
37
|
VideoKeyFrame = 0,
|
|
29
38
|
VideoDeltaFrame = 1,
|
|
@@ -40,11 +49,11 @@ export declare class SocketClient {
|
|
|
40
49
|
private readonly _streamLogger;
|
|
41
50
|
private readonly _logger;
|
|
42
51
|
private _socket;
|
|
43
|
-
private readonly _queue;
|
|
44
52
|
private readonly _pendingRPCs;
|
|
45
53
|
private _rpcCallId;
|
|
46
54
|
private _reconnectTimeout;
|
|
47
55
|
private _connectionTimeout;
|
|
56
|
+
private _validateConnection;
|
|
48
57
|
/**
|
|
49
58
|
* Callback function to handle incoming video frames.
|
|
50
59
|
* @param msg - The video frame message received from the server.
|
|
@@ -77,8 +86,9 @@ export declare class SocketClient {
|
|
|
77
86
|
/**
|
|
78
87
|
* Constructs a new Messenger instance.
|
|
79
88
|
* @param logger - The logger for logging messages.
|
|
89
|
+
* @param checks - checks to perform before returning connection.
|
|
80
90
|
*/
|
|
81
|
-
constructor(logger: ILogger);
|
|
91
|
+
constructor(logger: ILogger, validateConnection: () => Promise<ClientError | undefined>);
|
|
82
92
|
/**
|
|
83
93
|
* Connects to a WebSocket server at the specified URL.
|
|
84
94
|
* @param url - The WebSocket URL to connect to.
|
|
@@ -85,6 +85,7 @@ export declare class Viewer {
|
|
|
85
85
|
* Initializes components and checks for API version compatibility.
|
|
86
86
|
*/
|
|
87
87
|
private onConnect;
|
|
88
|
+
private validateConnection;
|
|
88
89
|
private checkAPIVersion;
|
|
89
90
|
/**
|
|
90
91
|
* Handles disconnection logic when the viewer disconnects from the server.
|
|
@@ -30,7 +30,7 @@ export declare namespace Geometry {
|
|
|
30
30
|
* @param instances indices of the instances from the g3d to merge
|
|
31
31
|
* @returns a BufferGeometry
|
|
32
32
|
*/
|
|
33
|
-
function createGeometryFromInstances(g3d: G3d, args: MergeArgs): THREE.BufferGeometry
|
|
33
|
+
function createGeometryFromInstances(g3d: G3d, args: MergeArgs): THREE.BufferGeometry<THREE.NormalBufferAttributes>;
|
|
34
34
|
/**
|
|
35
35
|
* Creates a BufferGeometry from a given mesh index in the g3d
|
|
36
36
|
* @param mesh g3d mesh index
|
|
@@ -90,7 +90,7 @@ export declare namespace Geometry {
|
|
|
90
90
|
colorSize: number;
|
|
91
91
|
boxes: THREE.Box3[];
|
|
92
92
|
constructor(info: MergeInfo, positionSize: number, colorSize: number);
|
|
93
|
-
toBufferGeometry(): THREE.BufferGeometry
|
|
93
|
+
toBufferGeometry(): THREE.BufferGeometry<THREE.NormalBufferAttributes>;
|
|
94
94
|
}
|
|
95
95
|
/**
|
|
96
96
|
* Holds the result from a merge operation.
|
|
@@ -7,27 +7,69 @@ export declare class OutlineMaterial {
|
|
|
7
7
|
material: THREE.ShaderMaterial;
|
|
8
8
|
private _camera;
|
|
9
9
|
private _resolution;
|
|
10
|
+
private _precision;
|
|
11
|
+
private _antialias;
|
|
10
12
|
constructor(options?: Partial<{
|
|
11
13
|
sceneBuffer: THREE.Texture;
|
|
12
14
|
resolution: THREE.Vector2;
|
|
15
|
+
precision: number;
|
|
16
|
+
antialias: boolean;
|
|
13
17
|
camera: THREE.PerspectiveCamera | THREE.OrthographicCamera;
|
|
14
18
|
}>);
|
|
19
|
+
/**
|
|
20
|
+
* Enable antialiasing for the outline.
|
|
21
|
+
* This is actually applied in the rendering composer.
|
|
22
|
+
*/
|
|
23
|
+
get antialias(): boolean;
|
|
24
|
+
set antialias(value: boolean);
|
|
25
|
+
/**
|
|
26
|
+
* Precision of the outline. This is used to scale the resolution of the outline.
|
|
27
|
+
*/
|
|
28
|
+
get precision(): number;
|
|
29
|
+
set precision(value: number);
|
|
30
|
+
/**
|
|
31
|
+
* Resolution of the outline. This should match the resolution of screen.
|
|
32
|
+
*/
|
|
15
33
|
get resolution(): THREE.Vector2;
|
|
16
34
|
set resolution(value: THREE.Vector2);
|
|
35
|
+
/**
|
|
36
|
+
* Camera used to render the outline.
|
|
37
|
+
*/
|
|
17
38
|
get camera(): THREE.PerspectiveCamera | THREE.OrthographicCamera | undefined;
|
|
18
39
|
set camera(value: THREE.PerspectiveCamera | THREE.OrthographicCamera | undefined);
|
|
40
|
+
/**
|
|
41
|
+
* Blur of the outline. This is used to smooth the outline.
|
|
42
|
+
*/
|
|
19
43
|
get strokeBlur(): number;
|
|
20
44
|
set strokeBlur(value: number);
|
|
45
|
+
/**
|
|
46
|
+
* Bias of the outline. This is used to control the strength of the outline.
|
|
47
|
+
*/
|
|
21
48
|
get strokeBias(): number;
|
|
22
49
|
set strokeBias(value: number);
|
|
50
|
+
/**
|
|
51
|
+
* Multiplier of the outline. This is used to control the strength of the outline.
|
|
52
|
+
*/
|
|
23
53
|
get strokeMultiplier(): number;
|
|
24
54
|
set strokeMultiplier(value: number);
|
|
55
|
+
/**
|
|
56
|
+
* Color of the outline.
|
|
57
|
+
*/
|
|
25
58
|
get color(): THREE.Color;
|
|
26
59
|
set color(value: THREE.Color);
|
|
60
|
+
/**
|
|
61
|
+
* Scene buffer used to render the outline.
|
|
62
|
+
*/
|
|
27
63
|
get sceneBuffer(): THREE.Texture;
|
|
28
64
|
set sceneBuffer(value: THREE.Texture);
|
|
65
|
+
/**
|
|
66
|
+
* Depth buffer used to render the outline.
|
|
67
|
+
*/
|
|
29
68
|
get depthBuffer(): THREE.Texture;
|
|
30
69
|
set depthBuffer(value: THREE.Texture);
|
|
70
|
+
/**
|
|
71
|
+
* Dispose of the outline material.
|
|
72
|
+
*/
|
|
31
73
|
dispose(): void;
|
|
32
74
|
}
|
|
33
75
|
/**
|
|
@@ -12,26 +12,26 @@ export declare function createOpaque(): StandardMaterial;
|
|
|
12
12
|
export declare function createTransparent(): StandardMaterial;
|
|
13
13
|
/**
|
|
14
14
|
* Creates a new instance of the default loader opaque material.
|
|
15
|
-
* @returns {THREE.
|
|
15
|
+
* @returns {THREE.MeshLambertMaterial} A new instance of MeshLambertMaterial with transparency.
|
|
16
16
|
*/
|
|
17
|
-
export declare function createBasicOpaque(): THREE.
|
|
17
|
+
export declare function createBasicOpaque(): THREE.MeshLambertMaterial;
|
|
18
18
|
/**
|
|
19
19
|
* Creates a new instance of the default loader transparent material.
|
|
20
20
|
* @returns {THREE.MeshPhongMaterial} A new instance of MeshPhongMaterial with transparency.
|
|
21
21
|
*/
|
|
22
|
-
export declare function createBasicTransparent(): THREE.
|
|
22
|
+
export declare function createBasicTransparent(): THREE.MeshLambertMaterial;
|
|
23
23
|
/**
|
|
24
24
|
* Material used for both opaque and tranparent surfaces of a VIM model.
|
|
25
25
|
*/
|
|
26
26
|
export declare class StandardMaterial {
|
|
27
|
-
material: THREE.
|
|
27
|
+
material: THREE.Material;
|
|
28
28
|
uniforms: ShaderUniforms | undefined;
|
|
29
29
|
_focusIntensity: number;
|
|
30
30
|
_focusColor: THREE.Color;
|
|
31
31
|
_sectionStrokeWitdh: number;
|
|
32
32
|
_sectionStrokeFallof: number;
|
|
33
33
|
_sectionStrokeColor: THREE.Color;
|
|
34
|
-
constructor(material: THREE.
|
|
34
|
+
constructor(material: THREE.Material);
|
|
35
35
|
get color(): THREE.Color;
|
|
36
36
|
set color(color: THREE.Color);
|
|
37
37
|
get focusIntensity(): number;
|
|
@@ -127,6 +127,8 @@ export declare class ViewerMaterials {
|
|
|
127
127
|
*/
|
|
128
128
|
get outlineColor(): THREE.Color;
|
|
129
129
|
set outlineColor(value: THREE.Color);
|
|
130
|
+
get outlineAntialias(): boolean;
|
|
131
|
+
set outlineAntialias(value: boolean);
|
|
130
132
|
/**
|
|
131
133
|
* Size of the blur convolution on the selection outline effect.
|
|
132
134
|
*/
|
|
@@ -74,7 +74,7 @@ export type MergedSubmesh = StandardSubmesh | InsertableSubmesh;
|
|
|
74
74
|
export type Submesh = MergedSubmesh | InstancedSubmesh;
|
|
75
75
|
export declare class SimpleInstanceSubmesh {
|
|
76
76
|
mesh: THREE.InstancedMesh;
|
|
77
|
-
get three(): THREE.InstancedMesh<THREE.BufferGeometry
|
|
77
|
+
get three(): THREE.InstancedMesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.InstancedMeshEventMap>;
|
|
78
78
|
index: number;
|
|
79
79
|
readonly merged = false;
|
|
80
80
|
constructor(mesh: THREE.InstancedMesh, index: number);
|
|
@@ -87,7 +87,7 @@ export declare class StandardSubmesh {
|
|
|
87
87
|
/**
|
|
88
88
|
* Returns parent three mesh.
|
|
89
89
|
*/
|
|
90
|
-
get three(): THREE.Mesh<THREE.BufferGeometry
|
|
90
|
+
get three(): THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>;
|
|
91
91
|
/**
|
|
92
92
|
* True if parent mesh is merged.
|
|
93
93
|
*/
|
|
@@ -20,6 +20,8 @@ export declare class G3dSubset {
|
|
|
20
20
|
* @param instances source-based instance indices of included instances.
|
|
21
21
|
*/
|
|
22
22
|
constructor(source: G3dScene | G3d, instances?: number[]);
|
|
23
|
+
chunks(count: number): G3dSubset[];
|
|
24
|
+
/**
|
|
23
25
|
/**
|
|
24
26
|
* Returns total instance count in subset.
|
|
25
27
|
*/
|
|
@@ -81,7 +83,7 @@ export declare class G3dSubset {
|
|
|
81
83
|
* Returns a new subset that only contains non-unique meshes.
|
|
82
84
|
*/
|
|
83
85
|
filterNonUniqueMeshes(): G3dSubset;
|
|
84
|
-
|
|
86
|
+
filterByCount(predicate: (i: number) => boolean): G3dSubset;
|
|
85
87
|
/**
|
|
86
88
|
* Returns offsets needed to build geometry.
|
|
87
89
|
*/
|
|
@@ -12,7 +12,7 @@ export declare class InsertableSubmesh {
|
|
|
12
12
|
/**
|
|
13
13
|
* Returns parent three mesh.
|
|
14
14
|
*/
|
|
15
|
-
get three(): import("three").Mesh<import("three").BufferGeometry
|
|
15
|
+
get three(): import("three").Mesh<import("three").BufferGeometry<import("three").NormalBufferAttributes>, import("three").Material | import("three").Material[], import("three").Object3DEventMap>;
|
|
16
16
|
/**
|
|
17
17
|
* True if parent mesh is merged.
|
|
18
18
|
*/
|
|
@@ -11,7 +11,7 @@ export declare class InstancedSubmesh {
|
|
|
11
11
|
/**
|
|
12
12
|
* Returns parent three mesh.
|
|
13
13
|
*/
|
|
14
|
-
get three(): import("three").InstancedMesh<import("three").BufferGeometry
|
|
14
|
+
get three(): import("three").InstancedMesh<import("three").BufferGeometry<import("three").NormalBufferAttributes>, import("three").Material | import("three").Material[], import("three").InstancedMeshEventMap>;
|
|
15
15
|
/**
|
|
16
16
|
* True if parent mesh is merged.
|
|
17
17
|
*/
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
* @module utils
|
|
3
3
|
*/
|
|
4
4
|
import * as THREE from 'three';
|
|
5
|
-
export declare function createBoxes(boxes: THREE.Box3[]): THREE.InstancedMesh<THREE.BoxGeometry, THREE.MeshBasicMaterial>;
|
|
5
|
+
export declare function createBoxes(boxes: THREE.Box3[]): THREE.InstancedMesh<THREE.BoxGeometry, THREE.MeshBasicMaterial, THREE.InstancedMeshEventMap>;
|
|
@@ -35,5 +35,5 @@ export declare class BoxInputs {
|
|
|
35
35
|
onMouseDown(event: PointerEvent): void;
|
|
36
36
|
onDrag(event: any): void;
|
|
37
37
|
stretch(normal: THREE.Vector3, amount: number): THREE.Box3;
|
|
38
|
-
raycast(position: THREE.Vector2, reverse: boolean): THREE.Intersection<THREE.Object3D<THREE.
|
|
38
|
+
raycast(position: THREE.Vector2, reverse: boolean): THREE.Intersection<THREE.Object3D<THREE.Object3DEventMap>>[];
|
|
39
39
|
}
|
|
@@ -11,7 +11,7 @@ import { GizmoMarker } from './gizmos/markers/gizmoMarker';
|
|
|
11
11
|
/**
|
|
12
12
|
* Type alias for THREE intersection array
|
|
13
13
|
*/
|
|
14
|
-
export type ThreeIntersectionList = THREE.Intersection<THREE.Object3D<THREE.
|
|
14
|
+
export type ThreeIntersectionList = THREE.Intersection<THREE.Object3D<THREE.Object3DEventMap>>[];
|
|
15
15
|
export type ActionType = 'main' | 'double' | 'idle';
|
|
16
16
|
export type ActionModifier = 'none' | 'shift' | 'ctrl';
|
|
17
17
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @module viw-webgl-viewer/rendering
|
|
3
3
|
*/
|
|
4
|
-
import THREE from 'three';
|
|
4
|
+
import * as THREE from 'three';
|
|
5
5
|
import { Pass } from 'three/examples/jsm/postprocessing/Pass';
|
|
6
6
|
import { ViewerMaterials } from '../../loader/materials/viewerMaterials';
|
|
7
7
|
/**
|
|
@@ -11,6 +11,8 @@ export declare class MergePass extends Pass {
|
|
|
11
11
|
private _fsQuad;
|
|
12
12
|
private _material;
|
|
13
13
|
constructor(source: THREE.Texture, materials?: ViewerMaterials);
|
|
14
|
+
get source(): THREE.Texture;
|
|
15
|
+
set source(value: THREE.Texture);
|
|
14
16
|
dispose(): void;
|
|
15
17
|
render(renderer: THREE.WebGLRenderer, writeBuffer: THREE.WebGLRenderTarget, readBuffer: THREE.WebGLRenderTarget): void;
|
|
16
18
|
}
|
|
@@ -10,7 +10,7 @@ import { OutlineMaterial } from '../../loader/materials/outlineMaterial';
|
|
|
10
10
|
export declare class OutlinePass extends Pass {
|
|
11
11
|
private _fsQuad;
|
|
12
12
|
material: OutlineMaterial;
|
|
13
|
-
constructor(
|
|
13
|
+
constructor(camera: THREE.PerspectiveCamera | THREE.OrthographicCamera, material?: OutlineMaterial);
|
|
14
14
|
setSize(width: number, height: number): void;
|
|
15
15
|
get camera(): THREE.PerspectiveCamera | THREE.OrthographicCamera;
|
|
16
16
|
set camera(value: THREE.PerspectiveCamera | THREE.OrthographicCamera);
|
|
@@ -13,6 +13,8 @@ export declare class RenderScene {
|
|
|
13
13
|
private _boundingBox;
|
|
14
14
|
private _memory;
|
|
15
15
|
private _2dCount;
|
|
16
|
+
private _material;
|
|
17
|
+
get models(): (import("../..").InsertableMesh | import("../../loader/mesh").Mesh | import("../../loader/progressive/instancedMesh").InstancedMesh)[];
|
|
16
18
|
constructor();
|
|
17
19
|
get estimatedMemory(): number;
|
|
18
20
|
has2dObjects(): boolean;
|
|
@@ -43,6 +45,8 @@ export declare class RenderScene {
|
|
|
43
45
|
* Removes all rendered objects
|
|
44
46
|
*/
|
|
45
47
|
clear(): void;
|
|
48
|
+
get material(): THREE.Material;
|
|
49
|
+
set material(material: THREE.Material);
|
|
46
50
|
private addScene;
|
|
47
51
|
updateBox(box: THREE.Box3 | undefined): void;
|
|
48
52
|
private removeScene;
|
|
@@ -42,6 +42,10 @@ export declare class Renderer implements IRenderer {
|
|
|
42
42
|
private _onBoxUpdated;
|
|
43
43
|
private _sceneUpdated;
|
|
44
44
|
private maxMemory;
|
|
45
|
+
/**
|
|
46
|
+
* Indicates whether the scene should be re-rendered on change only.
|
|
47
|
+
*/
|
|
48
|
+
onDemand: boolean;
|
|
45
49
|
/**
|
|
46
50
|
* Indicates whether the scene needs to be re-rendered.
|
|
47
51
|
* Can only be set to true. Cleared on each render.
|