@vulfram/engine 0.14.8-alpha → 0.17.1-alpha
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 +106 -0
- package/package.json +55 -4
- package/src/core.ts +14 -0
- package/src/ecs.ts +1 -0
- package/src/engine/api.ts +234 -23
- package/src/engine/bridge/dispatch.ts +265 -40
- package/src/engine/bridge/guards.ts +4 -1
- package/src/engine/bridge/protocol.ts +69 -52
- package/src/engine/ecs/index.ts +185 -42
- package/src/engine/state.ts +133 -2
- package/src/engine/systems/command-intent.ts +153 -3
- package/src/engine/systems/constraint-solve.ts +167 -0
- package/src/engine/systems/core-command-builder.ts +9 -268
- package/src/engine/systems/diagnostics.ts +20 -19
- package/src/engine/systems/index.ts +3 -1
- package/src/engine/systems/input-mirror.ts +101 -3
- package/src/engine/systems/resource-upload.ts +96 -44
- package/src/engine/systems/response-decode.ts +69 -15
- package/src/engine/systems/scene-sync.ts +306 -0
- package/src/engine/systems/ui-bridge.ts +360 -0
- package/src/engine/systems/utils.ts +43 -1
- package/src/engine/systems/world-lifecycle.ts +37 -102
- package/src/engine/window/manager.ts +168 -0
- package/src/engine/world/entities.ts +821 -78
- package/src/engine/world/mount.ts +174 -0
- package/src/engine/world/types.ts +71 -0
- package/src/engine/world/world-ui.ts +266 -0
- package/src/engine/world/world3d.ts +280 -0
- package/src/index.ts +30 -1
- package/src/mount.ts +2 -0
- package/src/types/cmds/audio.ts +73 -48
- package/src/types/cmds/camera.ts +12 -8
- package/src/types/cmds/environment.ts +9 -3
- package/src/types/cmds/geometry.ts +13 -14
- package/src/types/cmds/index.ts +198 -168
- package/src/types/cmds/light.ts +12 -11
- package/src/types/cmds/material.ts +9 -11
- package/src/types/cmds/model.ts +17 -15
- package/src/types/cmds/realm.ts +25 -0
- package/src/types/cmds/system.ts +19 -0
- package/src/types/cmds/target.ts +82 -0
- package/src/types/cmds/texture.ts +13 -3
- package/src/types/cmds/ui.ts +220 -0
- package/src/types/cmds/window.ts +41 -204
- package/src/types/events/index.ts +4 -1
- package/src/types/events/pointer.ts +42 -13
- package/src/types/events/system.ts +144 -30
- package/src/types/events/ui.ts +21 -0
- package/src/types/index.ts +1 -0
- package/src/types/json.ts +15 -0
- package/src/window.ts +8 -0
- package/src/world-ui.ts +2 -0
- package/src/world3d.ts +10 -0
- package/tsconfig.json +0 -29
package/src/types/cmds/index.ts
CHANGED
|
@@ -1,130 +1,157 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import * as Win from './window';
|
|
1
|
+
import * as Audio from './audio';
|
|
3
2
|
import * as Cam from './camera';
|
|
4
|
-
import * as
|
|
3
|
+
import * as Env from './environment';
|
|
4
|
+
import * as Geo from './geometry';
|
|
5
|
+
import * as Giz from './gizmo';
|
|
5
6
|
import * as Lite from './light';
|
|
6
7
|
import * as Mat from './material';
|
|
8
|
+
import * as Mod from './model';
|
|
9
|
+
import * as Realm from './realm';
|
|
10
|
+
import * as Sys from './system';
|
|
11
|
+
import * as Target from './target';
|
|
7
12
|
import * as Tex from './texture';
|
|
8
|
-
import * as
|
|
9
|
-
import * as
|
|
10
|
-
import * as Giz from './gizmo';
|
|
11
|
-
import * as Env from './environment';
|
|
12
|
-
import * as Audio from './audio';
|
|
13
|
-
import * as RenderGraph from './render-graph';
|
|
13
|
+
import * as Ui from './ui';
|
|
14
|
+
import * as Win from './window';
|
|
14
15
|
|
|
15
|
-
export * from './
|
|
16
|
-
export * from './window';
|
|
16
|
+
export * from './audio';
|
|
17
17
|
export * from './camera';
|
|
18
|
-
export * from './
|
|
19
|
-
export * from './light';
|
|
20
|
-
export * from './material';
|
|
21
|
-
export * from './texture';
|
|
18
|
+
export * from './environment';
|
|
22
19
|
export * from './geometry';
|
|
23
|
-
export * from './shadow';
|
|
24
20
|
export * from './gizmo';
|
|
25
|
-
export * from './
|
|
26
|
-
export * from './
|
|
21
|
+
export * from './light';
|
|
22
|
+
export * from './material';
|
|
23
|
+
export * from './model';
|
|
24
|
+
export * from './realm';
|
|
27
25
|
export * from './render-graph';
|
|
28
26
|
export * from './resources';
|
|
27
|
+
export * from './shadow';
|
|
28
|
+
export * from './system';
|
|
29
|
+
export * from './target';
|
|
30
|
+
export * from './texture';
|
|
31
|
+
export * from './ui';
|
|
32
|
+
export * from './window';
|
|
29
33
|
|
|
30
|
-
/**
|
|
34
|
+
/**
|
|
35
|
+
* Discriminated union of all commands accepted by core.
|
|
36
|
+
*
|
|
37
|
+
* Routing convention:
|
|
38
|
+
* - world-scoped commands are dispatched through the world command queue
|
|
39
|
+
* - global commands are dispatched through the global command queue
|
|
40
|
+
*/
|
|
31
41
|
export type EngineCmd =
|
|
32
42
|
| { type: 'cmd-notification-send'; content: Sys.CmdNotificationSendArgs }
|
|
33
43
|
| {
|
|
34
|
-
type: 'cmd-
|
|
35
|
-
content: Sys.
|
|
44
|
+
type: 'cmd-system-diagnostics-set';
|
|
45
|
+
content: Sys.CmdSystemDiagnosticsSetArgs;
|
|
36
46
|
}
|
|
37
47
|
| { type: 'cmd-window-create'; content: Win.CmdWindowCreateArgs }
|
|
38
48
|
| { type: 'cmd-window-close'; content: Win.CmdWindowCloseArgs }
|
|
39
|
-
| { type: 'cmd-window-
|
|
40
|
-
| { type: 'cmd-window-
|
|
41
|
-
| { type: 'cmd-window-
|
|
42
|
-
| { type: 'cmd-window-set-size'; content: Win.CmdWindowSetSizeArgs }
|
|
43
|
-
| { type: 'cmd-window-get-size'; content: Win.CmdWindowGetSizeArgs }
|
|
49
|
+
| { type: 'cmd-window-measurement'; content: Win.CmdWindowMeasurementArgs }
|
|
50
|
+
| { type: 'cmd-window-cursor'; content: Win.CmdWindowCursorArgs }
|
|
51
|
+
| { type: 'cmd-window-state'; content: Win.CmdWindowStateArgs }
|
|
44
52
|
| {
|
|
45
|
-
type: 'cmd-
|
|
46
|
-
content:
|
|
53
|
+
type: 'cmd-upload-buffer-discard-all';
|
|
54
|
+
content: Sys.CmdUploadBufferDiscardAllArgs;
|
|
47
55
|
}
|
|
56
|
+
| { type: 'cmd-camera-upsert'; content: Cam.CmdCameraUpsertArgs }
|
|
57
|
+
| { type: 'cmd-camera-dispose'; content: Cam.CmdCameraDisposeArgs }
|
|
58
|
+
| { type: 'cmd-model-upsert'; content: Mod.CmdModelUpsertArgs }
|
|
59
|
+
| { type: 'cmd-pose-update'; content: Mod.CmdPoseUpdateArgs }
|
|
60
|
+
| { type: 'cmd-model-dispose'; content: Mod.CmdModelDisposeArgs }
|
|
61
|
+
| { type: 'cmd-light-upsert'; content: Lite.CmdLightUpsertArgs }
|
|
62
|
+
| { type: 'cmd-light-dispose'; content: Lite.CmdLightDisposeArgs }
|
|
63
|
+
| { type: 'cmd-material-upsert'; content: Mat.CmdMaterialUpsertArgs }
|
|
64
|
+
| { type: 'cmd-material-dispose'; content: Mat.CmdMaterialDisposeArgs }
|
|
48
65
|
| {
|
|
49
|
-
type: 'cmd-
|
|
50
|
-
content:
|
|
66
|
+
type: 'cmd-texture-create-from-buffer';
|
|
67
|
+
content: Tex.CmdTextureCreateFromBufferArgs;
|
|
51
68
|
}
|
|
52
|
-
| { type: 'cmd-window-set-state'; content: Win.CmdWindowSetStateArgs }
|
|
53
|
-
| { type: 'cmd-window-get-state'; content: Win.CmdWindowGetStateArgs }
|
|
54
|
-
| { type: 'cmd-window-set-icon'; content: Win.CmdWindowSetIconArgs }
|
|
55
69
|
| {
|
|
56
|
-
type: 'cmd-
|
|
57
|
-
content:
|
|
70
|
+
type: 'cmd-texture-create-solid-color';
|
|
71
|
+
content: Tex.CmdTextureCreateSolidColorArgs;
|
|
58
72
|
}
|
|
73
|
+
| { type: 'cmd-texture-dispose'; content: Tex.CmdTextureDisposeArgs }
|
|
74
|
+
| { type: 'cmd-texture-bind-target'; content: Tex.CmdTextureBindTargetArgs }
|
|
59
75
|
| {
|
|
60
|
-
type: 'cmd-
|
|
61
|
-
content:
|
|
76
|
+
type: 'cmd-audio-listener-upsert';
|
|
77
|
+
content: Audio.CmdAudioListenerUpsertArgs;
|
|
62
78
|
}
|
|
63
|
-
| { type: 'cmd-window-set-resizable'; content: Win.CmdWindowSetResizableArgs }
|
|
64
|
-
| { type: 'cmd-window-is-resizable'; content: Win.CmdWindowIsResizableArgs }
|
|
65
79
|
| {
|
|
66
|
-
type: 'cmd-
|
|
67
|
-
content:
|
|
80
|
+
type: 'cmd-audio-listener-dispose';
|
|
81
|
+
content: Audio.CmdAudioListenerDisposeArgs;
|
|
68
82
|
}
|
|
69
|
-
| { type: 'cmd-window-focus'; content: Win.CmdWindowFocusArgs }
|
|
70
83
|
| {
|
|
71
|
-
type: 'cmd-
|
|
72
|
-
content:
|
|
84
|
+
type: 'cmd-audio-source-upsert';
|
|
85
|
+
content: Audio.CmdAudioSourceUpsertArgs;
|
|
73
86
|
}
|
|
74
87
|
| {
|
|
75
|
-
type: 'cmd-
|
|
76
|
-
content:
|
|
88
|
+
type: 'cmd-audio-resource-upsert';
|
|
89
|
+
content: Audio.CmdAudioResourceUpsertArgs;
|
|
77
90
|
}
|
|
78
91
|
| {
|
|
79
|
-
type: 'cmd-
|
|
80
|
-
content:
|
|
92
|
+
type: 'cmd-audio-source-transport';
|
|
93
|
+
content: Audio.CmdAudioSourceTransportArgs;
|
|
81
94
|
}
|
|
82
|
-
| { type: 'cmd-
|
|
83
|
-
| { type: 'cmd-camera-update'; content: Cam.CmdCameraUpdateArgs }
|
|
84
|
-
| { type: 'cmd-camera-dispose'; content: Cam.CmdCameraDisposeArgs }
|
|
85
|
-
| { type: 'cmd-pose-update'; content: Mod.CmdPoseUpdateArgs }
|
|
86
|
-
| { type: 'cmd-audio-listener-update'; content: Audio.CmdAudioListenerUpdateArgs }
|
|
87
|
-
| { type: 'cmd-audio-listener-create'; content: Audio.CmdAudioListenerCreateArgs }
|
|
88
|
-
| { type: 'cmd-audio-listener-dispose'; content: Audio.CmdAudioListenerDisposeArgs }
|
|
89
|
-
| { type: 'cmd-audio-resource-create'; content: Audio.CmdAudioResourceCreateArgs }
|
|
90
|
-
| { type: 'cmd-audio-resource-push'; content: Audio.CmdAudioResourcePushArgs }
|
|
91
|
-
| { type: 'cmd-audio-resource-dispose'; content: Audio.CmdAudioResourceDisposeArgs }
|
|
92
|
-
| { type: 'cmd-audio-source-create'; content: Audio.CmdAudioSourceCreateArgs }
|
|
93
|
-
| { type: 'cmd-audio-source-update'; content: Audio.CmdAudioSourceUpdateArgs }
|
|
94
|
-
| { type: 'cmd-audio-source-play'; content: Audio.CmdAudioSourcePlayArgs }
|
|
95
|
-
| { type: 'cmd-audio-source-pause'; content: Audio.CmdAudioSourcePauseArgs }
|
|
96
|
-
| { type: 'cmd-audio-source-stop'; content: Audio.CmdAudioSourceStopArgs }
|
|
97
|
-
| { type: 'cmd-audio-source-dispose'; content: Audio.CmdAudioSourceDisposeArgs }
|
|
98
|
-
| { type: 'cmd-model-create'; content: Mod.CmdModelCreateArgs }
|
|
99
|
-
| { type: 'cmd-model-update'; content: Mod.CmdModelUpdateArgs }
|
|
100
|
-
| { type: 'cmd-model-dispose'; content: Mod.CmdModelDisposeArgs }
|
|
101
|
-
| { type: 'cmd-light-create'; content: Lite.CmdLightCreateArgs }
|
|
102
|
-
| { type: 'cmd-light-update'; content: Lite.CmdLightUpdateArgs }
|
|
103
|
-
| { type: 'cmd-light-dispose'; content: Lite.CmdLightDisposeArgs }
|
|
104
|
-
| { type: 'cmd-material-create'; content: Mat.CmdMaterialCreateArgs }
|
|
105
|
-
| { type: 'cmd-material-update'; content: Mat.CmdMaterialUpdateArgs }
|
|
106
|
-
| { type: 'cmd-material-dispose'; content: Mat.CmdMaterialDisposeArgs }
|
|
95
|
+
| { type: 'cmd-audio-state-get'; content: Audio.CmdAudioStateGetArgs }
|
|
107
96
|
| {
|
|
108
|
-
type: 'cmd-
|
|
109
|
-
content:
|
|
97
|
+
type: 'cmd-audio-source-dispose';
|
|
98
|
+
content: Audio.CmdAudioSourceDisposeArgs;
|
|
110
99
|
}
|
|
111
100
|
| {
|
|
112
|
-
type: 'cmd-
|
|
113
|
-
content:
|
|
101
|
+
type: 'cmd-audio-resource-dispose';
|
|
102
|
+
content: Audio.CmdAudioResourceDisposeArgs;
|
|
114
103
|
}
|
|
115
|
-
| { type: 'cmd-
|
|
116
|
-
| { type: 'cmd-geometry-create'; content: Geo.CmdGeometryCreateArgs }
|
|
117
|
-
| { type: 'cmd-geometry-update'; content: Geo.CmdGeometryUpdateArgs }
|
|
104
|
+
| { type: 'cmd-geometry-upsert'; content: Geo.CmdGeometryUpsertArgs }
|
|
118
105
|
| { type: 'cmd-geometry-dispose'; content: Geo.CmdGeometryDisposeArgs }
|
|
119
106
|
| {
|
|
120
107
|
type: 'cmd-primitive-geometry-create';
|
|
121
108
|
content: Geo.CmdPrimitiveGeometryCreateArgs;
|
|
122
109
|
}
|
|
123
|
-
| { type: 'cmd-environment-
|
|
124
|
-
| {
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
110
|
+
| { type: 'cmd-environment-upsert'; content: Env.CmdEnvironmentUpsertArgs }
|
|
111
|
+
| {
|
|
112
|
+
type: 'cmd-environment-dispose';
|
|
113
|
+
content: Env.CmdEnvironmentDisposeArgs;
|
|
114
|
+
}
|
|
115
|
+
| { type: 'cmd-shadow-configure'; content: import('./shadow').CmdShadowConfigureArgs }
|
|
116
|
+
| { type: 'cmd-realm-create'; content: Realm.CmdRealmCreateArgs }
|
|
117
|
+
| { type: 'cmd-realm-dispose'; content: Realm.CmdRealmDisposeArgs }
|
|
118
|
+
| { type: 'cmd-target-upsert'; content: Target.CmdTargetUpsertArgs }
|
|
119
|
+
| { type: 'cmd-target-dispose'; content: Target.CmdTargetDisposeArgs }
|
|
120
|
+
| {
|
|
121
|
+
type: 'cmd-target-layer-upsert';
|
|
122
|
+
content: Target.CmdTargetLayerUpsertArgs;
|
|
123
|
+
}
|
|
124
|
+
| {
|
|
125
|
+
type: 'cmd-target-layer-dispose';
|
|
126
|
+
content: Target.CmdTargetLayerDisposeArgs;
|
|
127
|
+
}
|
|
128
|
+
| { type: 'cmd-ui-theme-define'; content: Ui.CmdUiThemeDefineArgs }
|
|
129
|
+
| { type: 'cmd-ui-theme-dispose'; content: Ui.CmdUiThemeDisposeArgs }
|
|
130
|
+
| { type: 'cmd-ui-document-create'; content: Ui.CmdUiDocumentCreateArgs }
|
|
131
|
+
| { type: 'cmd-ui-document-dispose'; content: Ui.CmdUiDocumentDisposeArgs }
|
|
132
|
+
| { type: 'cmd-ui-document-set-rect'; content: Ui.CmdUiDocumentSetRectArgs }
|
|
133
|
+
| { type: 'cmd-ui-document-set-theme'; content: Ui.CmdUiDocumentSetThemeArgs }
|
|
134
|
+
| { type: 'cmd-ui-document-get-tree'; content: Ui.CmdUiDocumentGetTreeArgs }
|
|
135
|
+
| {
|
|
136
|
+
type: 'cmd-ui-document-get-layout-rects';
|
|
137
|
+
content: Ui.CmdUiDocumentGetLayoutRectsArgs;
|
|
138
|
+
}
|
|
139
|
+
| { type: 'cmd-ui-apply-ops'; content: Ui.CmdUiApplyOpsArgs }
|
|
140
|
+
| { type: 'cmd-ui-debug-set'; content: Ui.CmdUiDebugSetArgs }
|
|
141
|
+
| { type: 'cmd-ui-focus-set'; content: Ui.CmdUiFocusSetArgs }
|
|
142
|
+
| { type: 'cmd-ui-focus-get'; content: Ui.CmdUiFocusGetArgs }
|
|
143
|
+
| { type: 'cmd-ui-event-trace-set'; content: Ui.CmdUiEventTraceSetArgs }
|
|
144
|
+
| {
|
|
145
|
+
type: 'cmd-ui-image-create-from-buffer';
|
|
146
|
+
content: Ui.CmdUiImageCreateFromBufferArgs;
|
|
147
|
+
}
|
|
148
|
+
| { type: 'cmd-ui-image-dispose'; content: Ui.CmdUiImageDisposeArgs }
|
|
149
|
+
| { type: 'cmd-ui-clipboard-paste'; content: Ui.CmdUiClipboardPasteArgs }
|
|
150
|
+
| { type: 'cmd-ui-screenshot-reply'; content: Ui.CmdUiScreenshotReplyArgs }
|
|
151
|
+
| {
|
|
152
|
+
type: 'cmd-ui-access-kit-action-request';
|
|
153
|
+
content: Ui.CmdUiAccessKitActionRequestArgs;
|
|
154
|
+
}
|
|
128
155
|
| { type: 'cmd-model-list'; content: Mod.CmdModelListArgs }
|
|
129
156
|
| { type: 'cmd-material-list'; content: Mat.CmdMaterialListArgs }
|
|
130
157
|
| { type: 'cmd-texture-list'; content: Tex.CmdTextureListArgs }
|
|
@@ -134,101 +161,118 @@ export type EngineCmd =
|
|
|
134
161
|
| { type: 'cmd-gizmo-draw-line'; content: Giz.CmdGizmoDrawLineArgs }
|
|
135
162
|
| { type: 'cmd-gizmo-draw-aabb'; content: Giz.CmdGizmoDrawAabbArgs };
|
|
136
163
|
|
|
137
|
-
/** Discriminated union of all
|
|
164
|
+
/** Discriminated union of all command responses returned by core. */
|
|
138
165
|
export type CommandResponse =
|
|
139
166
|
| { type: 'notification-send'; content: Sys.CmdResultNotificationSend }
|
|
140
167
|
| {
|
|
141
|
-
type: '
|
|
142
|
-
content: Sys.
|
|
168
|
+
type: 'system-diagnostics-set';
|
|
169
|
+
content: Sys.CmdResultSystemDiagnosticsSet;
|
|
143
170
|
}
|
|
144
171
|
| { type: 'window-create'; content: Win.CmdResultWindowCreate }
|
|
145
172
|
| { type: 'window-close'; content: Win.CmdResultWindowClose }
|
|
146
|
-
| { type: 'window-
|
|
147
|
-
| { type: 'window-
|
|
148
|
-
| { type: 'window-
|
|
149
|
-
| { type: 'window-set-size'; content: Win.CmdResultWindowSetSize }
|
|
150
|
-
| { type: 'window-get-size'; content: Win.CmdResultWindowGetSize }
|
|
151
|
-
| { type: 'window-get-outer-size'; content: Win.CmdResultWindowGetOuterSize }
|
|
173
|
+
| { type: 'window-measurement'; content: Win.CmdResultWindowMeasurement }
|
|
174
|
+
| { type: 'window-cursor'; content: Win.CmdResultWindowCursor }
|
|
175
|
+
| { type: 'window-state'; content: Win.CmdResultWindowState }
|
|
152
176
|
| {
|
|
153
|
-
type: '
|
|
154
|
-
content:
|
|
177
|
+
type: 'upload-buffer-discard-all';
|
|
178
|
+
content: Sys.CmdResultUploadBufferDiscardAll;
|
|
155
179
|
}
|
|
156
|
-
| { type: '
|
|
157
|
-
| { type: '
|
|
158
|
-
| { type: '
|
|
180
|
+
| { type: 'camera-upsert'; content: Cam.CmdResultCameraUpsert }
|
|
181
|
+
| { type: 'camera-dispose'; content: Cam.CmdResultCameraDispose }
|
|
182
|
+
| { type: 'model-upsert'; content: Mod.CmdResultModelUpsert }
|
|
183
|
+
| { type: 'pose-update'; content: Mod.CmdResultPoseUpdate }
|
|
184
|
+
| { type: 'model-dispose'; content: Mod.CmdResultModelDispose }
|
|
185
|
+
| { type: 'light-upsert'; content: Lite.CmdResultLightUpsert }
|
|
186
|
+
| { type: 'light-dispose'; content: Lite.CmdResultLightDispose }
|
|
187
|
+
| { type: 'material-upsert'; content: Mat.CmdResultMaterialUpsert }
|
|
188
|
+
| { type: 'material-dispose'; content: Mat.CmdResultMaterialDispose }
|
|
159
189
|
| {
|
|
160
|
-
type: '
|
|
161
|
-
content:
|
|
190
|
+
type: 'texture-create-from-buffer';
|
|
191
|
+
content: Tex.CmdResultTextureCreateFromBuffer;
|
|
162
192
|
}
|
|
163
193
|
| {
|
|
164
|
-
type: '
|
|
165
|
-
content:
|
|
194
|
+
type: 'texture-create-solid-color';
|
|
195
|
+
content: Tex.CmdResultTextureCreateSolidColor;
|
|
166
196
|
}
|
|
167
|
-
| { type: '
|
|
168
|
-
| { type: '
|
|
197
|
+
| { type: 'texture-dispose'; content: Tex.CmdResultTextureDispose }
|
|
198
|
+
| { type: 'texture-bind-target'; content: Tex.CmdResultTextureBindTarget }
|
|
169
199
|
| {
|
|
170
|
-
type: '
|
|
171
|
-
content:
|
|
200
|
+
type: 'audio-listener-upsert';
|
|
201
|
+
content: Audio.CmdResultAudioListenerUpsert;
|
|
172
202
|
}
|
|
173
|
-
| { type: 'window-focus'; content: Win.CmdResultWindowFocus }
|
|
174
203
|
| {
|
|
175
|
-
type: '
|
|
176
|
-
content:
|
|
204
|
+
type: 'audio-listener-dispose';
|
|
205
|
+
content: Audio.CmdResultAudioListenerDispose;
|
|
177
206
|
}
|
|
178
207
|
| {
|
|
179
|
-
type: '
|
|
180
|
-
content:
|
|
208
|
+
type: 'audio-source-upsert';
|
|
209
|
+
content: Audio.CmdResultAudioSourceUpsert;
|
|
181
210
|
}
|
|
182
211
|
| {
|
|
183
|
-
type: '
|
|
184
|
-
content:
|
|
212
|
+
type: 'audio-resource-upsert';
|
|
213
|
+
content: Audio.CmdResultAudioResourceUpsert;
|
|
185
214
|
}
|
|
186
|
-
| { type: 'camera-create'; content: Cam.CmdResultCameraCreate }
|
|
187
|
-
| { type: 'camera-update'; content: Cam.CmdResultCameraUpdate }
|
|
188
|
-
| { type: 'camera-dispose'; content: Cam.CmdResultCameraDispose }
|
|
189
|
-
| { type: 'pose-update'; content: Mod.CmdResultPoseUpdate }
|
|
190
|
-
| { type: 'audio-listener-update'; content: Audio.CmdResultAudioListenerUpdate }
|
|
191
|
-
| { type: 'audio-listener-create'; content: Audio.CmdResultAudioListenerCreate }
|
|
192
|
-
| { type: 'audio-listener-dispose'; content: Audio.CmdResultAudioListenerDispose }
|
|
193
|
-
| { type: 'audio-resource-create'; content: Audio.CmdResultAudioResourceCreate }
|
|
194
|
-
| { type: 'audio-resource-push'; content: Audio.CmdResultAudioResourcePush }
|
|
195
|
-
| { type: 'audio-resource-dispose'; content: Audio.CmdResultAudioResourceDispose }
|
|
196
|
-
| { type: 'audio-source-create'; content: Audio.CmdResultAudioSourceCreate }
|
|
197
|
-
| { type: 'audio-source-update'; content: Audio.CmdResultAudioSourceUpdate }
|
|
198
|
-
| { type: 'audio-source-play'; content: Audio.CmdResultAudioSourcePlay }
|
|
199
|
-
| { type: 'audio-source-pause'; content: Audio.CmdResultAudioSourcePause }
|
|
200
|
-
| { type: 'audio-source-stop'; content: Audio.CmdResultAudioSourceStop }
|
|
201
|
-
| { type: 'audio-source-dispose'; content: Audio.CmdResultAudioSourceDispose }
|
|
202
|
-
| { type: 'model-create'; content: Mod.CmdResultModelCreate }
|
|
203
|
-
| { type: 'model-update'; content: Mod.CmdResultModelUpdate }
|
|
204
|
-
| { type: 'model-dispose'; content: Mod.CmdResultModelDispose }
|
|
205
|
-
| { type: 'light-create'; content: Lite.CmdResultLightCreate }
|
|
206
|
-
| { type: 'light-update'; content: Lite.CmdResultLightUpdate }
|
|
207
|
-
| { type: 'light-dispose'; content: Lite.CmdResultLightDispose }
|
|
208
|
-
| { type: 'material-create'; content: Mat.CmdResultMaterialCreate }
|
|
209
|
-
| { type: 'material-update'; content: Mat.CmdResultMaterialUpdate }
|
|
210
|
-
| { type: 'material-dispose'; content: Mat.CmdResultMaterialDispose }
|
|
211
215
|
| {
|
|
212
|
-
type: '
|
|
213
|
-
content:
|
|
216
|
+
type: 'audio-source-transport';
|
|
217
|
+
content: Audio.CmdResultAudioSourceTransport;
|
|
214
218
|
}
|
|
219
|
+
| { type: 'audio-state-get'; content: Audio.CmdResultAudioStateGet }
|
|
215
220
|
| {
|
|
216
|
-
type: '
|
|
217
|
-
content:
|
|
221
|
+
type: 'audio-source-dispose';
|
|
222
|
+
content: Audio.CmdResultAudioSourceDispose;
|
|
218
223
|
}
|
|
219
|
-
| {
|
|
220
|
-
|
|
221
|
-
|
|
224
|
+
| {
|
|
225
|
+
type: 'audio-resource-dispose';
|
|
226
|
+
content: Audio.CmdResultAudioResourceDispose;
|
|
227
|
+
}
|
|
228
|
+
| { type: 'geometry-upsert'; content: Geo.CmdResultGeometryUpsert }
|
|
222
229
|
| { type: 'geometry-dispose'; content: Geo.CmdResultGeometryDispose }
|
|
223
230
|
| {
|
|
224
231
|
type: 'primitive-geometry-create';
|
|
225
232
|
content: Geo.CmdResultPrimitiveGeometryCreate;
|
|
226
233
|
}
|
|
227
|
-
| { type: 'environment-
|
|
228
|
-
| { type: 'environment-update'; content: Env.CmdResultEnvironment }
|
|
234
|
+
| { type: 'environment-upsert'; content: Env.CmdResultEnvironment }
|
|
229
235
|
| { type: 'environment-dispose'; content: Env.CmdResultEnvironment }
|
|
230
|
-
| {
|
|
231
|
-
|
|
236
|
+
| {
|
|
237
|
+
type: 'shadow-configure';
|
|
238
|
+
content: import('./shadow').CmdResultShadowConfigure;
|
|
239
|
+
}
|
|
240
|
+
| { type: 'realm-create'; content: Realm.CmdResultRealmCreate }
|
|
241
|
+
| { type: 'realm-dispose'; content: Realm.CmdResultRealmDispose }
|
|
242
|
+
| { type: 'target-upsert'; content: Target.CmdResultTargetUpsert }
|
|
243
|
+
| { type: 'target-dispose'; content: Target.CmdResultTargetDispose }
|
|
244
|
+
| {
|
|
245
|
+
type: 'target-layer-upsert';
|
|
246
|
+
content: Target.CmdResultTargetLayerUpsert;
|
|
247
|
+
}
|
|
248
|
+
| {
|
|
249
|
+
type: 'target-layer-dispose';
|
|
250
|
+
content: Target.CmdResultTargetLayerDispose;
|
|
251
|
+
}
|
|
252
|
+
| { type: 'ui-theme-define'; content: Ui.CmdResultUiThemeDefine }
|
|
253
|
+
| { type: 'ui-theme-dispose'; content: Ui.CmdResultUiThemeDispose }
|
|
254
|
+
| { type: 'ui-document-create'; content: Ui.CmdResultUiDocumentCreate }
|
|
255
|
+
| { type: 'ui-document-dispose'; content: Ui.CmdResultUiDocumentDispose }
|
|
256
|
+
| { type: 'ui-document-set-rect'; content: Ui.CmdResultUiDocumentSetRect }
|
|
257
|
+
| { type: 'ui-document-set-theme'; content: Ui.CmdResultUiDocumentSetTheme }
|
|
258
|
+
| { type: 'ui-document-get-tree'; content: Ui.CmdResultUiDocumentGetTree }
|
|
259
|
+
| {
|
|
260
|
+
type: 'ui-document-get-layout-rects';
|
|
261
|
+
content: Ui.CmdResultUiDocumentGetLayoutRects;
|
|
262
|
+
}
|
|
263
|
+
| { type: 'ui-apply-ops'; content: Ui.CmdResultUiApplyOps }
|
|
264
|
+
| { type: 'ui-debug-set'; content: Ui.CmdResultUiDebugSet }
|
|
265
|
+
| { type: 'ui-focus-set'; content: Ui.CmdResultUiFocusSet }
|
|
266
|
+
| { type: 'ui-focus-get'; content: Ui.CmdResultUiFocusGet }
|
|
267
|
+
| { type: 'ui-event-trace-set'; content: Ui.CmdResultUiEventTraceSet }
|
|
268
|
+
| {
|
|
269
|
+
type: 'ui-image-create-from-buffer';
|
|
270
|
+
content: Ui.CmdResultUiImageCreateFromBuffer;
|
|
271
|
+
}
|
|
272
|
+
| { type: 'ui-image-dispose'; content: Ui.CmdResultUiImageDispose }
|
|
273
|
+
| { type: 'ui-clipboard-paste'; content: Ui.CmdResultUiInputEvent }
|
|
274
|
+
| { type: 'ui-screenshot-reply'; content: Ui.CmdResultUiInputEvent }
|
|
275
|
+
| { type: 'ui-access-kit-action-request'; content: Ui.CmdResultUiInputEvent }
|
|
232
276
|
| { type: 'model-list'; content: Mod.CmdResultModelList }
|
|
233
277
|
| { type: 'material-list'; content: Mat.CmdResultMaterialList }
|
|
234
278
|
| { type: 'texture-list'; content: Tex.CmdResultTextureList }
|
|
@@ -238,35 +282,21 @@ export type CommandResponse =
|
|
|
238
282
|
| { type: 'gizmo-draw-line'; content: Giz.CmdResultGizmoDraw }
|
|
239
283
|
| { type: 'gizmo-draw-aabb'; content: Giz.CmdResultGizmoDraw };
|
|
240
284
|
|
|
241
|
-
/**
|
|
285
|
+
/** Command envelope used in batched transport payloads. */
|
|
242
286
|
export interface EngineCmdEnvelope {
|
|
243
287
|
id: number;
|
|
244
288
|
type: EngineCmd['type'];
|
|
245
289
|
content: EngineCmd['content'];
|
|
246
290
|
}
|
|
247
291
|
|
|
248
|
-
/**
|
|
292
|
+
/** Response envelope returned by queue polling and routed by command id. */
|
|
249
293
|
export interface CommandResponseEnvelope {
|
|
250
294
|
id: number;
|
|
251
295
|
type: CommandResponse['type'];
|
|
252
296
|
content: CommandResponse['content'];
|
|
253
297
|
}
|
|
254
298
|
|
|
255
|
-
/**
|
|
299
|
+
/** Batched commands payload sent to transport. */
|
|
256
300
|
export type EngineBatchCmds = EngineCmdEnvelope[];
|
|
257
|
-
|
|
258
|
-
/** Batch of responses received from the core. */
|
|
301
|
+
/** Batched responses payload decoded from transport. */
|
|
259
302
|
export type EngineBatchResponses = CommandResponseEnvelope[];
|
|
260
|
-
|
|
261
|
-
/** Result codes returned by core entrypoints. */
|
|
262
|
-
export enum VulframResult {
|
|
263
|
-
Success = 0,
|
|
264
|
-
UnknownError = 1,
|
|
265
|
-
NotInitialized = 2,
|
|
266
|
-
AlreadyInitialized = 3,
|
|
267
|
-
WrongThread = 4,
|
|
268
|
-
CmdInvalidMessagePackError = 5,
|
|
269
|
-
BufferNotFound = 6,
|
|
270
|
-
BufferIdCollision = 7,
|
|
271
|
-
InvalidUploadType = 8,
|
|
272
|
-
}
|
package/src/types/cmds/light.ts
CHANGED
|
@@ -3,7 +3,7 @@ import type { ResourceEntry } from './resources';
|
|
|
3
3
|
|
|
4
4
|
/** Command payload for creating a light. */
|
|
5
5
|
export interface CmdLightCreateArgs {
|
|
6
|
-
|
|
6
|
+
realmId: number;
|
|
7
7
|
lightId: number;
|
|
8
8
|
label?: string;
|
|
9
9
|
kind?: LightKind;
|
|
@@ -18,15 +18,9 @@ export interface CmdLightCreateArgs {
|
|
|
18
18
|
castShadow?: boolean;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
/** Result payload for light create. */
|
|
22
|
-
export interface CmdResultLightCreate {
|
|
23
|
-
success: boolean;
|
|
24
|
-
message: string;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
21
|
/** Command payload for updating a light. */
|
|
28
22
|
export interface CmdLightUpdateArgs {
|
|
29
|
-
|
|
23
|
+
realmId: number;
|
|
30
24
|
lightId: number;
|
|
31
25
|
label?: string;
|
|
32
26
|
kind?: LightKind;
|
|
@@ -41,15 +35,22 @@ export interface CmdLightUpdateArgs {
|
|
|
41
35
|
castShadow?: boolean;
|
|
42
36
|
}
|
|
43
37
|
|
|
44
|
-
/** Result payload for light
|
|
45
|
-
export interface
|
|
38
|
+
/** Result payload for light upsert. */
|
|
39
|
+
export interface CmdResultLightUpsert {
|
|
46
40
|
success: boolean;
|
|
47
41
|
message: string;
|
|
48
42
|
}
|
|
49
43
|
|
|
44
|
+
/** Upsert payload accepted by the core (`create` or `update`). */
|
|
45
|
+
export type CmdLightUpsertArgs = CmdLightCreateArgs | CmdLightUpdateArgs;
|
|
46
|
+
|
|
47
|
+
/** Backward-compatible aliases. */
|
|
48
|
+
export type CmdResultLightCreate = CmdResultLightUpsert;
|
|
49
|
+
export type CmdResultLightUpdate = CmdResultLightUpsert;
|
|
50
|
+
|
|
50
51
|
/** Command payload for disposing a light. */
|
|
51
52
|
export interface CmdLightDisposeArgs {
|
|
52
|
-
|
|
53
|
+
realmId: number;
|
|
53
54
|
lightId: number;
|
|
54
55
|
}
|
|
55
56
|
|
|
@@ -48,37 +48,35 @@ export type MaterialOptions =
|
|
|
48
48
|
|
|
49
49
|
/** Command payload for creating a material. */
|
|
50
50
|
export interface CmdMaterialCreateArgs {
|
|
51
|
-
windowId: number;
|
|
52
51
|
materialId: number;
|
|
53
52
|
label?: string;
|
|
54
53
|
kind: MaterialKind;
|
|
55
54
|
options?: MaterialOptions;
|
|
56
55
|
}
|
|
57
56
|
|
|
58
|
-
/** Result payload for material create. */
|
|
59
|
-
export interface CmdResultMaterialCreate {
|
|
60
|
-
success: boolean;
|
|
61
|
-
message: string;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
57
|
/** Command payload for updating a material. */
|
|
65
58
|
export interface CmdMaterialUpdateArgs {
|
|
66
|
-
windowId: number;
|
|
67
59
|
materialId: number;
|
|
68
60
|
label?: string;
|
|
69
61
|
kind?: MaterialKind;
|
|
70
62
|
options?: MaterialOptions;
|
|
71
63
|
}
|
|
72
64
|
|
|
73
|
-
/** Result payload for material
|
|
74
|
-
export interface
|
|
65
|
+
/** Result payload for material upsert. */
|
|
66
|
+
export interface CmdResultMaterialUpsert {
|
|
75
67
|
success: boolean;
|
|
76
68
|
message: string;
|
|
77
69
|
}
|
|
78
70
|
|
|
71
|
+
/** Upsert payload accepted by the core (`create` or `update`). */
|
|
72
|
+
export type CmdMaterialUpsertArgs = CmdMaterialCreateArgs | CmdMaterialUpdateArgs;
|
|
73
|
+
|
|
74
|
+
/** Backward-compatible aliases. */
|
|
75
|
+
export type CmdResultMaterialCreate = CmdResultMaterialUpsert;
|
|
76
|
+
export type CmdResultMaterialUpdate = CmdResultMaterialUpsert;
|
|
77
|
+
|
|
79
78
|
/** Command payload for disposing a material. */
|
|
80
79
|
export interface CmdMaterialDisposeArgs {
|
|
81
|
-
windowId: number;
|
|
82
80
|
materialId: number;
|
|
83
81
|
}
|
|
84
82
|
|
package/src/types/cmds/model.ts
CHANGED
|
@@ -2,8 +2,8 @@ import type { ResourceEntry } from './resources';
|
|
|
2
2
|
|
|
3
3
|
/** Command payload for creating a model. */
|
|
4
4
|
export interface CmdModelCreateArgs {
|
|
5
|
-
|
|
6
|
-
modelId: number
|
|
5
|
+
realmId: number;
|
|
6
|
+
modelId: number;
|
|
7
7
|
label?: string;
|
|
8
8
|
geometryId: number;
|
|
9
9
|
materialId?: number;
|
|
@@ -15,16 +15,10 @@ export interface CmdModelCreateArgs {
|
|
|
15
15
|
outlineColor: [number, number, number, number];
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
/** Result payload for model create. */
|
|
19
|
-
export interface CmdResultModelCreate {
|
|
20
|
-
success: boolean;
|
|
21
|
-
message: string;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
18
|
/** Command payload for updating a model. */
|
|
25
19
|
export interface CmdModelUpdateArgs {
|
|
26
|
-
|
|
27
|
-
modelId: number
|
|
20
|
+
realmId: number;
|
|
21
|
+
modelId: number;
|
|
28
22
|
label?: string;
|
|
29
23
|
geometryId?: number;
|
|
30
24
|
materialId?: number;
|
|
@@ -36,18 +30,26 @@ export interface CmdModelUpdateArgs {
|
|
|
36
30
|
outlineColor?: [number, number, number, number];
|
|
37
31
|
}
|
|
38
32
|
|
|
39
|
-
/** Result payload for model
|
|
40
|
-
export interface
|
|
33
|
+
/** Result payload for model upsert. */
|
|
34
|
+
export interface CmdResultModelUpsert {
|
|
41
35
|
success: boolean;
|
|
42
36
|
message: string;
|
|
43
37
|
}
|
|
44
38
|
|
|
39
|
+
/** Upsert payload accepted by the core (`create` or `update`). */
|
|
40
|
+
export type CmdModelUpsertArgs = CmdModelCreateArgs | CmdModelUpdateArgs;
|
|
41
|
+
|
|
42
|
+
/** Backward-compatible aliases. */
|
|
43
|
+
export type CmdResultModelCreate = CmdResultModelUpsert;
|
|
44
|
+
export type CmdResultModelUpdate = CmdResultModelUpsert;
|
|
45
|
+
|
|
45
46
|
/** Command payload for updating a model pose (skinning). */
|
|
46
47
|
export interface CmdPoseUpdateArgs {
|
|
47
|
-
|
|
48
|
+
realmId: number;
|
|
48
49
|
modelId: number;
|
|
49
50
|
boneCount: number;
|
|
50
51
|
matricesBufferId: number;
|
|
52
|
+
windowId?: number;
|
|
51
53
|
}
|
|
52
54
|
|
|
53
55
|
/** Result payload for pose update. */
|
|
@@ -58,8 +60,8 @@ export interface CmdResultPoseUpdate {
|
|
|
58
60
|
|
|
59
61
|
/** Command payload for disposing a model. */
|
|
60
62
|
export interface CmdModelDisposeArgs {
|
|
61
|
-
|
|
62
|
-
modelId: number
|
|
63
|
+
realmId: number;
|
|
64
|
+
modelId: number;
|
|
63
65
|
}
|
|
64
66
|
|
|
65
67
|
/** Result payload for model dispose. */
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export type RealmKind = 'three-d' | 'two-d';
|
|
2
|
+
|
|
3
|
+
export interface CmdRealmCreateArgs {
|
|
4
|
+
kind: RealmKind;
|
|
5
|
+
outputSurfaceId?: number;
|
|
6
|
+
hostWindowId?: number;
|
|
7
|
+
importance?: number;
|
|
8
|
+
cachePolicy?: number;
|
|
9
|
+
flags?: number;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface CmdResultRealmCreate {
|
|
13
|
+
success: boolean;
|
|
14
|
+
message: string;
|
|
15
|
+
realmId?: number;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface CmdRealmDisposeArgs {
|
|
19
|
+
realmId: number;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface CmdResultRealmDispose {
|
|
23
|
+
success: boolean;
|
|
24
|
+
message: string;
|
|
25
|
+
}
|