@fps-games/editor 0.1.4-beta.5 → 0.1.5-beta.1
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/build-info.json +16 -16
- package/dist/local-editor-harness.d.ts +24 -5
- package/dist/local-editor-harness.d.ts.map +1 -1
- package/dist/local-editor-harness.js +456 -90
- package/dist/local-editor-harness.js.map +1 -1
- package/dist/local-editor-performance-stats.d.ts +12 -0
- package/dist/local-editor-performance-stats.d.ts.map +1 -0
- package/dist/local-editor-performance-stats.js +46 -0
- package/dist/local-editor-performance-stats.js.map +1 -0
- package/dist/playable-babylon-facade.d.ts +2 -2
- package/dist/playable-babylon-facade.d.ts.map +1 -1
- package/dist/playable-babylon-facade.js +1 -1
- package/dist/playable-babylon-facade.js.map +1 -1
- package/dist/playable-babylon-rendering.d.ts +57 -12
- package/dist/playable-babylon-rendering.d.ts.map +1 -1
- package/dist/playable-babylon-rendering.js +529 -20
- package/dist/playable-babylon-rendering.js.map +1 -1
- package/dist/playable-local-editor-host.d.ts +10 -9
- package/dist/playable-local-editor-host.d.ts.map +1 -1
- package/dist/playable-local-editor-host.js.map +1 -1
- package/dist/playable-sdk.d.ts +5 -3
- package/dist/playable-sdk.d.ts.map +1 -1
- package/dist/playable-sdk.js +3 -2
- package/dist/playable-sdk.js.map +1 -1
- package/dist/static-shadow-cpu-worker.d.ts +7 -0
- package/dist/static-shadow-cpu-worker.d.ts.map +1 -0
- package/dist/static-shadow-cpu-worker.js +221 -0
- package/dist/static-shadow-cpu-worker.js.map +1 -0
- package/node_modules/@fps-games/babylon-renderer/dist/index.d.ts +3 -1
- package/node_modules/@fps-games/babylon-renderer/dist/index.d.ts.map +1 -1
- package/node_modules/@fps-games/babylon-renderer/dist/index.js +3 -1
- package/node_modules/@fps-games/babylon-renderer/dist/index.js.map +1 -1
- package/node_modules/@fps-games/babylon-renderer/dist/shadows/static-projected-shadow-artifact-system.d.ts +4 -0
- package/node_modules/@fps-games/babylon-renderer/dist/shadows/static-projected-shadow-artifact-system.d.ts.map +1 -0
- package/node_modules/@fps-games/babylon-renderer/dist/shadows/static-projected-shadow-artifact-system.js +584 -0
- package/node_modules/@fps-games/babylon-renderer/dist/shadows/static-projected-shadow-artifact-system.js.map +1 -0
- package/node_modules/@fps-games/babylon-renderer/dist/shadows/static-projected-shadow-atlas.d.ts +61 -0
- package/node_modules/@fps-games/babylon-renderer/dist/shadows/static-projected-shadow-atlas.d.ts.map +1 -0
- package/node_modules/@fps-games/babylon-renderer/dist/shadows/static-projected-shadow-atlas.js +382 -0
- package/node_modules/@fps-games/babylon-renderer/dist/shadows/static-projected-shadow-atlas.js.map +1 -0
- package/node_modules/@fps-games/babylon-renderer/dist/shadows/static-projected-shadow-bake.d.ts +47 -0
- package/node_modules/@fps-games/babylon-renderer/dist/shadows/static-projected-shadow-bake.d.ts.map +1 -0
- package/node_modules/@fps-games/babylon-renderer/dist/shadows/static-projected-shadow-bake.js +285 -0
- package/node_modules/@fps-games/babylon-renderer/dist/shadows/static-projected-shadow-bake.js.map +1 -0
- package/node_modules/@fps-games/babylon-renderer/dist/shadows/static-projected-shadow-baker.d.ts +88 -0
- package/node_modules/@fps-games/babylon-renderer/dist/shadows/static-projected-shadow-baker.d.ts.map +1 -0
- package/node_modules/@fps-games/babylon-renderer/dist/shadows/static-projected-shadow-baker.js +813 -0
- package/node_modules/@fps-games/babylon-renderer/dist/shadows/static-projected-shadow-baker.js.map +1 -0
- package/node_modules/@fps-games/babylon-renderer/dist/shadows/static-projected-shadow-rendering.d.ts +27 -0
- package/node_modules/@fps-games/babylon-renderer/dist/shadows/static-projected-shadow-rendering.d.ts.map +1 -0
- package/node_modules/@fps-games/babylon-renderer/dist/shadows/static-projected-shadow-rendering.js +220 -0
- package/node_modules/@fps-games/babylon-renderer/dist/shadows/static-projected-shadow-rendering.js.map +1 -0
- package/node_modules/@fps-games/babylon-renderer/dist/shadows/static-projected-shadow-system.d.ts +35 -3
- package/node_modules/@fps-games/babylon-renderer/dist/shadows/static-projected-shadow-system.d.ts.map +1 -1
- package/node_modules/@fps-games/babylon-renderer/dist/shadows/static-projected-shadow-system.js +65 -609
- package/node_modules/@fps-games/babylon-renderer/dist/shadows/static-projected-shadow-system.js.map +1 -1
- package/node_modules/@fps-games/babylon-renderer/dist/shadows/types.d.ts +169 -14
- package/node_modules/@fps-games/babylon-renderer/dist/shadows/types.d.ts.map +1 -1
- package/node_modules/@fps-games/babylon-renderer/dist/shadows/types.js +9 -3
- package/node_modules/@fps-games/babylon-renderer/dist/shadows/types.js.map +1 -1
- package/node_modules/@fps-games/babylon-renderer/package.json +1 -1
- package/node_modules/@fps-games/editor-babylon/dist/index.d.ts +2 -0
- package/node_modules/@fps-games/editor-babylon/dist/index.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-babylon/dist/index.js +2 -0
- package/node_modules/@fps-games/editor-babylon/dist/index.js.map +1 -1
- package/node_modules/@fps-games/editor-babylon/dist/performance-monitor.d.ts +34 -0
- package/node_modules/@fps-games/editor-babylon/dist/performance-monitor.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-babylon/dist/performance-monitor.js +272 -0
- package/node_modules/@fps-games/editor-babylon/dist/performance-monitor.js.map +1 -0
- package/node_modules/@fps-games/editor-babylon/dist/projection.d.ts +6 -0
- package/node_modules/@fps-games/editor-babylon/dist/projection.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-babylon/dist/projection.js +65 -1
- package/node_modules/@fps-games/editor-babylon/dist/projection.js.map +1 -1
- package/node_modules/@fps-games/editor-babylon/dist/rendering.d.ts +19 -0
- package/node_modules/@fps-games/editor-babylon/dist/rendering.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-babylon/dist/rendering.js +66 -0
- package/node_modules/@fps-games/editor-babylon/dist/rendering.js.map +1 -0
- package/node_modules/@fps-games/editor-babylon/dist/shadow-preview-controller.d.ts +5 -2
- package/node_modules/@fps-games/editor-babylon/dist/shadow-preview-controller.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-babylon/dist/shadow-preview-controller.js +65 -32
- package/node_modules/@fps-games/editor-babylon/dist/shadow-preview-controller.js.map +1 -1
- package/node_modules/@fps-games/editor-babylon/dist/transform-gizmo-controller.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-babylon/dist/transform-gizmo-controller.js +19 -2
- package/node_modules/@fps-games/editor-babylon/dist/transform-gizmo-controller.js.map +1 -1
- package/node_modules/@fps-games/editor-babylon/package.json +5 -5
- package/node_modules/@fps-games/editor-browser/dist/index.d.ts +1 -1
- package/node_modules/@fps-games/editor-browser/dist/index.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/index.js.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-rendering-actions.d.ts +8 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-rendering-actions.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-rendering-actions.js +14 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-rendering-actions.js.map +1 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-tree.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-tree.js +10 -2
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-tree.js.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-icons.d.ts +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-icons.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-icons.js +17 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-icons.js.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-panels.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-panels.js +466 -42
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-panels.js.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-types.d.ts +70 -5
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-types.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui.d.ts +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui.js +595 -5
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui.js.map +1 -1
- package/node_modules/@fps-games/editor-browser/package.json +3 -3
- package/node_modules/@fps-games/editor-core/dist/editor-session.d.ts +14 -1
- package/node_modules/@fps-games/editor-core/dist/editor-session.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-core/dist/editor-session.js +34 -10
- package/node_modules/@fps-games/editor-core/dist/editor-session.js.map +1 -1
- package/node_modules/@fps-games/editor-core/dist/inspector.d.ts +2 -1
- package/node_modules/@fps-games/editor-core/dist/inspector.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-core/dist/inspector.js +11 -1
- package/node_modules/@fps-games/editor-core/dist/inspector.js.map +1 -1
- package/node_modules/@fps-games/editor-core/dist/serialized-object.d.ts +7 -0
- package/node_modules/@fps-games/editor-core/dist/serialized-object.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-core/dist/serialized-object.js +1 -0
- package/node_modules/@fps-games/editor-core/dist/serialized-object.js.map +1 -1
- package/node_modules/@fps-games/editor-core/package.json +2 -2
- package/node_modules/@fps-games/editor-forge-play/package.json +2 -2
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-placement/document.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-placement/document.js +10 -5
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-placement/document.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-placement/placement.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-placement/placement.js +3 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-placement/placement.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/document/helpers.d.ts +4 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/document/helpers.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/document/helpers.js +29 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/document/helpers.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/document/types.d.ts +10 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/document/types.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/field-schema/schema.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/field-schema/schema.js +3 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/field-schema/schema.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/index.d.ts +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/index.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/index.js +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/index.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/inspector/document-sections.d.ts +33 -2
- package/node_modules/@fps-games/editor-playable-sdk/dist/inspector/document-sections.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/inspector/document-sections.js +232 -16
- package/node_modules/@fps-games/editor-playable-sdk/dist/inspector/document-sections.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/inspector/index.d.ts +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/inspector/index.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/inspector/index.js +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/inspector/index.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/mutation/field-patch.d.ts +12 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/mutation/field-patch.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/mutation/field-patch.js +153 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/mutation/field-patch.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/mutation/index.d.ts +4 -2
- package/node_modules/@fps-games/editor-playable-sdk/dist/mutation/index.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/mutation/index.js +2 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/mutation/index.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/mutation/reducer.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/mutation/reducer.js +4 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/mutation/reducer.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/mutation/rendering-alpha-index.d.ts +19 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/mutation/rendering-alpha-index.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/mutation/rendering-alpha-index.js +57 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/mutation/rendering-alpha-index.js.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/mutation/types.d.ts +7 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/mutation/types.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/rendering-profile/panel.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/rendering-profile/panel.js +620 -36
- package/node_modules/@fps-games/editor-playable-sdk/dist/rendering-profile/panel.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/rendering-profile/profile.d.ts +8 -3
- package/node_modules/@fps-games/editor-playable-sdk/dist/rendering-profile/profile.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/rendering-profile/profile.js +258 -10
- package/node_modules/@fps-games/editor-playable-sdk/dist/rendering-profile/profile.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/rendering-profile/types.d.ts +110 -3
- package/node_modules/@fps-games/editor-playable-sdk/dist/rendering-profile/types.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/runtime-preview/nodes.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/runtime-preview/nodes.js +25 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/runtime-preview/nodes.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/runtime-preview/types.d.ts +2 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/runtime-preview/types.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/scene-source/client.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/scene-source/client.js +4 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/scene-source/client.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/scene-source/companion-configs.d.ts +9 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/scene-source/companion-configs.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/scene-source/companion-configs.js +12 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/scene-source/companion-configs.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/scene-source/types.d.ts +2 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/scene-source/types.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/serialized-property/descriptors.d.ts +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/serialized-property/descriptors.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/serialized-property/descriptors.js +75 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/serialized-property/descriptors.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/serialized-property/index.d.ts +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/serialized-property/index.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/serialized-property/index.js +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/serialized-property/index.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/serialized-property/inspector.d.ts +17 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/serialized-property/inspector.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/serialized-property/inspector.js +262 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/serialized-property/inspector.js.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/serialized-property/object.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/serialized-property/object.js +7 -3
- package/node_modules/@fps-games/editor-playable-sdk/dist/serialized-property/object.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/session/identity.d.ts +6 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/session/identity.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/session/identity.js +31 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/session/identity.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/session/index.d.ts +2 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/session/index.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/session/index.js +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/session/index.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/session/patches.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/session/patches.js +21 -9
- package/node_modules/@fps-games/editor-playable-sdk/dist/session/patches.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/static-shadows/artifact.d.ts +151 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/static-shadows/artifact.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/static-shadows/artifact.js +445 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/static-shadows/artifact.js.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/static-shadows/index.d.ts +2 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/static-shadows/index.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/static-shadows/index.js +2 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/static-shadows/index.js.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/package.json +3 -3
- package/node_modules/@fps-games/editor-protocol/package.json +1 -1
- package/package.json +8 -8
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
const EMPTY_PERFORMANCE_SNAPSHOT = {
|
|
2
|
+
drawCalls: null,
|
|
3
|
+
meshes: null,
|
|
4
|
+
activeMeshes: null,
|
|
5
|
+
meshClassCounts: null,
|
|
6
|
+
activeMeshClassCounts: null,
|
|
7
|
+
meshCategoryCounts: null,
|
|
8
|
+
activeMeshCategoryCounts: null,
|
|
9
|
+
materials: null,
|
|
10
|
+
textures: null,
|
|
11
|
+
lights: null,
|
|
12
|
+
cameras: null,
|
|
13
|
+
};
|
|
14
|
+
export function createBabylonEditorPerformanceMonitor(scene) {
|
|
15
|
+
let disposed = false;
|
|
16
|
+
let latestDrawCalls = null;
|
|
17
|
+
const cleanupCallbacks = [];
|
|
18
|
+
const sceneLike = isRecord(scene) ? scene : null;
|
|
19
|
+
if (sceneLike) {
|
|
20
|
+
addSceneObserver(cleanupCallbacks, sceneLike.onBeforeAnimationsObservable, () => {
|
|
21
|
+
readDrawCallsCounter(sceneLike)?.fetchNewFrame?.();
|
|
22
|
+
});
|
|
23
|
+
addSceneObserver(cleanupCallbacks, sceneLike.onAfterRenderObservable, () => {
|
|
24
|
+
latestDrawCalls = readFiniteNumber(readDrawCallsCounter(sceneLike)?.current);
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
return {
|
|
28
|
+
readSnapshot() {
|
|
29
|
+
if (disposed || !sceneLike)
|
|
30
|
+
return cloneBabylonPerformanceSnapshot(EMPTY_PERFORMANCE_SNAPSHOT);
|
|
31
|
+
const meshCensus = readMeshCensus(sceneLike);
|
|
32
|
+
return {
|
|
33
|
+
drawCalls: latestDrawCalls,
|
|
34
|
+
meshes: meshCensus?.meshCount ?? readCollectionCount(sceneLike.meshes),
|
|
35
|
+
activeMeshes: meshCensus?.activeMeshCount ?? readActiveMeshesCount(sceneLike),
|
|
36
|
+
meshClassCounts: cloneBabylonMeshClassCounts(meshCensus?.meshClassCounts ?? null),
|
|
37
|
+
activeMeshClassCounts: cloneBabylonMeshClassCounts(meshCensus?.activeMeshClassCounts ?? null),
|
|
38
|
+
meshCategoryCounts: cloneBabylonMeshCategoryCounts(meshCensus?.meshCategoryCounts ?? null),
|
|
39
|
+
activeMeshCategoryCounts: cloneBabylonMeshCategoryCounts(meshCensus?.activeMeshCategoryCounts ?? null),
|
|
40
|
+
materials: readCollectionCount(sceneLike.materials),
|
|
41
|
+
textures: readCollectionCount(sceneLike.textures),
|
|
42
|
+
lights: readCollectionCount(sceneLike.lights),
|
|
43
|
+
cameras: readCollectionCount(sceneLike.cameras),
|
|
44
|
+
};
|
|
45
|
+
},
|
|
46
|
+
dispose() {
|
|
47
|
+
if (disposed)
|
|
48
|
+
return;
|
|
49
|
+
disposed = true;
|
|
50
|
+
for (const cleanup of cleanupCallbacks.splice(0))
|
|
51
|
+
cleanup();
|
|
52
|
+
latestDrawCalls = null;
|
|
53
|
+
},
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
export function cloneBabylonPerformanceSnapshot(snapshot) {
|
|
57
|
+
return {
|
|
58
|
+
...snapshot,
|
|
59
|
+
meshClassCounts: cloneBabylonMeshClassCounts(snapshot.meshClassCounts),
|
|
60
|
+
activeMeshClassCounts: cloneBabylonMeshClassCounts(snapshot.activeMeshClassCounts),
|
|
61
|
+
meshCategoryCounts: cloneBabylonMeshCategoryCounts(snapshot.meshCategoryCounts),
|
|
62
|
+
activeMeshCategoryCounts: cloneBabylonMeshCategoryCounts(snapshot.activeMeshCategoryCounts),
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
function addSceneObserver(cleanupCallbacks, observable, callback) {
|
|
66
|
+
if (!isBabylonObservableLike(observable))
|
|
67
|
+
return;
|
|
68
|
+
const observer = observable.add(callback);
|
|
69
|
+
cleanupCallbacks.push(() => observable.remove(observer));
|
|
70
|
+
}
|
|
71
|
+
function isBabylonObservableLike(value) {
|
|
72
|
+
return !!value
|
|
73
|
+
&& typeof value === 'object'
|
|
74
|
+
&& typeof value.add === 'function'
|
|
75
|
+
&& typeof value.remove === 'function';
|
|
76
|
+
}
|
|
77
|
+
function isRecord(value) {
|
|
78
|
+
return !!value && typeof value === 'object';
|
|
79
|
+
}
|
|
80
|
+
function readDrawCallsCounter(scene) {
|
|
81
|
+
const engine = typeof scene?.getEngine === 'function' ? scene.getEngine() : null;
|
|
82
|
+
const counter = engine?._drawCalls;
|
|
83
|
+
return counter && typeof counter === 'object' ? counter : null;
|
|
84
|
+
}
|
|
85
|
+
function readActiveMeshesCount(scene) {
|
|
86
|
+
if (typeof scene?.getActiveMeshes !== 'function')
|
|
87
|
+
return null;
|
|
88
|
+
try {
|
|
89
|
+
return readCollectionCount(scene.getActiveMeshes());
|
|
90
|
+
}
|
|
91
|
+
catch {
|
|
92
|
+
return null;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
function readMeshCensus(scene) {
|
|
96
|
+
const meshes = readCollectionItems(scene.meshes);
|
|
97
|
+
if (!meshes)
|
|
98
|
+
return null;
|
|
99
|
+
const activeMeshes = readActiveMeshItems(scene);
|
|
100
|
+
const activeMeshSet = activeMeshes ? new Set(activeMeshes) : null;
|
|
101
|
+
const meshClassCounts = createEmptyMeshClassCounts();
|
|
102
|
+
const meshCategoryCounts = createEmptyMeshCategoryCounts();
|
|
103
|
+
const activeMeshClassCounts = activeMeshSet ? createEmptyMeshClassCounts() : null;
|
|
104
|
+
const activeMeshCategoryCounts = activeMeshSet ? createEmptyMeshCategoryCounts() : null;
|
|
105
|
+
for (const mesh of meshes) {
|
|
106
|
+
const classKey = classifyMeshClass(mesh);
|
|
107
|
+
const categoryKey = classifyMeshCategory(mesh);
|
|
108
|
+
meshClassCounts[classKey] += 1;
|
|
109
|
+
meshCategoryCounts[categoryKey] += 1;
|
|
110
|
+
if (activeMeshSet?.has(mesh)) {
|
|
111
|
+
activeMeshClassCounts[classKey] += 1;
|
|
112
|
+
activeMeshCategoryCounts[categoryKey] += 1;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
return {
|
|
116
|
+
meshCount: meshes.length,
|
|
117
|
+
activeMeshCount: activeMeshes?.length ?? null,
|
|
118
|
+
meshClassCounts,
|
|
119
|
+
activeMeshClassCounts,
|
|
120
|
+
meshCategoryCounts,
|
|
121
|
+
activeMeshCategoryCounts,
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
function readActiveMeshItems(scene) {
|
|
125
|
+
if (typeof scene?.getActiveMeshes !== 'function')
|
|
126
|
+
return null;
|
|
127
|
+
try {
|
|
128
|
+
return readCollectionItems(scene.getActiveMeshes());
|
|
129
|
+
}
|
|
130
|
+
catch {
|
|
131
|
+
return null;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
function readCollectionItems(value) {
|
|
135
|
+
if (Array.isArray(value))
|
|
136
|
+
return value;
|
|
137
|
+
if (!value || typeof value !== 'object')
|
|
138
|
+
return null;
|
|
139
|
+
const data = value.data;
|
|
140
|
+
const length = readFiniteNumber(value.length);
|
|
141
|
+
if (Array.isArray(data) && length != null)
|
|
142
|
+
return data.slice(0, Math.max(0, Math.floor(length)));
|
|
143
|
+
if (length == null)
|
|
144
|
+
return null;
|
|
145
|
+
const items = [];
|
|
146
|
+
const indexed = value;
|
|
147
|
+
for (let index = 0; index < length; index += 1) {
|
|
148
|
+
if (!(index in indexed))
|
|
149
|
+
return null;
|
|
150
|
+
items.push(indexed[index]);
|
|
151
|
+
}
|
|
152
|
+
return items;
|
|
153
|
+
}
|
|
154
|
+
function readCollectionCount(value) {
|
|
155
|
+
if (!value || typeof value !== 'object')
|
|
156
|
+
return null;
|
|
157
|
+
const length = value.length;
|
|
158
|
+
return readFiniteNumber(length);
|
|
159
|
+
}
|
|
160
|
+
function readFiniteNumber(value) {
|
|
161
|
+
return typeof value === 'number' && Number.isFinite(value) ? value : null;
|
|
162
|
+
}
|
|
163
|
+
function createEmptyMeshClassCounts() {
|
|
164
|
+
return {
|
|
165
|
+
mesh: 0,
|
|
166
|
+
instancedMesh: 0,
|
|
167
|
+
linesMesh: 0,
|
|
168
|
+
groundMesh: 0,
|
|
169
|
+
other: 0,
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
function createEmptyMeshCategoryCounts() {
|
|
173
|
+
return {
|
|
174
|
+
assetMesh: 0,
|
|
175
|
+
primitiveMesh: 0,
|
|
176
|
+
staticProjectedShadow: 0,
|
|
177
|
+
editorHelper: 0,
|
|
178
|
+
uncategorized: 0,
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
function cloneBabylonMeshClassCounts(counts) {
|
|
182
|
+
return counts ? { ...counts } : null;
|
|
183
|
+
}
|
|
184
|
+
function cloneBabylonMeshCategoryCounts(counts) {
|
|
185
|
+
return counts ? { ...counts } : null;
|
|
186
|
+
}
|
|
187
|
+
function classifyMeshClass(mesh) {
|
|
188
|
+
const className = readMeshClassName(mesh);
|
|
189
|
+
if (className === 'InstancedMesh')
|
|
190
|
+
return 'instancedMesh';
|
|
191
|
+
if (className === 'LinesMesh')
|
|
192
|
+
return 'linesMesh';
|
|
193
|
+
if (className === 'GroundMesh')
|
|
194
|
+
return 'groundMesh';
|
|
195
|
+
if (className === 'Mesh')
|
|
196
|
+
return 'mesh';
|
|
197
|
+
return 'other';
|
|
198
|
+
}
|
|
199
|
+
function readMeshClassName(mesh) {
|
|
200
|
+
if (!isRecord(mesh))
|
|
201
|
+
return '';
|
|
202
|
+
const getClassName = mesh.getClassName;
|
|
203
|
+
if (typeof getClassName === 'function') {
|
|
204
|
+
try {
|
|
205
|
+
const className = getClassName.call(mesh);
|
|
206
|
+
return typeof className === 'string' ? className : '';
|
|
207
|
+
}
|
|
208
|
+
catch {
|
|
209
|
+
return '';
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
const constructorName = mesh.constructor?.name;
|
|
213
|
+
return typeof constructorName === 'string' ? constructorName : '';
|
|
214
|
+
}
|
|
215
|
+
function classifyMeshCategory(mesh) {
|
|
216
|
+
const projection = readEditorProjectionMetadata(mesh);
|
|
217
|
+
const runtimeKind = typeof projection?.runtimeKind === 'string' ? projection.runtimeKind : '';
|
|
218
|
+
if (isStaticProjectedShadowMesh(mesh))
|
|
219
|
+
return 'staticProjectedShadow';
|
|
220
|
+
if (runtimeKind === 'camera' || runtimeKind === 'light' || projection?.helper != null || isEditorHelperMesh(mesh)) {
|
|
221
|
+
return 'editorHelper';
|
|
222
|
+
}
|
|
223
|
+
if (runtimeKind === 'assetMesh')
|
|
224
|
+
return 'assetMesh';
|
|
225
|
+
if (runtimeKind === 'primitive' || projection?.primitiveShape != null)
|
|
226
|
+
return 'primitiveMesh';
|
|
227
|
+
return 'uncategorized';
|
|
228
|
+
}
|
|
229
|
+
function readEditorProjectionMetadata(mesh) {
|
|
230
|
+
if (!isRecord(mesh))
|
|
231
|
+
return null;
|
|
232
|
+
const metadata = isRecord(mesh.metadata) ? mesh.metadata : null;
|
|
233
|
+
const projection = metadata && isRecord(metadata.editorProjection) ? metadata.editorProjection : null;
|
|
234
|
+
return projection;
|
|
235
|
+
}
|
|
236
|
+
function isStaticProjectedShadowMesh(mesh) {
|
|
237
|
+
if (!isRecord(mesh))
|
|
238
|
+
return false;
|
|
239
|
+
const metadata = isRecord(mesh.metadata) ? mesh.metadata : null;
|
|
240
|
+
if (metadata?.staticProjectedShadowInternal === true)
|
|
241
|
+
return true;
|
|
242
|
+
const material = isRecord(mesh.material) ? mesh.material : null;
|
|
243
|
+
return hasPerformanceNameFragment(mesh, 'staticProjected')
|
|
244
|
+
|| hasPerformanceNameFragment(material, 'staticProjected');
|
|
245
|
+
}
|
|
246
|
+
function isEditorHelperMesh(mesh) {
|
|
247
|
+
if (!isRecord(mesh))
|
|
248
|
+
return false;
|
|
249
|
+
const metadata = isRecord(mesh.metadata) ? mesh.metadata : null;
|
|
250
|
+
if (metadata?.editorProjectionHelper === true)
|
|
251
|
+
return true;
|
|
252
|
+
const material = isRecord(mesh.material) ? mesh.material : null;
|
|
253
|
+
return hasPerformanceNameFragment(mesh, 'editor.world.sky')
|
|
254
|
+
|| hasPerformanceNameFragment(mesh, 'editor-grid')
|
|
255
|
+
|| hasPerformanceNameFragment(mesh, 'editorGrid')
|
|
256
|
+
|| hasPerformanceNameFragment(mesh, 'grid-screen-layer')
|
|
257
|
+
|| hasPerformanceNameFragment(material, 'editor.world.sky')
|
|
258
|
+
|| hasPerformanceNameFragment(material, 'editor-grid')
|
|
259
|
+
|| hasPerformanceNameFragment(material, 'editorGrid')
|
|
260
|
+
|| hasPerformanceNameFragment(material, 'grid-screen-layer');
|
|
261
|
+
}
|
|
262
|
+
function hasPerformanceNameFragment(value, fragment) {
|
|
263
|
+
if (!isRecord(value))
|
|
264
|
+
return false;
|
|
265
|
+
return readPerformanceNameCandidates(value)
|
|
266
|
+
.some(candidate => candidate.includes(fragment));
|
|
267
|
+
}
|
|
268
|
+
function readPerformanceNameCandidates(value) {
|
|
269
|
+
return [value.name, value.id]
|
|
270
|
+
.filter((candidate) => typeof candidate === 'string');
|
|
271
|
+
}
|
|
272
|
+
//# sourceMappingURL=performance-monitor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"performance-monitor.js","sourceRoot":"","sources":["../src/performance-monitor.ts"],"names":[],"mappings":"AA0CA,MAAM,0BAA0B,GAAqC;IACnE,SAAS,EAAE,IAAI;IACf,MAAM,EAAE,IAAI;IACZ,YAAY,EAAE,IAAI;IAClB,eAAe,EAAE,IAAI;IACrB,qBAAqB,EAAE,IAAI;IAC3B,kBAAkB,EAAE,IAAI;IACxB,wBAAwB,EAAE,IAAI;IAC9B,SAAS,EAAE,IAAI;IACf,QAAQ,EAAE,IAAI;IACd,MAAM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,IAAI,EAAE,aAAa,CAAC;WAC/C,0BAA0B,CAAC,IAAI,EAAE,YAAY,CAAC;WAC9C,0BAA0B,CAAC,IAAI,EAAE,mBAAmB,CAAC;WACrD,0BAA0B,CAAC,QAAQ,EAAE,kBAAkB,CAAC;WACxD,0BAA0B,CAAC,QAAQ,EAAE,aAAa,CAAC;WACnD,0BAA0B,CAAC,QAAQ,EAAE,YAAY,CAAC;WAClD,0BAA0B,CAAC,QAAQ,EAAE,mBAAmB,CAAC,CAAC;AACjE,CAAC;AAED,SAAS,0BAA0B,CAAC,KAAc,EAAE,QAAgB;IAClE,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IACnC,OAAO,6BAA6B,CAAC,KAAK,CAAC;SACxC,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC;AACrD,CAAC;AAED,SAAS,6BAA6B,CAAC,KAA0B;IAC/D,OAAO,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC;SAC1B,MAAM,CAAC,CAAC,SAAS,EAAuB,EAAE,CAAC,OAAO,SAAS,KAAK,QAAQ,CAAC,CAAC;AAC/E,CAAC"}
|
|
@@ -74,6 +74,10 @@ export interface BabylonEditorProjectionHemisphericLightSettings {
|
|
|
74
74
|
}
|
|
75
75
|
export type BabylonEditorProjectionLightSettings = BabylonEditorProjectionDirectionalLightSettings | BabylonEditorProjectionHemisphericLightSettings;
|
|
76
76
|
export type BabylonEditorProjectionShadowMode = 'default' | 'none' | 'blob' | 'static' | 'planar' | 'dynamic';
|
|
77
|
+
export interface BabylonEditorProjectionRendering {
|
|
78
|
+
renderingGroupId?: number;
|
|
79
|
+
alphaIndex?: number;
|
|
80
|
+
}
|
|
77
81
|
export interface BabylonEditorProjectionNode {
|
|
78
82
|
id: string;
|
|
79
83
|
name?: string;
|
|
@@ -85,6 +89,7 @@ export interface BabylonEditorProjectionNode {
|
|
|
85
89
|
helperKind?: 'root';
|
|
86
90
|
runtimeKind?: 'camera' | 'light';
|
|
87
91
|
shadowMode?: BabylonEditorProjectionShadowMode;
|
|
92
|
+
rendering?: BabylonEditorProjectionRendering;
|
|
88
93
|
camera?: BabylonEditorProjectionCameraSettings;
|
|
89
94
|
light?: BabylonEditorProjectionLightSettings;
|
|
90
95
|
outline?: BabylonEditorProjectionOutline | null;
|
|
@@ -171,6 +176,7 @@ export interface BabylonEditorProjection {
|
|
|
171
176
|
getSelectionBounds(nodeIds: string[]): BabylonEditorProjectionBounds | null;
|
|
172
177
|
getSelectionPivot(nodeIds: string[]): EditorTransformPivot | null;
|
|
173
178
|
syncNodeTransform(node: BabylonEditorProjectionNode): void;
|
|
179
|
+
syncNodeMetadata(node: BabylonEditorProjectionNode): void;
|
|
174
180
|
syncSelection(selection: EditorSelectionState): void;
|
|
175
181
|
resolveProjectionNodeId(target: unknown): string | null;
|
|
176
182
|
resolvePickSelectionNodeId(target: unknown): string | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"projection.d.ts","sourceRoot":"","sources":["../src/projection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,oBAAoB,EACpB,oBAAoB,EACpB,uBAAuB,EACvB,mBAAmB,EACpB,MAAM,wBAAwB,CAAC;AAKhC,OAAO,KAAK,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAE1H,OAAO,KAAK,EACV,oBAAoB,EACpB,aAAa,EACb,YAAY,EACb,MAAM,SAAS,CAAC;AAGjB,MAAM,MAAM,2BAA2B,GAAG,mBAAmB,CAAC;AAC9D,MAAM,WAAW,2BAA2B;IAC1C,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX;
|
|
1
|
+
{"version":3,"file":"projection.d.ts","sourceRoot":"","sources":["../src/projection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,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IACZ,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,6BAA6B;IAC5C,GAAG,EAAE,2BAA2B,CAAC;IACjC,GAAG,EAAE,2BAA2B,CAAC;IACjC,MAAM,EAAE,2BAA2B,CAAC;IACpC,IAAI,EAAE,2BAA2B,CAAC;CACnC;AAsBD,wBAAgB,6BAA6B,CAC3C,OAAO,EAAE,8BAA8B,GACtC,uBAAuB,CAkVzB;AA4FD,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,GAAG,GAAG,uBAAuB,CAE1E;AA6yBD,wBAAgB,8CAA8C,CAC5D,QAAQ,EAAE,qCAAqC,GAAG,SAAS,GAC1D,qCAAqC,CAoBvC;AAED,wBAAgB,qCAAqC,CACnD,OAAO,EAAE,oBAAoB,EAC7B,KAAK,EAAE,YAAY,EACnB,MAAM,EAAE,aAAa,EACrB,QAAQ,EAAE,qCAAqC,GAAG,SAAS,EAC3D,OAAO,GAAE,4CAAiD,GACzD,qCAAqC,CAmDvC;AAiKD,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,oBAAoB,EAC7B,IAAI,EAAE,GAAG,EACT,SAAS,EAAE,gCAAgC,GAC1C,IAAI,CAMN"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { combineEditorTransforms, toEditorLocalTransformFromWorld, } from '@fps-games/editor-core';
|
|
2
2
|
import { applyBabylonDefaultOutline } from '@fps-games/babylon-renderer';
|
|
3
3
|
import { applyArtistMaterialProfileToRuntimeMaterial } from './material-property-adapter.js';
|
|
4
|
+
const LARGE_SELECTION_EDGE_LIMIT = 200;
|
|
4
5
|
const ASSET_MESH_SELECTION_SEPARATOR = '::assetMesh::';
|
|
5
6
|
function requireBabylonCtor(value, name) {
|
|
6
7
|
if (!value)
|
|
@@ -309,6 +310,12 @@ export function createBabylonEditorProjection(options) {
|
|
|
309
310
|
applyProjectionTransform(options.babylon, projection.root, node.transform);
|
|
310
311
|
scheduleProjectionSelectionEdgesPrewarm(projection);
|
|
311
312
|
},
|
|
313
|
+
syncNodeMetadata(node) {
|
|
314
|
+
const projection = projections.get(node.id);
|
|
315
|
+
if (!projection)
|
|
316
|
+
return;
|
|
317
|
+
syncProjectionNodeMetadata(projection, node);
|
|
318
|
+
},
|
|
312
319
|
syncSelection(selection) {
|
|
313
320
|
syncProjectionSelection(options.babylon, projections, selection);
|
|
314
321
|
},
|
|
@@ -530,6 +537,7 @@ function attachImportedProjectionResult(options, node, asset, projection, result
|
|
|
530
537
|
}
|
|
531
538
|
for (const mesh of result.meshes ?? []) {
|
|
532
539
|
mesh.isPickable = true;
|
|
540
|
+
applyProjectionRenderingToMesh(node, mesh);
|
|
533
541
|
const ownerNodePath = buildProjectionOwnerNodePath(mesh, modelRoot);
|
|
534
542
|
if (ownerNodePath) {
|
|
535
543
|
const selectionKey = resolveProjectionAssetMeshSelectionKey(asset, ownerNodePath);
|
|
@@ -723,6 +731,7 @@ function createPrimitiveProjectionMesh(babylon, scene, node, options) {
|
|
|
723
731
|
material.backFaceCulling = false;
|
|
724
732
|
applyProjectionArtistMaterialProfile({ babylon, scene, resolveTextureUrl: options?.resolveTextureUrl }, material, node.artistMaterialProfile);
|
|
725
733
|
mesh.material = material;
|
|
734
|
+
applyProjectionRenderingToMesh(node, mesh);
|
|
726
735
|
mesh.metadata = createProjectionMetadata(node.id, {
|
|
727
736
|
runtimeKind: 'primitive',
|
|
728
737
|
primitiveShape: shape,
|
|
@@ -971,6 +980,7 @@ function createFallbackProjectionMesh(babylon, scene, node, rendererFallback) {
|
|
|
971
980
|
}
|
|
972
981
|
material.specularColor = new Color3(0.08, 0.1, 0.12);
|
|
973
982
|
mesh.material = material;
|
|
983
|
+
applyProjectionRenderingToMesh(node, mesh);
|
|
974
984
|
mesh.metadata = {
|
|
975
985
|
...(mesh.metadata ?? {}),
|
|
976
986
|
editorProjection: {
|
|
@@ -981,6 +991,20 @@ function createFallbackProjectionMesh(babylon, scene, node, rendererFallback) {
|
|
|
981
991
|
};
|
|
982
992
|
return mesh;
|
|
983
993
|
}
|
|
994
|
+
function applyProjectionRenderingToMesh(node, mesh) {
|
|
995
|
+
const rendering = node.rendering;
|
|
996
|
+
if (!mesh || !rendering)
|
|
997
|
+
return;
|
|
998
|
+
if (isProjectionRenderingGroupId(rendering.renderingGroupId)) {
|
|
999
|
+
mesh.renderingGroupId = rendering.renderingGroupId;
|
|
1000
|
+
}
|
|
1001
|
+
if (typeof rendering.alphaIndex === 'number' && Number.isFinite(rendering.alphaIndex)) {
|
|
1002
|
+
mesh.alphaIndex = rendering.alphaIndex;
|
|
1003
|
+
}
|
|
1004
|
+
}
|
|
1005
|
+
function isProjectionRenderingGroupId(value) {
|
|
1006
|
+
return value === 0 || value === 1 || value === 2 || value === 3;
|
|
1007
|
+
}
|
|
984
1008
|
function createCameraFrustumLines(babylon, scene, node, settings) {
|
|
985
1009
|
const MeshBuilder = babylon.MeshBuilder;
|
|
986
1010
|
const Vector3 = requireBabylonCtor(babylon.Vector3, 'Vector3');
|
|
@@ -1274,6 +1298,44 @@ function createProjectionMetadata(nodeId, extra = {}) {
|
|
|
1274
1298
|
},
|
|
1275
1299
|
};
|
|
1276
1300
|
}
|
|
1301
|
+
function syncProjectionNodeMetadata(projection, node) {
|
|
1302
|
+
walkProjectionRuntimeNodes(projection.root, (runtimeNode) => {
|
|
1303
|
+
syncProjectionRuntimeNodeMetadata(runtimeNode, node);
|
|
1304
|
+
});
|
|
1305
|
+
}
|
|
1306
|
+
function walkProjectionRuntimeNodes(node, visit) {
|
|
1307
|
+
if (!node)
|
|
1308
|
+
return;
|
|
1309
|
+
visit(node);
|
|
1310
|
+
const children = typeof node.getChildren === 'function' ? node.getChildren() : [];
|
|
1311
|
+
if (!Array.isArray(children))
|
|
1312
|
+
return;
|
|
1313
|
+
for (const child of children) {
|
|
1314
|
+
walkProjectionRuntimeNodes(child, visit);
|
|
1315
|
+
}
|
|
1316
|
+
}
|
|
1317
|
+
function syncProjectionRuntimeNodeMetadata(runtimeNode, node) {
|
|
1318
|
+
const metadata = readProjectionObject(runtimeNode.metadata);
|
|
1319
|
+
const editorProjection = readProjectionObject(metadata?.editorProjection);
|
|
1320
|
+
if (!editorProjection)
|
|
1321
|
+
return;
|
|
1322
|
+
if (editorProjection.nodeId !== node.id && editorProjection.rootNodeId !== node.id)
|
|
1323
|
+
return;
|
|
1324
|
+
const nextEditorProjection = { ...editorProjection };
|
|
1325
|
+
if (node.shadowMode)
|
|
1326
|
+
nextEditorProjection.shadowMode = node.shadowMode;
|
|
1327
|
+
else
|
|
1328
|
+
delete nextEditorProjection.shadowMode;
|
|
1329
|
+
runtimeNode.metadata = {
|
|
1330
|
+
...(metadata ?? {}),
|
|
1331
|
+
editorProjection: nextEditorProjection,
|
|
1332
|
+
};
|
|
1333
|
+
}
|
|
1334
|
+
function readProjectionObject(value) {
|
|
1335
|
+
return value && typeof value === 'object' && !Array.isArray(value)
|
|
1336
|
+
? value
|
|
1337
|
+
: null;
|
|
1338
|
+
}
|
|
1277
1339
|
export function applyProjectionTransform(babylon, node, transform) {
|
|
1278
1340
|
const Vector3 = requireBabylonCtor(babylon.Vector3, 'Vector3');
|
|
1279
1341
|
node.position = new Vector3(transform.position.x, transform.position.y, transform.position.z);
|
|
@@ -1400,7 +1462,9 @@ function rectsIntersect(left, right) {
|
|
|
1400
1462
|
}
|
|
1401
1463
|
function syncProjectionSelection(babylon, projections, selection) {
|
|
1402
1464
|
const Color4 = babylon.Color4;
|
|
1403
|
-
const selectedIds = new Set(selection.selectedIds
|
|
1465
|
+
const selectedIds = new Set(selection.selectedIds.length > LARGE_SELECTION_EDGE_LIMIT
|
|
1466
|
+
? [selection.activeId].filter((id) => !!id)
|
|
1467
|
+
: selection.selectedIds);
|
|
1404
1468
|
for (const [nodeId, projection] of projections) {
|
|
1405
1469
|
const rootSelected = selectedIds.has(nodeId);
|
|
1406
1470
|
const rootActive = selection.activeId === nodeId;
|