@fps-games/editor 0.1.4-beta.5 → 0.1.5-beta.2
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 +457 -91
- 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-pick-resolver.d.ts +26 -0
- package/node_modules/@fps-games/editor-babylon/dist/projection-pick-resolver.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-babylon/dist/projection-pick-resolver.js +312 -0
- package/node_modules/@fps-games/editor-babylon/dist/projection-pick-resolver.js.map +1 -0
- package/node_modules/@fps-games/editor-babylon/dist/projection-selection-controller.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-babylon/dist/projection-selection-controller.js +51 -29
- package/node_modules/@fps-games/editor-babylon/dist/projection-selection-controller.js.map +1 -1
- 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 +69 -40
- 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-actions.d.ts +5 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-actions.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-actions.js +34 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-actions.js.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-attach-dialog.d.ts +47 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-attach-dialog.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-attach-dialog.js +404 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-attach-dialog.js.map +1 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-controller.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-controller.js +59 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-controller.js.map +1 -1
- 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-input-router.d.ts +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-input-router.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-input-router.js +12 -6
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-input-router.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 +3 -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 +596 -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
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { resolveEditorSelectionCommand, } from '@fps-games/editor-core';
|
|
2
|
+
import { pickBabylonProjectionAt, pickBabylonProjectionAtAsync, } from './projection-pick-resolver.js';
|
|
2
3
|
const CLICK_DRAG_THRESHOLD_PX = 5;
|
|
3
4
|
export function createBabylonProjectionSelectionController(options) {
|
|
4
5
|
let drag = null;
|
|
5
6
|
let disposed = false;
|
|
7
|
+
let pickGeneration = 0;
|
|
6
8
|
function isBoxSelectionCandidate(event) {
|
|
7
9
|
if (disposed || event.button !== 0 || options.isOperationBlocked?.())
|
|
8
10
|
return false;
|
|
@@ -17,6 +19,7 @@ export function createBabylonProjectionSelectionController(options) {
|
|
|
17
19
|
const tool = options.getTool();
|
|
18
20
|
if (!isSelectionPointerAllowed(event, tool))
|
|
19
21
|
return;
|
|
22
|
+
pickGeneration += 1;
|
|
20
23
|
const pick = pickScene(options, event.clientX, event.clientY);
|
|
21
24
|
drag = {
|
|
22
25
|
pointerId: event.pointerId,
|
|
@@ -63,40 +66,24 @@ export function createBabylonProjectionSelectionController(options) {
|
|
|
63
66
|
const moved = pointerDistance(current.startX, current.startY, event.clientX, event.clientY);
|
|
64
67
|
if (moved >= CLICK_DRAG_THRESHOLD_PX)
|
|
65
68
|
return;
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
return;
|
|
69
|
-
dispatchPointerSelection(options, current.startNodeId, current);
|
|
70
|
-
return;
|
|
71
|
-
}
|
|
72
|
-
if (current.startHit)
|
|
73
|
-
return;
|
|
74
|
-
if (!current.additive && !current.toggle) {
|
|
75
|
-
options.onSelectionCommand?.({ type: 'selection.clear', label: 'Clear Selection' });
|
|
76
|
-
}
|
|
69
|
+
const generation = ++pickGeneration;
|
|
70
|
+
void finishPointerClickSelection(current, event.clientX, event.clientY, generation);
|
|
77
71
|
}
|
|
78
72
|
function handleDoubleClick(event) {
|
|
79
73
|
if (disposed || options.isOperationBlocked?.())
|
|
80
74
|
return;
|
|
81
|
-
const
|
|
82
|
-
if (!
|
|
75
|
+
const initialPick = pickScene(options, event.clientX, event.clientY);
|
|
76
|
+
if (!initialPick.hit && !initialPick.nodeId)
|
|
83
77
|
return;
|
|
84
|
-
const selection = options.getSelection();
|
|
85
|
-
if (!selection.selectedIds.includes(pick.nodeId)) {
|
|
86
|
-
options.onSelectionCommand?.({
|
|
87
|
-
type: 'selection.replace',
|
|
88
|
-
selectedIds: [pick.nodeId],
|
|
89
|
-
activeId: pick.nodeId,
|
|
90
|
-
label: 'Select Object',
|
|
91
|
-
});
|
|
92
|
-
}
|
|
93
78
|
event.preventDefault();
|
|
94
79
|
event.stopPropagation();
|
|
95
|
-
|
|
80
|
+
const generation = ++pickGeneration;
|
|
81
|
+
void finishDoubleClickFocus(event, generation);
|
|
96
82
|
}
|
|
97
83
|
function cancelBoxSelection() {
|
|
98
84
|
const current = drag;
|
|
99
85
|
drag = null;
|
|
86
|
+
pickGeneration += 1;
|
|
100
87
|
if (current?.boxActive) {
|
|
101
88
|
options.onBoxSelectionChange?.(null);
|
|
102
89
|
}
|
|
@@ -112,9 +99,43 @@ export function createBabylonProjectionSelectionController(options) {
|
|
|
112
99
|
if (disposed)
|
|
113
100
|
return;
|
|
114
101
|
disposed = true;
|
|
102
|
+
pickGeneration += 1;
|
|
115
103
|
cancelBoxSelection();
|
|
116
104
|
},
|
|
117
105
|
};
|
|
106
|
+
async function finishPointerClickSelection(current, clientX, clientY, generation) {
|
|
107
|
+
const pick = await pickSceneAsync(options, clientX, clientY);
|
|
108
|
+
if (disposed || generation !== pickGeneration)
|
|
109
|
+
return;
|
|
110
|
+
if (pick.nodeId) {
|
|
111
|
+
if (!isSelectable(options, pick.nodeId))
|
|
112
|
+
return;
|
|
113
|
+
dispatchPointerSelection(options, pick.nodeId, current);
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
if (pick.hit || current.startHit)
|
|
117
|
+
return;
|
|
118
|
+
if (!current.additive && !current.toggle) {
|
|
119
|
+
options.onSelectionCommand?.({ type: 'selection.clear', label: 'Clear Selection' });
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
async function finishDoubleClickFocus(event, generation) {
|
|
123
|
+
const pick = await pickSceneAsync(options, event.clientX, event.clientY);
|
|
124
|
+
if (disposed || generation !== pickGeneration)
|
|
125
|
+
return;
|
|
126
|
+
if (!pick.nodeId || !isSelectable(options, pick.nodeId))
|
|
127
|
+
return;
|
|
128
|
+
const selection = options.getSelection();
|
|
129
|
+
if (!selection.selectedIds.includes(pick.nodeId)) {
|
|
130
|
+
options.onSelectionCommand?.({
|
|
131
|
+
type: 'selection.replace',
|
|
132
|
+
selectedIds: [pick.nodeId],
|
|
133
|
+
activeId: pick.nodeId,
|
|
134
|
+
label: 'Select Object',
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
options.onFocusIntent?.(pick.nodeId);
|
|
138
|
+
}
|
|
118
139
|
}
|
|
119
140
|
function isSelectionPointerAllowed(event, tool) {
|
|
120
141
|
if (event.altKey)
|
|
@@ -125,12 +146,13 @@ function pickScene(options, clientX, clientY) {
|
|
|
125
146
|
const rect = options.canvas.getBoundingClientRect();
|
|
126
147
|
const x = clientX - rect.left;
|
|
127
148
|
const y = clientY - rect.top;
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
149
|
+
return pickBabylonProjectionAt(options.scene, x, y);
|
|
150
|
+
}
|
|
151
|
+
async function pickSceneAsync(options, clientX, clientY) {
|
|
152
|
+
const rect = options.canvas.getBoundingClientRect();
|
|
153
|
+
const x = clientX - rect.left;
|
|
154
|
+
const y = clientY - rect.top;
|
|
155
|
+
return pickBabylonProjectionAtAsync(options.scene, x, y);
|
|
134
156
|
}
|
|
135
157
|
function dispatchPointerSelection(options, nodeId, drag) {
|
|
136
158
|
const command = resolveEditorSelectionCommand({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"projection-selection-controller.js","sourceRoot":"","sources":["../src/projection-selection-controller.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,6BAA6B,GAG9B,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"projection-selection-controller.js","sourceRoot":"","sources":["../src/projection-selection-controller.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,6BAA6B,GAG9B,MAAM,wBAAwB,CAAC;AAKhC,OAAO,EACL,uBAAuB,EACvB,4BAA4B,GAC7B,MAAM,4BAA4B,CAAC;AAgDpC,MAAM,uBAAuB,GAAG,CAAC,CAAC;AAElC,MAAM,UAAU,0CAA0C,CACxD,OAAoD;IAEpD,IAAI,IAAI,GAA4B,IAAI,CAAC;IACzC,IAAI,QAAQ,GAAG,KAAK,CAAC;IACrB,IAAI,cAAc,GAAG,CAAC,CAAC;IAEvB,SAAS,uBAAuB,CAAC,KAAmB;QAClD,IAAI,QAAQ,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,IAAI,OAAO,CAAC,kBAAkB,EAAE,EAAE;YAAE,OAAO,KAAK,CAAC;QACnF,IAAI,KAAK,CAAC,MAAM,IAAI,OAAO,CAAC,OAAO,EAAE,KAAK,QAAQ;YAAE,OAAO,KAAK,CAAC;QACjE,MAAM,IAAI,GAAG,SAAS,CAAC,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;QAC9D,OAAO,CAAC,IAAI,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC;IACnC,CAAC;IAED,SAAS,qBAAqB,CAAC,KAAmB;QAChD,IAAI,QAAQ,IAAI,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C,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;IAClD,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;IACjD,OAAO;QACL,MAAM,EAAE,IAAI;QACZ,IAAI;QACJ,GAAG;QACH,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC;QAC5C,MAAM,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC;KAC9C,CAAC;AACJ,CAAC;AAED,SAAS,YAAY,CAAC,IAAsB;IAC1C,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;IAClD,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;IACjD,OAAO;QACL,IAAI;QACJ,GAAG;QACH,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC;QAC3C,MAAM,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC;KAC7C,CAAC;AACJ,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;
|
|
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,8 @@
|
|
|
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
|
+
import { pickBabylonProjectionNodeIdAt, resolveBabylonPickSelectionNodeId, resolveBabylonProjectionNodeId, } from './projection-pick-resolver.js';
|
|
5
|
+
const LARGE_SELECTION_EDGE_LIMIT = 200;
|
|
4
6
|
const ASSET_MESH_SELECTION_SEPARATOR = '::assetMesh::';
|
|
5
7
|
function requireBabylonCtor(value, name) {
|
|
6
8
|
if (!value)
|
|
@@ -309,17 +311,23 @@ export function createBabylonEditorProjection(options) {
|
|
|
309
311
|
applyProjectionTransform(options.babylon, projection.root, node.transform);
|
|
310
312
|
scheduleProjectionSelectionEdgesPrewarm(projection);
|
|
311
313
|
},
|
|
314
|
+
syncNodeMetadata(node) {
|
|
315
|
+
const projection = projections.get(node.id);
|
|
316
|
+
if (!projection)
|
|
317
|
+
return;
|
|
318
|
+
syncProjectionNodeMetadata(projection, node);
|
|
319
|
+
},
|
|
312
320
|
syncSelection(selection) {
|
|
313
321
|
syncProjectionSelection(options.babylon, projections, selection);
|
|
314
322
|
},
|
|
315
323
|
resolveProjectionNodeId(target) {
|
|
316
|
-
return
|
|
324
|
+
return resolveBabylonProjectionNodeId(target);
|
|
317
325
|
},
|
|
318
326
|
resolvePickSelectionNodeId(target) {
|
|
319
|
-
return
|
|
327
|
+
return resolveBabylonPickSelectionNodeId(target);
|
|
320
328
|
},
|
|
321
329
|
pickNodeIdAt(clientX, clientY) {
|
|
322
|
-
return
|
|
330
|
+
return pickBabylonProjectionNodeIdAt(options.scene, clientX, clientY);
|
|
323
331
|
},
|
|
324
332
|
getNodeIdsInScreenRect(rect) {
|
|
325
333
|
return getProjectionNodeIdsInScreenRect(options.babylon, options.scene, projections, rect);
|
|
@@ -530,6 +538,7 @@ function attachImportedProjectionResult(options, node, asset, projection, result
|
|
|
530
538
|
}
|
|
531
539
|
for (const mesh of result.meshes ?? []) {
|
|
532
540
|
mesh.isPickable = true;
|
|
541
|
+
applyProjectionRenderingToMesh(node, mesh);
|
|
533
542
|
const ownerNodePath = buildProjectionOwnerNodePath(mesh, modelRoot);
|
|
534
543
|
if (ownerNodePath) {
|
|
535
544
|
const selectionKey = resolveProjectionAssetMeshSelectionKey(asset, ownerNodePath);
|
|
@@ -723,6 +732,7 @@ function createPrimitiveProjectionMesh(babylon, scene, node, options) {
|
|
|
723
732
|
material.backFaceCulling = false;
|
|
724
733
|
applyProjectionArtistMaterialProfile({ babylon, scene, resolveTextureUrl: options?.resolveTextureUrl }, material, node.artistMaterialProfile);
|
|
725
734
|
mesh.material = material;
|
|
735
|
+
applyProjectionRenderingToMesh(node, mesh);
|
|
726
736
|
mesh.metadata = createProjectionMetadata(node.id, {
|
|
727
737
|
runtimeKind: 'primitive',
|
|
728
738
|
primitiveShape: shape,
|
|
@@ -971,6 +981,7 @@ function createFallbackProjectionMesh(babylon, scene, node, rendererFallback) {
|
|
|
971
981
|
}
|
|
972
982
|
material.specularColor = new Color3(0.08, 0.1, 0.12);
|
|
973
983
|
mesh.material = material;
|
|
984
|
+
applyProjectionRenderingToMesh(node, mesh);
|
|
974
985
|
mesh.metadata = {
|
|
975
986
|
...(mesh.metadata ?? {}),
|
|
976
987
|
editorProjection: {
|
|
@@ -981,6 +992,20 @@ function createFallbackProjectionMesh(babylon, scene, node, rendererFallback) {
|
|
|
981
992
|
};
|
|
982
993
|
return mesh;
|
|
983
994
|
}
|
|
995
|
+
function applyProjectionRenderingToMesh(node, mesh) {
|
|
996
|
+
const rendering = node.rendering;
|
|
997
|
+
if (!mesh || !rendering)
|
|
998
|
+
return;
|
|
999
|
+
if (isProjectionRenderingGroupId(rendering.renderingGroupId)) {
|
|
1000
|
+
mesh.renderingGroupId = rendering.renderingGroupId;
|
|
1001
|
+
}
|
|
1002
|
+
if (typeof rendering.alphaIndex === 'number' && Number.isFinite(rendering.alphaIndex)) {
|
|
1003
|
+
mesh.alphaIndex = rendering.alphaIndex;
|
|
1004
|
+
}
|
|
1005
|
+
}
|
|
1006
|
+
function isProjectionRenderingGroupId(value) {
|
|
1007
|
+
return value === 0 || value === 1 || value === 2 || value === 3;
|
|
1008
|
+
}
|
|
984
1009
|
function createCameraFrustumLines(babylon, scene, node, settings) {
|
|
985
1010
|
const MeshBuilder = babylon.MeshBuilder;
|
|
986
1011
|
const Vector3 = requireBabylonCtor(babylon.Vector3, 'Vector3');
|
|
@@ -1274,6 +1299,44 @@ function createProjectionMetadata(nodeId, extra = {}) {
|
|
|
1274
1299
|
},
|
|
1275
1300
|
};
|
|
1276
1301
|
}
|
|
1302
|
+
function syncProjectionNodeMetadata(projection, node) {
|
|
1303
|
+
walkProjectionRuntimeNodes(projection.root, (runtimeNode) => {
|
|
1304
|
+
syncProjectionRuntimeNodeMetadata(runtimeNode, node);
|
|
1305
|
+
});
|
|
1306
|
+
}
|
|
1307
|
+
function walkProjectionRuntimeNodes(node, visit) {
|
|
1308
|
+
if (!node)
|
|
1309
|
+
return;
|
|
1310
|
+
visit(node);
|
|
1311
|
+
const children = typeof node.getChildren === 'function' ? node.getChildren() : [];
|
|
1312
|
+
if (!Array.isArray(children))
|
|
1313
|
+
return;
|
|
1314
|
+
for (const child of children) {
|
|
1315
|
+
walkProjectionRuntimeNodes(child, visit);
|
|
1316
|
+
}
|
|
1317
|
+
}
|
|
1318
|
+
function syncProjectionRuntimeNodeMetadata(runtimeNode, node) {
|
|
1319
|
+
const metadata = readProjectionObject(runtimeNode.metadata);
|
|
1320
|
+
const editorProjection = readProjectionObject(metadata?.editorProjection);
|
|
1321
|
+
if (!editorProjection)
|
|
1322
|
+
return;
|
|
1323
|
+
if (editorProjection.nodeId !== node.id && editorProjection.rootNodeId !== node.id)
|
|
1324
|
+
return;
|
|
1325
|
+
const nextEditorProjection = { ...editorProjection };
|
|
1326
|
+
if (node.shadowMode)
|
|
1327
|
+
nextEditorProjection.shadowMode = node.shadowMode;
|
|
1328
|
+
else
|
|
1329
|
+
delete nextEditorProjection.shadowMode;
|
|
1330
|
+
runtimeNode.metadata = {
|
|
1331
|
+
...(metadata ?? {}),
|
|
1332
|
+
editorProjection: nextEditorProjection,
|
|
1333
|
+
};
|
|
1334
|
+
}
|
|
1335
|
+
function readProjectionObject(value) {
|
|
1336
|
+
return value && typeof value === 'object' && !Array.isArray(value)
|
|
1337
|
+
? value
|
|
1338
|
+
: null;
|
|
1339
|
+
}
|
|
1277
1340
|
export function applyProjectionTransform(babylon, node, transform) {
|
|
1278
1341
|
const Vector3 = requireBabylonCtor(babylon.Vector3, 'Vector3');
|
|
1279
1342
|
node.position = new Vector3(transform.position.x, transform.position.y, transform.position.z);
|
|
@@ -1307,42 +1370,6 @@ function applyAssetDefaultsTransform(babylon, node, transform) {
|
|
|
1307
1370
|
node.scaling = new Vector3(transform.scale?.x ?? 1, transform.scale?.y ?? 1, transform.scale?.z ?? 1);
|
|
1308
1371
|
}
|
|
1309
1372
|
}
|
|
1310
|
-
function resolveProjectionNodeId(target) {
|
|
1311
|
-
let current = target;
|
|
1312
|
-
while (current) {
|
|
1313
|
-
const nodeId = current.metadata?.editorProjection?.nodeId;
|
|
1314
|
-
if (typeof nodeId === 'string' && nodeId.length > 0)
|
|
1315
|
-
return nodeId;
|
|
1316
|
-
current = current.parent ?? null;
|
|
1317
|
-
}
|
|
1318
|
-
return null;
|
|
1319
|
-
}
|
|
1320
|
-
function resolvePickSelectionNodeId(target) {
|
|
1321
|
-
let current = target;
|
|
1322
|
-
while (current) {
|
|
1323
|
-
const projection = current.metadata?.editorProjection;
|
|
1324
|
-
const rootNodeId = projection?.rootNodeId;
|
|
1325
|
-
if (projection?.runtimeKind === 'assetMesh' && typeof rootNodeId === 'string' && rootNodeId.length > 0) {
|
|
1326
|
-
return rootNodeId;
|
|
1327
|
-
}
|
|
1328
|
-
const nodeId = projection?.nodeId;
|
|
1329
|
-
if (typeof nodeId === 'string' && nodeId.length > 0)
|
|
1330
|
-
return nodeId;
|
|
1331
|
-
current = current.parent ?? null;
|
|
1332
|
-
}
|
|
1333
|
-
return null;
|
|
1334
|
-
}
|
|
1335
|
-
function pickProjectionNodeIdAt(scene, clientX, clientY) {
|
|
1336
|
-
const canvas = scene.getEngine?.().getRenderingCanvas?.();
|
|
1337
|
-
if (!canvas || typeof scene.pick !== 'function')
|
|
1338
|
-
return null;
|
|
1339
|
-
const rect = canvas.getBoundingClientRect();
|
|
1340
|
-
const x = clientX - rect.left;
|
|
1341
|
-
const y = clientY - rect.top;
|
|
1342
|
-
const pick = scene.pick(x, y);
|
|
1343
|
-
const pickedNode = pick?.pickedMesh ?? pick?.pickedPoint?.mesh ?? null;
|
|
1344
|
-
return resolvePickSelectionNodeId(pickedNode);
|
|
1345
|
-
}
|
|
1346
1373
|
function getProjectionNodeIdsInScreenRect(babylon, scene, projections, rect) {
|
|
1347
1374
|
const canvas = scene.getEngine?.().getRenderingCanvas?.();
|
|
1348
1375
|
const camera = scene.activeCamera ?? scene.cameraToUseForPointers ?? null;
|
|
@@ -1400,7 +1427,9 @@ function rectsIntersect(left, right) {
|
|
|
1400
1427
|
}
|
|
1401
1428
|
function syncProjectionSelection(babylon, projections, selection) {
|
|
1402
1429
|
const Color4 = babylon.Color4;
|
|
1403
|
-
const selectedIds = new Set(selection.selectedIds
|
|
1430
|
+
const selectedIds = new Set(selection.selectedIds.length > LARGE_SELECTION_EDGE_LIMIT
|
|
1431
|
+
? [selection.activeId].filter((id) => !!id)
|
|
1432
|
+
: selection.selectedIds);
|
|
1404
1433
|
for (const [nodeId, projection] of projections) {
|
|
1405
1434
|
const rootSelected = selectedIds.has(nodeId);
|
|
1406
1435
|
const rootActive = selection.activeId === nodeId;
|