@illgrenoble/webx-client 1.9.3 → 1.9.5
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/display/WebXMaterial.d.ts +0 -1
- package/dist/display/WebXMaterial.js +0 -3
- package/dist/display/WebXMaterial.js.map +1 -1
- package/dist/display/WebXWindow.js +4 -0
- package/dist/display/WebXWindow.js.map +1 -1
- package/dist/input/GuacamoleKeyboard.js +118 -99
- package/dist/input/WebXKeyboard.d.ts +0 -16
- package/dist/input/WebXKeyboard.js +3 -26
- package/dist/input/WebXKeyboard.js.map +1 -1
- package/package.json +1 -1
- package/dist/display/WebXMaterialProvider.d.ts +0 -8
- package/dist/display/WebXMaterialProvider.js +0 -71
- package/dist/display/WebXMaterialProvider.js.map +0 -1
- package/dist/input/WebXNewKeyboard.d.ts +0 -62
- package/dist/input/WebXNewKeyboard.js +0 -94
- package/dist/input/WebXNewKeyboard.js.map +0 -1
- package/dist/input/keyboard/WebXKeyEvent.d.ts +0 -79
- package/dist/input/keyboard/WebXKeyEvent.js +0 -324
- package/dist/input/keyboard/WebXKeyEvent.js.map +0 -1
- package/dist/input/keyboard/WebXKeyPressEvent.d.ts +0 -30
- package/dist/input/keyboard/WebXKeyPressEvent.js +0 -44
- package/dist/input/keyboard/WebXKeyPressEvent.js.map +0 -1
- package/dist/input/keyboard/WebXKeyUpEvent.d.ts +0 -33
- package/dist/input/keyboard/WebXKeyUpEvent.js +0 -31
- package/dist/input/keyboard/WebXKeyUpEvent.js.map +0 -1
- package/dist/input/keyboard/WebXKeyboardModifierState.d.ts +0 -108
- package/dist/input/keyboard/WebXKeyboardModifierState.js +0 -148
- package/dist/input/keyboard/WebXKeyboardModifierState.js.map +0 -1
- package/dist/input/keyboard/WebXKeyboardUtils.d.ts +0 -25
- package/dist/input/keyboard/WebXKeyboardUtils.js +0 -63
- package/dist/input/keyboard/WebXKeyboardUtils.js.map +0 -1
- package/dist/input/keyboard/WebXKeydownEvent.d.ts +0 -46
- package/dist/input/keyboard/WebXKeydownEvent.js +0 -66
- package/dist/input/keyboard/WebXKeydownEvent.js.map +0 -1
- package/dist/input/keyboard/index.d.ts +0 -6
- package/dist/input/keyboard/index.js +0 -23
- package/dist/input/keyboard/index.js.map +0 -1
- package/dist/lib/GuacamoleKeyboard.js +0 -1290
- package/dist/lib/GuacamoleKeyboard.js.map +0 -1
- package/dist/message/WebXPollMessage.d.ts +0 -4
- package/dist/message/WebXPollMessage.js +0 -12
- package/dist/message/WebXPollMessage.js.map +0 -1
- package/dist/src/WebXClient.d.ts +0 -261
- package/dist/src/WebXClient.js +0 -571
- package/dist/src/WebXClient.js.map +0 -1
- package/dist/src/WebXEngine.d.ts +0 -4
- package/dist/src/WebXEngine.js +0 -7
- package/dist/src/WebXEngine.js.map +0 -1
- package/dist/src/display/WebXCursor.d.ts +0 -88
- package/dist/src/display/WebXCursor.js +0 -150
- package/dist/src/display/WebXCursor.js.map +0 -1
- package/dist/src/display/WebXCursorFactory.d.ts +0 -36
- package/dist/src/display/WebXCursorFactory.js +0 -59
- package/dist/src/display/WebXCursorFactory.js.map +0 -1
- package/dist/src/display/WebXDisplay.d.ts +0 -226
- package/dist/src/display/WebXDisplay.js +0 -424
- package/dist/src/display/WebXDisplay.js.map +0 -1
- package/dist/src/display/WebXMaterial.d.ts +0 -14
- package/dist/src/display/WebXMaterial.js +0 -140
- package/dist/src/display/WebXMaterial.js.map +0 -1
- package/dist/src/display/WebXSubImage.d.ts +0 -50
- package/dist/src/display/WebXSubImage.js +0 -26
- package/dist/src/display/WebXSubImage.js.map +0 -1
- package/dist/src/display/WebXTextureFactory.d.ts +0 -54
- package/dist/src/display/WebXTextureFactory.js +0 -160
- package/dist/src/display/WebXTextureFactory.js.map +0 -1
- package/dist/src/display/WebXWindow.d.ts +0 -241
- package/dist/src/display/WebXWindow.js +0 -438
- package/dist/src/display/WebXWindow.js.map +0 -1
- package/dist/src/display/WebXWindowProperties.d.ts +0 -44
- package/dist/src/display/WebXWindowProperties.js +0 -25
- package/dist/src/display/WebXWindowProperties.js.map +0 -1
- package/dist/src/display/index.d.ts +0 -7
- package/dist/src/display/index.js +0 -24
- package/dist/src/display/index.js.map +0 -1
- package/dist/src/index.d.ts +0 -7
- package/dist/src/index.js +0 -24
- package/dist/src/index.js.map +0 -1
- package/dist/src/input/WebXKeyboard.d.ts +0 -265
- package/dist/src/input/WebXKeyboard.js +0 -632
- package/dist/src/input/WebXKeyboard.js.map +0 -1
- package/dist/src/input/WebXMouse.d.ts +0 -125
- package/dist/src/input/WebXMouse.js +0 -231
- package/dist/src/input/WebXMouse.js.map +0 -1
- package/dist/src/input/index.d.ts +0 -4
- package/dist/src/input/index.js +0 -21
- package/dist/src/input/index.js.map +0 -1
- package/dist/src/input/keyboard/WebXKeyEvent.d.ts +0 -79
- package/dist/src/input/keyboard/WebXKeyEvent.js +0 -324
- package/dist/src/input/keyboard/WebXKeyEvent.js.map +0 -1
- package/dist/src/input/keyboard/WebXKeyPressEvent.d.ts +0 -30
- package/dist/src/input/keyboard/WebXKeyPressEvent.js +0 -44
- package/dist/src/input/keyboard/WebXKeyPressEvent.js.map +0 -1
- package/dist/src/input/keyboard/WebXKeyUpEvent.d.ts +0 -33
- package/dist/src/input/keyboard/WebXKeyUpEvent.js +0 -31
- package/dist/src/input/keyboard/WebXKeyUpEvent.js.map +0 -1
- package/dist/src/input/keyboard/WebXKeyboardModifierState.d.ts +0 -108
- package/dist/src/input/keyboard/WebXKeyboardModifierState.js +0 -148
- package/dist/src/input/keyboard/WebXKeyboardModifierState.js.map +0 -1
- package/dist/src/input/keyboard/WebXKeyboardUtils.d.ts +0 -25
- package/dist/src/input/keyboard/WebXKeyboardUtils.js +0 -63
- package/dist/src/input/keyboard/WebXKeyboardUtils.js.map +0 -1
- package/dist/src/input/keyboard/WebXKeydownEvent.d.ts +0 -46
- package/dist/src/input/keyboard/WebXKeydownEvent.js +0 -66
- package/dist/src/input/keyboard/WebXKeydownEvent.js.map +0 -1
- package/dist/src/input/keyboard/index.d.ts +0 -6
- package/dist/src/input/keyboard/index.js +0 -23
- package/dist/src/input/keyboard/index.js.map +0 -1
- package/dist/src/input/mouse/WebXMouseState.d.ts +0 -190
- package/dist/src/input/mouse/WebXMouseState.js +0 -217
- package/dist/src/input/mouse/WebXMouseState.js.map +0 -1
- package/dist/src/input/mouse/index.d.ts +0 -1
- package/dist/src/input/mouse/index.js +0 -18
- package/dist/src/input/mouse/index.js.map +0 -1
- package/dist/src/instruction/WebXClipboardInstruction.d.ts +0 -18
- package/dist/src/instruction/WebXClipboardInstruction.js +0 -23
- package/dist/src/instruction/WebXClipboardInstruction.js.map +0 -1
- package/dist/src/instruction/WebXConnectInstruction.d.ts +0 -19
- package/dist/src/instruction/WebXConnectInstruction.js +0 -24
- package/dist/src/instruction/WebXConnectInstruction.js.map +0 -1
- package/dist/src/instruction/WebXCursorImageInstruction.d.ts +0 -18
- package/dist/src/instruction/WebXCursorImageInstruction.js +0 -23
- package/dist/src/instruction/WebXCursorImageInstruction.js.map +0 -1
- package/dist/src/instruction/WebXDataAckInstruction.d.ts +0 -25
- package/dist/src/instruction/WebXDataAckInstruction.js +0 -26
- package/dist/src/instruction/WebXDataAckInstruction.js.map +0 -1
- package/dist/src/instruction/WebXImageInstruction.d.ts +0 -18
- package/dist/src/instruction/WebXImageInstruction.js +0 -23
- package/dist/src/instruction/WebXImageInstruction.js.map +0 -1
- package/dist/src/instruction/WebXInstruction.d.ts +0 -29
- package/dist/src/instruction/WebXInstruction.js +0 -28
- package/dist/src/instruction/WebXInstruction.js.map +0 -1
- package/dist/src/instruction/WebXInstructionResponse.d.ts +0 -66
- package/dist/src/instruction/WebXInstructionResponse.js +0 -78
- package/dist/src/instruction/WebXInstructionResponse.js.map +0 -1
- package/dist/src/instruction/WebXInstructionType.d.ts +0 -63
- package/dist/src/instruction/WebXInstructionType.js +0 -96
- package/dist/src/instruction/WebXInstructionType.js.map +0 -1
- package/dist/src/instruction/WebXKeyboardInstruction.d.ts +0 -23
- package/dist/src/instruction/WebXKeyboardInstruction.js +0 -25
- package/dist/src/instruction/WebXKeyboardInstruction.js.map +0 -1
- package/dist/src/instruction/WebXMouseInstruction.d.ts +0 -28
- package/dist/src/instruction/WebXMouseInstruction.js +0 -27
- package/dist/src/instruction/WebXMouseInstruction.js.map +0 -1
- package/dist/src/instruction/WebXPongInstruction.d.ts +0 -18
- package/dist/src/instruction/WebXPongInstruction.js +0 -23
- package/dist/src/instruction/WebXPongInstruction.js.map +0 -1
- package/dist/src/instruction/WebXQualityInstruction.d.ts +0 -19
- package/dist/src/instruction/WebXQualityInstruction.js +0 -24
- package/dist/src/instruction/WebXQualityInstruction.js.map +0 -1
- package/dist/src/instruction/WebXScreenInstruction.d.ts +0 -12
- package/dist/src/instruction/WebXScreenInstruction.js +0 -20
- package/dist/src/instruction/WebXScreenInstruction.js.map +0 -1
- package/dist/src/instruction/WebXShapeInstruction.d.ts +0 -18
- package/dist/src/instruction/WebXShapeInstruction.js +0 -23
- package/dist/src/instruction/WebXShapeInstruction.js.map +0 -1
- package/dist/src/instruction/WebXWindowsInstruction.d.ts +0 -13
- package/dist/src/instruction/WebXWindowsInstruction.js +0 -21
- package/dist/src/instruction/WebXWindowsInstruction.js.map +0 -1
- package/dist/src/instruction/index.d.ts +0 -15
- package/dist/src/instruction/index.js +0 -32
- package/dist/src/instruction/index.js.map +0 -1
- package/dist/src/message/WebXClipboardMessage.d.ts +0 -19
- package/dist/src/message/WebXClipboardMessage.js +0 -23
- package/dist/src/message/WebXClipboardMessage.js.map +0 -1
- package/dist/src/message/WebXConnectionMessage.d.ts +0 -12
- package/dist/src/message/WebXConnectionMessage.js +0 -20
- package/dist/src/message/WebXConnectionMessage.js.map +0 -1
- package/dist/src/message/WebXCursorImageMessage.d.ts +0 -46
- package/dist/src/message/WebXCursorImageMessage.js +0 -35
- package/dist/src/message/WebXCursorImageMessage.js.map +0 -1
- package/dist/src/message/WebXImageMessage.d.ts +0 -41
- package/dist/src/message/WebXImageMessage.js +0 -33
- package/dist/src/message/WebXImageMessage.js.map +0 -1
- package/dist/src/message/WebXMessage.d.ts +0 -24
- package/dist/src/message/WebXMessage.js +0 -23
- package/dist/src/message/WebXMessage.js.map +0 -1
- package/dist/src/message/WebXMessageType.d.ts +0 -59
- package/dist/src/message/WebXMessageType.js +0 -64
- package/dist/src/message/WebXMessageType.js.map +0 -1
- package/dist/src/message/WebXMouseMessage.d.ts +0 -30
- package/dist/src/message/WebXMouseMessage.js +0 -29
- package/dist/src/message/WebXMouseMessage.js.map +0 -1
- package/dist/src/message/WebXNopMessage.d.ts +0 -10
- package/dist/src/message/WebXNopMessage.js +0 -18
- package/dist/src/message/WebXNopMessage.js.map +0 -1
- package/dist/src/message/WebXPingMessage.d.ts +0 -13
- package/dist/src/message/WebXPingMessage.js +0 -21
- package/dist/src/message/WebXPingMessage.js.map +0 -1
- package/dist/src/message/WebXQualityMessage.d.ts +0 -39
- package/dist/src/message/WebXQualityMessage.js +0 -32
- package/dist/src/message/WebXQualityMessage.js.map +0 -1
- package/dist/src/message/WebXScreenMessage.d.ts +0 -37
- package/dist/src/message/WebXScreenMessage.js +0 -29
- package/dist/src/message/WebXScreenMessage.js.map +0 -1
- package/dist/src/message/WebXShapeMessage.d.ts +0 -31
- package/dist/src/message/WebXShapeMessage.js +0 -29
- package/dist/src/message/WebXShapeMessage.js.map +0 -1
- package/dist/src/message/WebXSubImagesMessage.d.ts +0 -31
- package/dist/src/message/WebXSubImagesMessage.js +0 -29
- package/dist/src/message/WebXSubImagesMessage.js.map +0 -1
- package/dist/src/message/WebXWindowsMessage.d.ts +0 -21
- package/dist/src/message/WebXWindowsMessage.js +0 -25
- package/dist/src/message/WebXWindowsMessage.js.map +0 -1
- package/dist/src/message/index.d.ts +0 -14
- package/dist/src/message/index.js +0 -31
- package/dist/src/message/index.js.map +0 -1
- package/dist/src/tracer/WebXDebugImageMessageHandler.d.ts +0 -48
- package/dist/src/tracer/WebXDebugImageMessageHandler.js +0 -102
- package/dist/src/tracer/WebXDebugImageMessageHandler.js.map +0 -1
- package/dist/src/tracer/WebXHandler.d.ts +0 -14
- package/dist/src/tracer/WebXHandler.js +0 -3
- package/dist/src/tracer/WebXHandler.js.map +0 -1
- package/dist/src/tracer/WebXInstructionHandler.d.ts +0 -21
- package/dist/src/tracer/WebXInstructionHandler.js +0 -13
- package/dist/src/tracer/WebXInstructionHandler.js.map +0 -1
- package/dist/src/tracer/WebXMessageHandler.d.ts +0 -21
- package/dist/src/tracer/WebXMessageHandler.js +0 -13
- package/dist/src/tracer/WebXMessageHandler.js.map +0 -1
- package/dist/src/tracer/WebXStatsHandler.d.ts +0 -23
- package/dist/src/tracer/WebXStatsHandler.js +0 -13
- package/dist/src/tracer/WebXStatsHandler.js.map +0 -1
- package/dist/src/tracer/index.d.ts +0 -5
- package/dist/src/tracer/index.js +0 -22
- package/dist/src/tracer/index.js.map +0 -1
- package/dist/src/transport/WebXBinarySerializer.d.ts +0 -31
- package/dist/src/transport/WebXBinarySerializer.js +0 -63
- package/dist/src/transport/WebXBinarySerializer.js.map +0 -1
- package/dist/src/transport/WebXInstructionBuffer.d.ts +0 -55
- package/dist/src/transport/WebXInstructionBuffer.js +0 -109
- package/dist/src/transport/WebXInstructionBuffer.js.map +0 -1
- package/dist/src/transport/WebXInstructionEncoder.d.ts +0 -181
- package/dist/src/transport/WebXInstructionEncoder.js +0 -294
- package/dist/src/transport/WebXInstructionEncoder.js.map +0 -1
- package/dist/src/transport/WebXMessageBuffer.d.ts +0 -80
- package/dist/src/transport/WebXMessageBuffer.js +0 -104
- package/dist/src/transport/WebXMessageBuffer.js.map +0 -1
- package/dist/src/transport/WebXMessageDecoder.d.ts +0 -108
- package/dist/src/transport/WebXMessageDecoder.js +0 -332
- package/dist/src/transport/WebXMessageDecoder.js.map +0 -1
- package/dist/src/transport/index.d.ts +0 -5
- package/dist/src/transport/index.js +0 -22
- package/dist/src/transport/index.js.map +0 -1
- package/dist/src/tunnel/WebXTunnel.d.ts +0 -93
- package/dist/src/tunnel/WebXTunnel.js +0 -156
- package/dist/src/tunnel/WebXTunnel.js.map +0 -1
- package/dist/src/tunnel/WebXWebSocketTunnel.d.ts +0 -40
- package/dist/src/tunnel/WebXWebSocketTunnel.js +0 -88
- package/dist/src/tunnel/WebXWebSocketTunnel.js.map +0 -1
- package/dist/src/tunnel/index.d.ts +0 -2
- package/dist/src/tunnel/index.js +0 -19
- package/dist/src/tunnel/index.js.map +0 -1
- package/dist/src/utils/WebXColorGenerator.d.ts +0 -24
- package/dist/src/utils/WebXColorGenerator.js +0 -46
- package/dist/src/utils/WebXColorGenerator.js.map +0 -1
- package/dist/src/utils/WebXVersion.d.ts +0 -34
- package/dist/src/utils/WebXVersion.js +0 -25
- package/dist/src/utils/WebXVersion.js.map +0 -1
- package/dist/src/utils/index.d.ts +0 -2
- package/dist/src/utils/index.js +0 -19
- package/dist/src/utils/index.js.map +0 -1
- package/dist/tracer/DemoVisualMessageHandler.d.ts +0 -15
- package/dist/tracer/DemoVisualMessageHandler.js +0 -55
- package/dist/tracer/DemoVisualMessageHandler.js.map +0 -1
- package/dist/tracer/WebXVisualMessageHandler.d.ts +0 -15
- package/dist/tracer/WebXVisualMessageHandler.js +0 -55
- package/dist/tracer/WebXVisualMessageHandler.js.map +0 -1
- package/dist/tunnel/WebXDefaultQoSHandler.d.ts +0 -16
- package/dist/tunnel/WebXDefaultQoSHandler.js +0 -57
- package/dist/tunnel/WebXDefaultQoSHandler.js.map +0 -1
- package/dist/tunnel/WebXQoSHandler.d.ts +0 -6
- package/dist/tunnel/WebXQoSHandler.js +0 -7
- package/dist/tunnel/WebXQoSHandler.js.map +0 -1
- package/dist/tunnel/WebXSocketIOTunnel.d.ts +0 -15
- package/dist/tunnel/WebXSocketIOTunnel.js +0 -41
- package/dist/tunnel/WebXSocketIOTunnel.js.map +0 -1
- package/dist/utils/ColorGenerator.d.ts +0 -24
- package/dist/utils/ColorGenerator.js +0 -46
- package/dist/utils/ColorGenerator.js.map +0 -1
- package/dist/utils/Config.d.ts +0 -4
- package/dist/utils/Config.js +0 -10
- package/dist/utils/Config.js.map +0 -1
- package/dist/utils/WebXAsyncExec.d.ts +0 -5
- package/dist/utils/WebXAsyncExec.js +0 -18
- package/dist/utils/WebXAsyncExec.js.map +0 -1
- package/dist/utils/WebXColourGenerator.d.ts +0 -5
- package/dist/utils/WebXColourGenerator.js +0 -27
- package/dist/utils/WebXColourGenerator.js.map +0 -1
- package/dist/utils/WebXFileSize.d.ts +0 -3
- package/dist/utils/WebXFileSize.js +0 -14
- package/dist/utils/WebXFileSize.js.map +0 -1
|
@@ -1,424 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.WebXDisplay = void 0;
|
|
4
|
-
const THREE = require("three");
|
|
5
|
-
const three_1 = require("three");
|
|
6
|
-
const WebXWindow_1 = require("./WebXWindow");
|
|
7
|
-
const WebXCursor_1 = require("./WebXCursor");
|
|
8
|
-
/**
|
|
9
|
-
* Manages the rendering of the WebX remote desktop using WebGL.
|
|
10
|
-
*
|
|
11
|
-
* This class handles the creation and management of the WebGL scene, including
|
|
12
|
-
* windows, cursor, and scaling. It provides methods to update the display
|
|
13
|
-
* and interact with the rendered elements.
|
|
14
|
-
*/
|
|
15
|
-
class WebXDisplay {
|
|
16
|
-
/**
|
|
17
|
-
* Gets the WebGL renderer used for rendering the display.
|
|
18
|
-
*
|
|
19
|
-
* @returns The WebGLRenderer instance.
|
|
20
|
-
*/
|
|
21
|
-
get renderer() {
|
|
22
|
-
return this._renderer;
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Gets the width of the screen.
|
|
26
|
-
*
|
|
27
|
-
* @returns The screen width in pixels.
|
|
28
|
-
*/
|
|
29
|
-
get screenWidth() {
|
|
30
|
-
return this._screenWidth;
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Gets the height of the screen.
|
|
34
|
-
*
|
|
35
|
-
* @returns The screen height in pixels.
|
|
36
|
-
*/
|
|
37
|
-
get screenHeight() {
|
|
38
|
-
return this._screenHeight;
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Gets the HTML container element for the display.
|
|
42
|
-
*
|
|
43
|
-
* @returns The container HTMLElement.
|
|
44
|
-
*/
|
|
45
|
-
get containerElement() {
|
|
46
|
-
return this._containerElement;
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* Gets the current scale factor of the display.
|
|
50
|
-
*
|
|
51
|
-
* @returns The scale factor as a number.
|
|
52
|
-
*/
|
|
53
|
-
get scale() {
|
|
54
|
-
return this._scale;
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* Gets the Three.js scene used for rendering.
|
|
58
|
-
*
|
|
59
|
-
* @returns The Scene instance.
|
|
60
|
-
*/
|
|
61
|
-
get scene() {
|
|
62
|
-
return this._scene;
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* Gets the Three.js camera used for rendering.
|
|
66
|
-
*
|
|
67
|
-
* @returns the Camera instance
|
|
68
|
-
*/
|
|
69
|
-
get camera() {
|
|
70
|
-
return this._camera;
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* Returns when the scene is dirty and needs to be re-rendered.
|
|
74
|
-
* @return true if the scene is dirty, false otherwise
|
|
75
|
-
*/
|
|
76
|
-
get sceneDirty() {
|
|
77
|
-
return this._sceneDirty;
|
|
78
|
-
}
|
|
79
|
-
/**
|
|
80
|
-
* Explicitly sets the scene dirty flag to indicate that the scene needs to be re-rendered.
|
|
81
|
-
* @param value the scene dirty value
|
|
82
|
-
*/
|
|
83
|
-
set sceneDirty(value) {
|
|
84
|
-
this._sceneDirty = value;
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* Creates a new instance of WebXDisplay.
|
|
88
|
-
*
|
|
89
|
-
* @param containerElement The HTML element to render the display.
|
|
90
|
-
* @param screenWidth The width of the screen.
|
|
91
|
-
* @param screenHeight The height of the screen.
|
|
92
|
-
* @param textureFactory The texture factory used for creating textures.
|
|
93
|
-
* @param cursorFactory The cursor factory used for managing cursors.
|
|
94
|
-
*/
|
|
95
|
-
constructor(containerElement, screenWidth, screenHeight, textureFactory, cursorFactory) {
|
|
96
|
-
this._windows = [];
|
|
97
|
-
this._scale = 1;
|
|
98
|
-
this._disposed = false;
|
|
99
|
-
this._sceneDirty = false;
|
|
100
|
-
this._containerElement = containerElement;
|
|
101
|
-
this._screenWidth = screenWidth;
|
|
102
|
-
this._screenHeight = screenHeight;
|
|
103
|
-
this._textureFactory = textureFactory;
|
|
104
|
-
this._cursor = new WebXCursor_1.WebXCursor(cursorFactory);
|
|
105
|
-
this._scene = new THREE.Scene();
|
|
106
|
-
this._screen = new THREE.Object3D();
|
|
107
|
-
// this._scene.add(this._screen);
|
|
108
|
-
this._screen.add(this._cursor.mesh);
|
|
109
|
-
// this._camera = new THREE.OrthographicCamera(0, screenWidth, 0, screenHeight, 0.1, 100);
|
|
110
|
-
this._camera = new THREE.OrthographicCamera(0, screenWidth, 0, screenHeight, 0.1, 10000);
|
|
111
|
-
this._camera.position.z = 1000;
|
|
112
|
-
this._camera.lookAt(new three_1.Vector3(0, 0, 0));
|
|
113
|
-
this._renderer = new THREE.WebGLRenderer();
|
|
114
|
-
this._renderer.setSize(screenWidth, screenHeight, false);
|
|
115
|
-
const backgroundColor = window.getComputedStyle(this._containerElement).backgroundColor;
|
|
116
|
-
this._renderer.setClearColor(backgroundColor);
|
|
117
|
-
this._render();
|
|
118
|
-
this._bindListeners();
|
|
119
|
-
// initial size
|
|
120
|
-
this.resize();
|
|
121
|
-
this._renderer.render(this._scene, this._camera);
|
|
122
|
-
}
|
|
123
|
-
/**
|
|
124
|
-
* Displays the screen by adding it to the scene.
|
|
125
|
-
*/
|
|
126
|
-
showScreen() {
|
|
127
|
-
this._scene.add(this._screen);
|
|
128
|
-
this._sceneDirty = true;
|
|
129
|
-
}
|
|
130
|
-
/**
|
|
131
|
-
* Hides the screen by removing it from the scene.
|
|
132
|
-
*/
|
|
133
|
-
hideScreen() {
|
|
134
|
-
this._scene.remove(this._screen);
|
|
135
|
-
this._sceneDirty = true;
|
|
136
|
-
}
|
|
137
|
-
/**
|
|
138
|
-
* Disposes of all resources used by the display.
|
|
139
|
-
*
|
|
140
|
-
* This includes removing windows, clearing elements, and releasing WebGL resources.
|
|
141
|
-
*/
|
|
142
|
-
dispose() {
|
|
143
|
-
this.hideScreen();
|
|
144
|
-
for (const window of this._windows) {
|
|
145
|
-
this._screen.remove(window.mesh);
|
|
146
|
-
window.dispose();
|
|
147
|
-
}
|
|
148
|
-
this._cursor.dispose();
|
|
149
|
-
this._clearElements();
|
|
150
|
-
this._renderer.dispose();
|
|
151
|
-
this._disposed = true;
|
|
152
|
-
}
|
|
153
|
-
/**
|
|
154
|
-
* Animates the display by continuously rendering the scene.
|
|
155
|
-
*
|
|
156
|
-
* This method uses `requestAnimationFrame` to update the display at regular intervals.
|
|
157
|
-
*/
|
|
158
|
-
animate() {
|
|
159
|
-
if (!this._disposed) {
|
|
160
|
-
requestAnimationFrame(() => {
|
|
161
|
-
this.animate();
|
|
162
|
-
});
|
|
163
|
-
if (this._sceneDirty) {
|
|
164
|
-
this._sceneDirty = false;
|
|
165
|
-
this.render();
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
/**
|
|
170
|
-
* Renders the display by updating the WebGL context.
|
|
171
|
-
*/
|
|
172
|
-
render() {
|
|
173
|
-
this._renderer.render(this._scene, this._camera);
|
|
174
|
-
}
|
|
175
|
-
/**
|
|
176
|
-
* Adds a new window to the display.
|
|
177
|
-
*
|
|
178
|
-
* @param window The WebXWindow instance to add.
|
|
179
|
-
*/
|
|
180
|
-
addWindow(window) {
|
|
181
|
-
if (this._windows.find(existingWindow => existingWindow.id === window.id) == null) {
|
|
182
|
-
// console.log("Adding window ", window.id)
|
|
183
|
-
this._windows.push(window);
|
|
184
|
-
this._screen.add(window.mesh);
|
|
185
|
-
this._sceneDirty = true;
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
/**
|
|
189
|
-
* Removes a window from the display.
|
|
190
|
-
*
|
|
191
|
-
* @param window The WebXWindow instance to remove.
|
|
192
|
-
*/
|
|
193
|
-
removeWindow(window) {
|
|
194
|
-
if (this._windows.find(existingWindow => existingWindow.id === window.id) != null) {
|
|
195
|
-
// console.log("Removing window ", window.id)
|
|
196
|
-
this._windows = this._windows.filter(existingWindow => existingWindow.id !== window.id);
|
|
197
|
-
window.dispose();
|
|
198
|
-
this._screen.remove(window.mesh);
|
|
199
|
-
this._sceneDirty = true;
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
/**
|
|
203
|
-
* Updates the display with the given windows.
|
|
204
|
-
*
|
|
205
|
-
* @param windows The list of windows to update.
|
|
206
|
-
* @returns A promise that resolves when all windows are updated.
|
|
207
|
-
*/
|
|
208
|
-
updateWindows(windows) {
|
|
209
|
-
return new Promise((resolve) => {
|
|
210
|
-
// Get windows to remove
|
|
211
|
-
const deadWindows = this._windows.filter(existingWindow => windows.find(window => window.id === existingWindow.id) == null);
|
|
212
|
-
// Remove windows that no longer exist
|
|
213
|
-
deadWindows.forEach(deadWindow => this.removeWindow(deadWindow));
|
|
214
|
-
let hasNewWindows = false;
|
|
215
|
-
// Update and add windows
|
|
216
|
-
windows.forEach((window, index) => {
|
|
217
|
-
let webXWindow = this.getWindow(window.id);
|
|
218
|
-
if (webXWindow == null) {
|
|
219
|
-
hasNewWindows = true;
|
|
220
|
-
// Add a new window
|
|
221
|
-
webXWindow = new WebXWindow_1.WebXWindow({
|
|
222
|
-
id: window.id,
|
|
223
|
-
x: window.x,
|
|
224
|
-
y: window.y,
|
|
225
|
-
z: index,
|
|
226
|
-
width: window.width,
|
|
227
|
-
height: window.height,
|
|
228
|
-
shaped: window.shaped,
|
|
229
|
-
}, this._textureFactory);
|
|
230
|
-
this.addWindow(webXWindow);
|
|
231
|
-
webXWindow.loadWindowImageAndShape()
|
|
232
|
-
.then(() => {
|
|
233
|
-
// When all windows are visible then callback. This is only really needed for the startup
|
|
234
|
-
if (this.checkVisibility(windows.map(window => window.id))) {
|
|
235
|
-
resolve();
|
|
236
|
-
}
|
|
237
|
-
});
|
|
238
|
-
}
|
|
239
|
-
else {
|
|
240
|
-
// Update window
|
|
241
|
-
webXWindow.setRectangle(window.x, window.y, index, window.width, window.height);
|
|
242
|
-
}
|
|
243
|
-
});
|
|
244
|
-
if (!hasNewWindows) {
|
|
245
|
-
resolve();
|
|
246
|
-
}
|
|
247
|
-
});
|
|
248
|
-
}
|
|
249
|
-
/**
|
|
250
|
-
* Checks if all specified windows are visible.
|
|
251
|
-
*
|
|
252
|
-
* @param windowIds The list of window IDs to check.
|
|
253
|
-
* @returns True if all windows are visible, false otherwise.
|
|
254
|
-
*/
|
|
255
|
-
checkVisibility(windowIds) {
|
|
256
|
-
const allVisible = windowIds
|
|
257
|
-
.map(id => this.getWindow(id))
|
|
258
|
-
.filter(window => window != null)
|
|
259
|
-
.map(window => window.visible)
|
|
260
|
-
.reduce((allVisible, visible) => allVisible && visible, true);
|
|
261
|
-
return allVisible;
|
|
262
|
-
}
|
|
263
|
-
/**
|
|
264
|
-
* Updates the texture of a window with new image data.
|
|
265
|
-
*
|
|
266
|
-
* @param windowId The ID of the window to update.
|
|
267
|
-
* @param depth The depth of the image.
|
|
268
|
-
* @param colorMap The color texture.
|
|
269
|
-
* @param alphaMap The alpha texture.
|
|
270
|
-
*/
|
|
271
|
-
updateImage(windowId, depth, colorMap, alphaMap) {
|
|
272
|
-
const window = this.getWindow(windowId);
|
|
273
|
-
if (window != null && !(colorMap == null && alphaMap == null)) {
|
|
274
|
-
window.updateTexture(depth, colorMap, alphaMap, true);
|
|
275
|
-
this._sceneDirty = true;
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
|
-
/**
|
|
279
|
-
* Updates sub-images of a window with new image data.
|
|
280
|
-
*
|
|
281
|
-
* @param windowId The ID of the window to update.
|
|
282
|
-
* @param subImages The list of sub-images to update.
|
|
283
|
-
*/
|
|
284
|
-
updateSubImages(windowId, subImages) {
|
|
285
|
-
const window = this.getWindow(windowId);
|
|
286
|
-
if (window != null && window.colorMapValid) {
|
|
287
|
-
const colorMap = window.colorMap;
|
|
288
|
-
const alphaMap = window.alphaMap;
|
|
289
|
-
for (let i = 0; i < subImages.length; i++) {
|
|
290
|
-
const subImage = subImages[i];
|
|
291
|
-
if (colorMap && subImage.colorMap) {
|
|
292
|
-
this._renderer.copyTextureToTexture(subImage.colorMap, colorMap, null, new THREE.Vector2(subImage.x, subImage.y));
|
|
293
|
-
}
|
|
294
|
-
if (alphaMap && subImage.alphaMap) {
|
|
295
|
-
this._renderer.copyTextureToTexture(subImage.alphaMap, alphaMap, null, new THREE.Vector2(subImage.x, subImage.y));
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
window.updateTexture(window.depth, colorMap, alphaMap, false);
|
|
299
|
-
this._sceneDirty = true;
|
|
300
|
-
}
|
|
301
|
-
}
|
|
302
|
-
/**
|
|
303
|
-
* Updates the texture of a window stencil map with.
|
|
304
|
-
*
|
|
305
|
-
* @param windowId The ID of the window to update.
|
|
306
|
-
* @param stencilMap The stencil texture.
|
|
307
|
-
*/
|
|
308
|
-
updateShape(windowId, stencilMap) {
|
|
309
|
-
const window = this.getWindow(windowId);
|
|
310
|
-
if (window != null && stencilMap != null) {
|
|
311
|
-
window.updateStencilTexture(stencilMap);
|
|
312
|
-
this._sceneDirty = true;
|
|
313
|
-
}
|
|
314
|
-
}
|
|
315
|
-
/**
|
|
316
|
-
* Updates the mouse cursor on the display.
|
|
317
|
-
*
|
|
318
|
-
* @param cursorId The ID of the cursor to display.
|
|
319
|
-
*/
|
|
320
|
-
setMouseCursor(cursorId) {
|
|
321
|
-
this._cursor.setCursorId(cursorId);
|
|
322
|
-
this._sceneDirty = true;
|
|
323
|
-
}
|
|
324
|
-
/**
|
|
325
|
-
* Updates the mouse position without changing the cursor.
|
|
326
|
-
*
|
|
327
|
-
* @param x The x-coordinate of the mouse.
|
|
328
|
-
* @param y The y-coordinate of the mouse.
|
|
329
|
-
*/
|
|
330
|
-
setMousePosition(x, y) {
|
|
331
|
-
this._cursor.setPosition(x, y);
|
|
332
|
-
this._sceneDirty = true;
|
|
333
|
-
}
|
|
334
|
-
/**
|
|
335
|
-
* Retrieves a window by its ID.
|
|
336
|
-
*
|
|
337
|
-
* @param id The ID of the window to retrieve.
|
|
338
|
-
* @returns The WebXWindow instance, or undefined if not found.
|
|
339
|
-
*/
|
|
340
|
-
getWindow(id) {
|
|
341
|
-
return this._windows.find(window => window.id === id);
|
|
342
|
-
}
|
|
343
|
-
/**
|
|
344
|
-
* Sets the scale of the display.
|
|
345
|
-
*
|
|
346
|
-
* @param scale The scale factor (between 0 and 1).
|
|
347
|
-
*/
|
|
348
|
-
setScale(scale) {
|
|
349
|
-
this._scale = scale;
|
|
350
|
-
this._sceneDirty = true;
|
|
351
|
-
}
|
|
352
|
-
/**
|
|
353
|
-
* Automatically scales the display to fit its container.
|
|
354
|
-
*/
|
|
355
|
-
autoScale() {
|
|
356
|
-
const container = this._containerElement;
|
|
357
|
-
const { clientWidth, clientHeight } = container;
|
|
358
|
-
const { screenWidth, screenHeight } = this;
|
|
359
|
-
this._scale = Math.min(clientWidth / screenWidth, clientHeight / screenHeight);
|
|
360
|
-
this._sceneDirty = true;
|
|
361
|
-
}
|
|
362
|
-
/**
|
|
363
|
-
* Resizes the display to fit its container.
|
|
364
|
-
*
|
|
365
|
-
* @param scale Optional scale factor. If not provided, the display will auto-scale.
|
|
366
|
-
*/
|
|
367
|
-
resize(scale) {
|
|
368
|
-
const element = this._boundsElement;
|
|
369
|
-
if (scale) {
|
|
370
|
-
this.setScale(scale);
|
|
371
|
-
}
|
|
372
|
-
else {
|
|
373
|
-
this.autoScale();
|
|
374
|
-
}
|
|
375
|
-
element.style.transform = `scale(${this._scale},${this._scale})`;
|
|
376
|
-
}
|
|
377
|
-
/**
|
|
378
|
-
* Clears all child elements from the container element.
|
|
379
|
-
*/
|
|
380
|
-
_clearElements() {
|
|
381
|
-
while (this._containerElement.firstChild) {
|
|
382
|
-
this._containerElement.removeChild(this._containerElement.firstChild);
|
|
383
|
-
}
|
|
384
|
-
}
|
|
385
|
-
/**
|
|
386
|
-
* Creates the main display element and sets its dimensions.
|
|
387
|
-
*
|
|
388
|
-
* @returns The created HTML element.
|
|
389
|
-
*/
|
|
390
|
-
_createDisplayElement() {
|
|
391
|
-
const element = document.createElement('div');
|
|
392
|
-
element.style.width = `${this._screenWidth}px`;
|
|
393
|
-
element.style.height = `${this._screenHeight}px`;
|
|
394
|
-
element.appendChild(this._renderer.domElement);
|
|
395
|
-
return element;
|
|
396
|
-
}
|
|
397
|
-
/**
|
|
398
|
-
* Creates the bounding element for the display.
|
|
399
|
-
*
|
|
400
|
-
* @returns The created HTML element.
|
|
401
|
-
*/
|
|
402
|
-
_createDisplayBoundingElement() {
|
|
403
|
-
const element = document.createElement('div');
|
|
404
|
-
element.appendChild(this._displayElement);
|
|
405
|
-
return element;
|
|
406
|
-
}
|
|
407
|
-
/**
|
|
408
|
-
* Renders the display by appending the display and bounding elements to the container.
|
|
409
|
-
*/
|
|
410
|
-
_render() {
|
|
411
|
-
this._clearElements();
|
|
412
|
-
this._displayElement = this._createDisplayElement();
|
|
413
|
-
this._boundsElement = this._createDisplayBoundingElement();
|
|
414
|
-
this._containerElement.appendChild(this._boundsElement);
|
|
415
|
-
}
|
|
416
|
-
/**
|
|
417
|
-
* Binds event listeners for resizing and other interactions.
|
|
418
|
-
*/
|
|
419
|
-
_bindListeners() {
|
|
420
|
-
this.resize = this.resize.bind(this);
|
|
421
|
-
}
|
|
422
|
-
}
|
|
423
|
-
exports.WebXDisplay = WebXDisplay;
|
|
424
|
-
//# sourceMappingURL=WebXDisplay.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"WebXDisplay.js","sourceRoot":"","sources":["../../../src/display/WebXDisplay.ts"],"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ShaderMaterial, Texture } from 'three';
|
|
2
|
-
export declare class WebXMaterial extends ShaderMaterial {
|
|
3
|
-
get map(): Texture;
|
|
4
|
-
set map(value: Texture);
|
|
5
|
-
get alphaMap(): Texture;
|
|
6
|
-
set alphaMap(value: Texture);
|
|
7
|
-
get stencilMap(): Texture;
|
|
8
|
-
set stencilMap(value: Texture);
|
|
9
|
-
get color(): Color;
|
|
10
|
-
set color(value: Color);
|
|
11
|
-
set needsUpdate(value: boolean);
|
|
12
|
-
constructor(params?: any);
|
|
13
|
-
onBeforeRender(): void;
|
|
14
|
-
}
|
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.WebXMaterial = void 0;
|
|
4
|
-
const three_1 = require("three");
|
|
5
|
-
const vertexShader = `
|
|
6
|
-
#ifdef USE_MAP
|
|
7
|
-
uniform mat3 mapTransform;
|
|
8
|
-
varying vec2 vMapUv;
|
|
9
|
-
#endif
|
|
10
|
-
|
|
11
|
-
#ifdef USE_ALPHAMAP
|
|
12
|
-
uniform mat3 alphaMapTransform;
|
|
13
|
-
varying vec2 vAlphaMapUv;
|
|
14
|
-
#endif
|
|
15
|
-
|
|
16
|
-
#ifdef USE_STENCILMAP
|
|
17
|
-
varying vec2 vStencilMapUv;
|
|
18
|
-
#endif
|
|
19
|
-
|
|
20
|
-
void main() {
|
|
21
|
-
#ifdef USE_MAP
|
|
22
|
-
vMapUv = (mapTransform * vec3(uv, 1)).xy;
|
|
23
|
-
#endif
|
|
24
|
-
|
|
25
|
-
#ifdef USE_ALPHAMAP
|
|
26
|
-
vAlphaMapUv = (alphaMapTransform * vec3(uv, 1)).xy;
|
|
27
|
-
#endif
|
|
28
|
-
|
|
29
|
-
#ifdef USE_STENCILMAP
|
|
30
|
-
vStencilMapUv = uv;
|
|
31
|
-
#endif
|
|
32
|
-
|
|
33
|
-
gl_Position = projectionMatrix * viewMatrix * modelMatrix * vec4(position, 1.0);
|
|
34
|
-
}
|
|
35
|
-
`;
|
|
36
|
-
const fragmentShader = `
|
|
37
|
-
uniform vec3 diffuse;
|
|
38
|
-
uniform float opacity;
|
|
39
|
-
|
|
40
|
-
#ifdef USE_MAP
|
|
41
|
-
uniform sampler2D map;
|
|
42
|
-
varying vec2 vMapUv;
|
|
43
|
-
#endif
|
|
44
|
-
|
|
45
|
-
#ifdef USE_ALPHAMAP
|
|
46
|
-
uniform sampler2D alphaMap;
|
|
47
|
-
varying vec2 vAlphaMapUv;
|
|
48
|
-
#endif
|
|
49
|
-
|
|
50
|
-
#ifdef USE_STENCILMAP
|
|
51
|
-
uniform sampler2D stencilMap;
|
|
52
|
-
varying vec2 vStencilMapUv;
|
|
53
|
-
#endif
|
|
54
|
-
|
|
55
|
-
void main() {
|
|
56
|
-
vec4 diffuseColor = vec4(diffuse, opacity);
|
|
57
|
-
|
|
58
|
-
#ifdef USE_STENCILMAP
|
|
59
|
-
vec4 stencil = texture2D(stencilMap, vStencilMapUv);
|
|
60
|
-
if (stencil.r < 0.5) {
|
|
61
|
-
discard;
|
|
62
|
-
}
|
|
63
|
-
#endif
|
|
64
|
-
|
|
65
|
-
#ifdef USE_MAP
|
|
66
|
-
vec4 sampledDiffuseColor = texture2D(map, vMapUv);
|
|
67
|
-
diffuseColor *= sampledDiffuseColor;
|
|
68
|
-
#endif
|
|
69
|
-
|
|
70
|
-
#ifdef USE_ALPHAMAP
|
|
71
|
-
diffuseColor.a *= texture2D(alphaMap, vAlphaMapUv).g;
|
|
72
|
-
#endif
|
|
73
|
-
|
|
74
|
-
gl_FragColor = diffuseColor;
|
|
75
|
-
gl_FragColor = linearToOutputTexel( gl_FragColor );
|
|
76
|
-
}
|
|
77
|
-
`;
|
|
78
|
-
class WebXMaterial extends three_1.ShaderMaterial {
|
|
79
|
-
get map() {
|
|
80
|
-
return this.uniforms.map.value;
|
|
81
|
-
}
|
|
82
|
-
set map(value) {
|
|
83
|
-
this.uniforms.map.value = value;
|
|
84
|
-
}
|
|
85
|
-
get alphaMap() {
|
|
86
|
-
return this.uniforms.alphaMap.value;
|
|
87
|
-
}
|
|
88
|
-
set alphaMap(value) {
|
|
89
|
-
this.uniforms.alphaMap.value = value;
|
|
90
|
-
}
|
|
91
|
-
get stencilMap() {
|
|
92
|
-
return this.uniforms.stencilMap.value;
|
|
93
|
-
}
|
|
94
|
-
set stencilMap(value) {
|
|
95
|
-
this.uniforms.stencilMap.value = value;
|
|
96
|
-
this.defines.USE_STENCILMAP = value ? '' : undefined;
|
|
97
|
-
}
|
|
98
|
-
get color() {
|
|
99
|
-
return this.uniforms.diffuse.value;
|
|
100
|
-
}
|
|
101
|
-
set color(value) {
|
|
102
|
-
this.uniforms.diffuse.value.copy(value);
|
|
103
|
-
}
|
|
104
|
-
set needsUpdate(value) {
|
|
105
|
-
this.uniformsNeedUpdate = value;
|
|
106
|
-
}
|
|
107
|
-
constructor(params) {
|
|
108
|
-
super({
|
|
109
|
-
uniforms: {
|
|
110
|
-
map: { value: null },
|
|
111
|
-
alphaMap: { value: null },
|
|
112
|
-
stencilMap: { value: null },
|
|
113
|
-
mapTransform: { value: new three_1.Matrix3() },
|
|
114
|
-
alphaMapTransform: { value: new three_1.Matrix3() },
|
|
115
|
-
diffuse: { value: new three_1.Color(0xffffff) },
|
|
116
|
-
opacity: { value: 1.0 },
|
|
117
|
-
},
|
|
118
|
-
vertexShader,
|
|
119
|
-
fragmentShader,
|
|
120
|
-
transparent: true,
|
|
121
|
-
depthTest: true,
|
|
122
|
-
side: three_1.BackSide,
|
|
123
|
-
});
|
|
124
|
-
if (params && params.color) {
|
|
125
|
-
this.color.set(params.color);
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
onBeforeRender() {
|
|
129
|
-
if (this.map && this.map.matrixAutoUpdate) {
|
|
130
|
-
this.map.updateMatrix();
|
|
131
|
-
this.uniforms.mapTransform.value.copy(this.map.matrix);
|
|
132
|
-
}
|
|
133
|
-
if (this.alphaMap && this.alphaMap.matrixAutoUpdate) {
|
|
134
|
-
this.alphaMap.updateMatrix();
|
|
135
|
-
this.uniforms.alphaMapTransform.value.copy(this.alphaMap.matrix);
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
exports.WebXMaterial = WebXMaterial;
|
|
140
|
-
//# sourceMappingURL=WebXMaterial.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"WebXMaterial.js","sourceRoot":"","sources":["../../../src/display/WebXMaterial.ts"],"names":[],"mappings":";;;AAAA,iCAAqG;AAIrG,MAAM,YAAY,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8BpB,CAAC;AAEF,MAAM,cAAc,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyCtB,CAAC;AAEF,MAAa,YAAa,SAAQ,sBAAc;IAE9C,IAAI,GAAG;QACL,OAAO,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC;IACjC,CAAC;IAED,IAAI,GAAG,CAAC,KAAc;QACpB,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,GAAG,KAAK,CAAC;IAClC,CAAC;IAED,IAAI,QAAQ;QACV,OAAO,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC;IACtC,CAAC;IAED,IAAI,QAAQ,CAAC,KAAc;QACzB,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,KAAK,GAAG,KAAK,CAAC;IACvC,CAAC;IAED,IAAI,UAAU;QACZ,OAAO,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,KAAK,CAAC;IACxC,CAAC;IAED,IAAI,UAAU,CAAC,KAAc;QAC3B,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,KAAK,GAAG,KAAK,CAAC;QACvC,IAAI,CAAC,OAAO,CAAC,cAAc,GAAG,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,CAA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AAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QACzD,CAAC;QAED,IAAI,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ,CAAC,gBAAgB,EAAE,CAAC;YACpD,IAAI,CAAC,QAAQ,CAAC,YAAY,EAAE,CAAC;YAC7B,IAAI,CAAC,QAAQ,CAAC,iBAAiB,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;QACnE,CAAC;IACH,CAAC;CAEF;AA1ED,oCA0EC"}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import * as THREE from 'three';
|
|
2
|
-
/**
|
|
3
|
-
* Represents a sub-image within a WebX window.
|
|
4
|
-
*
|
|
5
|
-
* A sub-image is a portion of a window's texture that can be updated independently.
|
|
6
|
-
*/
|
|
7
|
-
export declare class WebXSubImage {
|
|
8
|
-
/**
|
|
9
|
-
* The x-coordinate of the sub-image within the window.
|
|
10
|
-
*/
|
|
11
|
-
readonly x: number;
|
|
12
|
-
/**
|
|
13
|
-
* The y-coordinate of the sub-image within the window.
|
|
14
|
-
*/
|
|
15
|
-
readonly y: number;
|
|
16
|
-
/**
|
|
17
|
-
* The width of the sub-image.
|
|
18
|
-
*/
|
|
19
|
-
readonly width: number;
|
|
20
|
-
/**
|
|
21
|
-
* The height of the sub-image.
|
|
22
|
-
*/
|
|
23
|
-
readonly height: number;
|
|
24
|
-
/**
|
|
25
|
-
* The depth of the sub-image (e.g., 24-bit or 32-bit).
|
|
26
|
-
*/
|
|
27
|
-
readonly depth: number;
|
|
28
|
-
/**
|
|
29
|
-
* The color map texture of the sub-image.
|
|
30
|
-
*/
|
|
31
|
-
readonly colorMap: THREE.Texture;
|
|
32
|
-
/**
|
|
33
|
-
* The alpha map texture of the sub-image.
|
|
34
|
-
*/
|
|
35
|
-
readonly alphaMap: THREE.Texture;
|
|
36
|
-
/**
|
|
37
|
-
* Creates a new instance of WebXSubImage.
|
|
38
|
-
*
|
|
39
|
-
* @param properties The properties of the sub-image, including position, size, and textures.
|
|
40
|
-
*/
|
|
41
|
-
constructor(properties: {
|
|
42
|
-
x: number;
|
|
43
|
-
y: number;
|
|
44
|
-
width: number;
|
|
45
|
-
height: number;
|
|
46
|
-
depth: number;
|
|
47
|
-
colorMap: THREE.Texture;
|
|
48
|
-
alphaMap: THREE.Texture;
|
|
49
|
-
});
|
|
50
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.WebXSubImage = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Represents a sub-image within a WebX window.
|
|
6
|
-
*
|
|
7
|
-
* A sub-image is a portion of a window's texture that can be updated independently.
|
|
8
|
-
*/
|
|
9
|
-
class WebXSubImage {
|
|
10
|
-
/**
|
|
11
|
-
* Creates a new instance of WebXSubImage.
|
|
12
|
-
*
|
|
13
|
-
* @param properties The properties of the sub-image, including position, size, and textures.
|
|
14
|
-
*/
|
|
15
|
-
constructor(properties) {
|
|
16
|
-
this.x = properties.x;
|
|
17
|
-
this.y = properties.y;
|
|
18
|
-
this.width = properties.width;
|
|
19
|
-
this.height = properties.height;
|
|
20
|
-
this.depth = properties.depth;
|
|
21
|
-
this.colorMap = properties.colorMap;
|
|
22
|
-
this.alphaMap = properties.alphaMap;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
exports.WebXSubImage = WebXSubImage;
|
|
26
|
-
//# sourceMappingURL=WebXSubImage.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"WebXSubImage.js","sourceRoot":"","sources":["../../../src/display/WebXSubImage.ts"],"names":[],"mappings":";;;AAEA;;;;GAIG;AACH,MAAa,YAAY;IAoCvB;;;;OAIG;IACH,YAAY,UAQX;QACC,IAAI,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC;QACtB,IAAI,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC;QACtB,IAAI,CAAC,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC;QAC9B,IAAI,CAAC,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;QAChC,IAAI,CAAC,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC;QAC9B,IAAI,CAAC,QAAQ,GAAG,UAAU,CAAC,QAAQ,CAAC;QACpC,IAAI,CAAC,QAAQ,GAAG,UAAU,CAAC,QAAQ,CAAC;IACtC,CAAC;CACF;AA1DD,oCA0DC"}
|