@relu-interactives/spatial-ecs 0.2.25 → 0.3.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/{System-CYWZ_Zx5.d.cts → System-vrU46Vuw.d.cts} +16 -2
- package/dist/{System-CYWZ_Zx5.d.ts → System-vrU46Vuw.d.ts} +16 -2
- package/dist/{Video-AIQYTAAr.d.cts → XRRig-CAmf04NX.d.ts} +131 -4
- package/dist/{Video-DlZ4G9ig.d.ts → XRRig-Cu-EyliG.d.cts} +131 -4
- package/dist/{chunk-XFD74BQL.js → chunk-67WGASUJ.js} +3 -3
- package/dist/{chunk-XFD74BQL.js.map → chunk-67WGASUJ.js.map} +1 -1
- package/dist/{chunk-RJ4J5UEX.js → chunk-PCOZLCXS.js} +160 -83
- package/dist/chunk-PCOZLCXS.js.map +1 -0
- package/dist/{chunk-J6736FFO.js → chunk-U3MDYKPV.js} +90 -14
- package/dist/chunk-U3MDYKPV.js.map +1 -0
- package/dist/{chunk-3P3ZBP7K.js → chunk-VXUVNC7S.js} +634 -6
- package/dist/chunk-VXUVNC7S.js.map +1 -0
- package/dist/components/index.cjs +87 -11
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.d.cts +3 -3
- package/dist/components/index.d.ts +3 -3
- package/dist/components/index.js +1 -1
- package/dist/docs/api/Behaviour/classes/Behaviour.md +98 -51
- package/dist/docs/api/Component/classes/Component.md +4 -1
- package/dist/docs/api/components/classes/AnimationComponent.md +26 -26
- package/dist/docs/api/components/classes/AudioComponent.md +19 -19
- package/dist/docs/api/components/classes/CameraComponent.md +14 -14
- package/dist/docs/api/components/classes/EntityType.md +4 -4
- package/dist/docs/api/components/classes/Environment.md +3 -3
- package/dist/docs/api/components/classes/ImageComponent.md +7 -7
- package/dist/docs/api/components/classes/ImageTarget.md +7 -7
- package/dist/docs/api/components/classes/ImageTargetAnchor.md +4 -4
- package/dist/docs/api/components/classes/InstanceSlotComponent.md +4 -4
- package/dist/docs/api/components/classes/InstancedMeshComponent.md +10 -10
- package/dist/docs/api/components/classes/LightComponent.md +6 -6
- package/dist/docs/api/components/classes/MaterialComponent.md +57 -11
- package/dist/docs/api/components/classes/MeshComponent.md +3 -3
- package/dist/docs/api/components/classes/MeshGeometryComponent.md +9 -9
- package/dist/docs/api/components/classes/ModelComponent.md +4 -4
- package/dist/docs/api/components/classes/Name.md +3 -3
- package/dist/docs/api/components/classes/Object3DRef.md +4 -4
- package/dist/docs/api/components/classes/ParentId.md +3 -3
- package/dist/docs/api/components/classes/PhysicsComponent.md +12 -13
- package/dist/docs/api/components/classes/Postprocessing.md +3 -3
- package/dist/docs/api/components/classes/PrefabInstance.md +80 -0
- package/dist/docs/api/components/classes/PrefabNode.md +54 -0
- package/dist/docs/api/components/classes/ScriptComponent.md +5 -5
- package/dist/docs/api/components/classes/ScriptObjectComponent.md +55 -0
- package/dist/docs/api/components/classes/Selectable.md +3 -3
- package/dist/docs/api/components/classes/SelectionTransformState.md +5 -5
- package/dist/docs/api/components/classes/SpriteComponent.md +7 -7
- package/dist/docs/api/components/classes/TransformComponent.md +12 -12
- package/dist/docs/api/components/classes/VideoComponent.md +28 -28
- package/dist/docs/api/components/functions/defaultMaterialValue.md +17 -0
- package/dist/docs/api/components/functions/normalizePhysicsState.md +1 -1
- package/dist/docs/api/components/functions/setPhysicsLiveRef.md +34 -0
- package/dist/docs/api/components/index.md +8 -1
- package/dist/docs/api/components/type-aliases/AnimationComponentOptions.md +9 -9
- package/dist/docs/api/components/type-aliases/CameraComponentOptions.md +13 -13
- package/dist/docs/api/components/type-aliases/CameraProjection.md +1 -1
- package/dist/docs/api/components/type-aliases/CameraRuntimeType.md +1 -1
- package/dist/docs/api/components/type-aliases/ColliderShape.md +1 -1
- package/dist/docs/api/components/type-aliases/ColliderState.md +20 -20
- package/dist/docs/api/components/type-aliases/CubeMeshParameters.md +4 -4
- package/dist/docs/api/components/type-aliases/EditableMeshObjectKind.md +1 -1
- package/dist/docs/api/components/type-aliases/EnvironmentFogState.md +8 -8
- package/dist/docs/api/components/type-aliases/EnvironmentFogType.md +1 -1
- package/dist/docs/api/components/type-aliases/EnvironmentGradientEffect.md +1 -1
- package/dist/docs/api/components/type-aliases/EnvironmentSkyboxState.md +7 -7
- package/dist/docs/api/components/type-aliases/EnvironmentSkyboxType.md +1 -1
- package/dist/docs/api/components/type-aliases/EnvironmentState.md +5 -5
- package/dist/docs/api/components/type-aliases/ImageTargetAnchorOptions.md +3 -3
- package/dist/docs/api/components/type-aliases/ImageTargetReference.md +7 -7
- package/dist/docs/api/components/type-aliases/InstanceTransform.md +13 -13
- package/dist/docs/api/components/type-aliases/InstancedMeshKind.md +1 -1
- package/dist/docs/api/components/type-aliases/LightValueState.md +11 -11
- package/dist/docs/api/components/type-aliases/MaterialTypeValue.md +1 -1
- package/dist/docs/api/components/type-aliases/MaterialValueState.md +28 -28
- package/dist/docs/api/components/type-aliases/MeshGeometryParameters.md +1 -1
- package/dist/docs/api/components/type-aliases/MeshGeometryParametersByKind.md +7 -7
- package/dist/docs/api/components/type-aliases/PhysicsState.md +3 -3
- package/dist/docs/api/components/type-aliases/PlaneMeshParameters.md +3 -3
- package/dist/docs/api/components/type-aliases/PostprocessingState.md +62 -62
- package/dist/docs/api/components/type-aliases/RadiusHeightMeshParameters.md +3 -3
- package/dist/docs/api/components/type-aliases/RadiusMeshParameters.md +2 -2
- package/dist/docs/api/components/type-aliases/RigidbodyState.md +17 -17
- package/dist/docs/api/components/type-aliases/RigidbodyType.md +1 -1
- package/dist/docs/api/components/type-aliases/ScriptEntry.md +8 -10
- package/dist/docs/api/components/type-aliases/ScriptObjectComponentInput.md +20 -0
- package/dist/docs/api/components/type-aliases/ScriptObjectRuntimeState.md +13 -0
- package/dist/docs/api/components/type-aliases/TextureFilteringValue.md +1 -1
- package/dist/docs/api/components/type-aliases/TransformData.md +4 -4
- package/dist/docs/api/components/type-aliases/TransformModeValue.md +1 -1
- package/dist/docs/api/components/type-aliases/TransformSpaceValue.md +1 -1
- package/dist/docs/api/components/type-aliases/Vec3.md +4 -4
- package/dist/docs/api/components/variables/DEFAULT_COLLIDER_STATE.md +1 -1
- package/dist/docs/api/components/variables/DEFAULT_ENVIRONMENT_STATE.md +1 -1
- package/dist/docs/api/components/variables/DEFAULT_INSTANCED_MESH_PARAMETERS.md +1 -1
- package/dist/docs/api/components/variables/DEFAULT_INSTANCE_TRANSFORM.md +1 -1
- package/dist/docs/api/components/variables/DEFAULT_MESH_GEOMETRY_PARAMETERS.md +1 -1
- package/dist/docs/api/components/variables/DEFAULT_PHYSICS_STATE.md +1 -1
- package/dist/docs/api/components/variables/DEFAULT_POSTPROCESSING_STATE.md +1 -1
- package/dist/docs/api/components/variables/DEFAULT_RIGIDBODY_STATE.md +1 -1
- package/dist/docs/api/index/classes/AnimationStateMachine.md +16 -16
- package/dist/docs/api/index/classes/AnimationStateManager.md +13 -13
- package/dist/docs/api/index/classes/AnimationSystem.md +3 -3
- package/dist/docs/api/index/classes/AudioSystem.md +4 -4
- package/dist/docs/api/index/classes/CameraSyncSystem.md +2 -2
- package/dist/docs/api/index/classes/EnvironmentSyncSystem.md +4 -4
- package/dist/docs/api/index/classes/InputSystem.md +33 -33
- package/dist/docs/api/index/classes/InstancedMeshSystem.md +2 -2
- package/dist/docs/api/index/classes/LightSyncSystem.md +2 -2
- package/dist/docs/api/index/classes/MaterialSyncSystem.md +3 -3
- package/dist/docs/api/index/classes/MeshGeometrySystem.md +2 -2
- package/dist/docs/api/index/classes/ObjectManagementSystem.md +14 -14
- package/dist/docs/api/index/classes/ObjectVisibilitySystem.md +2 -2
- package/dist/docs/api/index/classes/PhysicsSyncSystem.md +4 -4
- package/dist/docs/api/index/classes/PostprocessingSyncSystem.md +4 -4
- package/dist/docs/api/index/classes/RenderSystem.md +3 -3
- package/dist/docs/api/index/classes/ScriptBehaviourSystem.md +5 -5
- package/dist/docs/api/index/classes/ScriptObject.md +156 -0
- package/dist/docs/api/index/classes/ScriptObjectSystem.md +129 -0
- package/dist/docs/api/index/classes/TransformSyncSystem.md +2 -2
- package/dist/docs/api/index/classes/VideoSystem.md +4 -4
- package/dist/docs/api/index/classes/World.md +183 -86
- package/dist/docs/api/index/functions/applyPrefabToSnapshotInstances.md +32 -0
- package/dist/docs/api/index/functions/buildComponentValueMaps.md +23 -0
- package/dist/docs/api/index/functions/buildNodeKeyMapsFromSnapshot.md +25 -0
- package/dist/docs/api/index/functions/buildNodeMapsFromSnapshot.md +23 -0
- package/dist/docs/api/index/functions/canonicalizeComponentValue.md +38 -0
- package/dist/docs/api/index/functions/clearModelCache.md +26 -0
- package/dist/docs/api/index/functions/clearPrefabCache.md +25 -0
- package/dist/docs/api/index/functions/collectDiffPaths.md +38 -0
- package/dist/docs/api/index/functions/collectDirectPrefabDependencies.md +27 -0
- package/dist/docs/api/index/functions/collectEntitySubtree.md +29 -0
- package/dist/docs/api/index/functions/collectSnapshotSubtreeIds.md +26 -0
- package/dist/docs/api/index/functions/computeInstanceOverrides.md +44 -0
- package/dist/docs/api/index/functions/createAnimationComponent.md +1 -1
- package/dist/docs/api/index/functions/createAudioComponent.md +1 -1
- package/dist/docs/api/index/functions/createCameraComponent.md +1 -1
- package/dist/docs/api/index/functions/createEntityTypeComponent.md +2 -2
- package/dist/docs/api/index/functions/createEnvironmentComponent.md +1 -1
- package/dist/docs/api/index/functions/createImageComponent.md +1 -1
- package/dist/docs/api/index/functions/createImageTargetAnchorComponent.md +1 -1
- package/dist/docs/api/index/functions/createImageTargetComponent.md +1 -1
- package/dist/docs/api/index/functions/createInstanceSlotComponent.md +1 -1
- package/dist/docs/api/index/functions/createInstancedMeshComponent.md +1 -1
- package/dist/docs/api/index/functions/createLightComponent.md +1 -1
- package/dist/docs/api/index/functions/createMaterialComponent.md +1 -1
- package/dist/docs/api/index/functions/createMeshComponent.md +1 -1
- package/dist/docs/api/index/functions/createMeshGeometryComponent.md +1 -1
- package/dist/docs/api/index/functions/createModelComponent.md +1 -1
- package/dist/docs/api/index/functions/createNameComponent.md +1 -1
- package/dist/docs/api/index/functions/createObject3DRefComponent.md +1 -1
- package/dist/docs/api/index/functions/createParentIdComponent.md +1 -1
- package/dist/docs/api/index/functions/createPhysicsComponent.md +2 -4
- package/dist/docs/api/index/functions/createPostprocessingComponent.md +1 -1
- package/dist/docs/api/index/functions/createScriptComponent.md +1 -1
- package/dist/docs/api/index/functions/createScriptObjectComponent.md +28 -0
- package/dist/docs/api/index/functions/createSelectableComponent.md +1 -1
- package/dist/docs/api/index/functions/createSelectionTransformStateComponent.md +1 -1
- package/dist/docs/api/index/functions/createSpriteComponent.md +1 -1
- package/dist/docs/api/index/functions/createTransformComponent.md +1 -1
- package/dist/docs/api/index/functions/createVideoComponent.md +1 -1
- package/dist/docs/api/index/functions/decanonicalizeComponentValue.md +28 -0
- package/dist/docs/api/index/functions/despawnPrefab.md +32 -0
- package/dist/docs/api/index/functions/encodeOverride.md +28 -0
- package/dist/docs/api/index/functions/findSnapshotRootEntityIds.md +25 -0
- package/dist/docs/api/index/functions/findTopLevelNestedRegions.md +28 -0
- package/dist/docs/api/index/functions/groupOverridePaths.md +25 -0
- package/dist/docs/api/index/functions/hydrateWorldFromSnapshot.md +1 -1
- package/dist/docs/api/index/functions/hydrateWorldFromSnapshotDetailed.md +4 -2
- package/dist/docs/api/index/functions/indexSnapshotByEntity.md +25 -0
- package/dist/docs/api/index/functions/instantiateSubtree.md +32 -0
- package/dist/docs/api/index/functions/loadPrefab.md +28 -0
- package/dist/docs/api/index/functions/loadSharedGltf.md +29 -0
- package/dist/docs/api/index/functions/mergeComponentValue.md +32 -0
- package/dist/docs/api/index/functions/parseOverride.md +34 -0
- package/dist/docs/api/index/functions/parsePrefabAsset.md +25 -0
- package/dist/docs/api/index/functions/prefabFileVersionFor.md +25 -0
- package/dist/docs/api/index/functions/registerDefaultComponentFactories.md +1 -1
- package/dist/docs/api/index/functions/registerDefaultFactories.md +1 -1
- package/dist/docs/api/index/functions/remapSnapshotEntityIds.md +46 -0
- package/dist/docs/api/index/functions/resolveDracoDecoderPath.md +17 -0
- package/dist/docs/api/index/functions/restoreComponentState.md +34 -0
- package/dist/docs/api/index/functions/restorePostCreateComponents.md +36 -0
- package/dist/docs/api/index/functions/serializeEntitySubtree.md +35 -0
- package/dist/docs/api/index/functions/setDracoDecoderPath.md +30 -0
- package/dist/docs/api/index/functions/setPrefabAssetUrlResolver.md +30 -0
- package/dist/docs/api/index/functions/spawnPrefab.md +36 -0
- package/dist/docs/api/index/index.md +65 -0
- package/dist/docs/api/index/interfaces/EcsSystem.md +3 -3
- package/dist/docs/api/index/interfaces/StateMachine.md +13 -13
- package/dist/docs/api/index/type-aliases/AnimationStateCallbacks.md +4 -4
- package/dist/docs/api/index/type-aliases/ApplyPrefabToSnapshotResult.md +23 -0
- package/dist/docs/api/index/type-aliases/ComponentFactory.md +1 -1
- package/dist/docs/api/index/type-aliases/ComponentValueMaps.md +69 -0
- package/dist/docs/api/index/type-aliases/EcsComponentFactoryKind.md +2 -1
- package/dist/docs/api/index/type-aliases/EcsWorldComponentSnapshot.md +3 -3
- package/dist/docs/api/index/type-aliases/EcsWorldStateSnapshotLike.md +4 -4
- package/dist/docs/api/index/type-aliases/ExternalRefWarning.md +27 -0
- package/dist/docs/api/index/type-aliases/HydrateOptions.md +27 -0
- package/dist/docs/api/index/type-aliases/HydrateWorldFromSnapshotResult.md +7 -5
- package/dist/docs/api/index/type-aliases/InstantiateSubtreeResult.md +23 -0
- package/dist/docs/api/index/type-aliases/KeyboardKey.md +1 -1
- package/dist/docs/api/index/type-aliases/ModuleLoader.md +25 -0
- package/dist/docs/api/index/type-aliases/MouseButton.md +1 -1
- package/dist/docs/api/index/type-aliases/NestedRegion.md +27 -0
- package/dist/docs/api/index/type-aliases/NodeKeyMaps.md +30 -0
- package/dist/docs/api/index/type-aliases/NodeMaps.md +25 -0
- package/dist/docs/api/index/type-aliases/PrefabAsset.md +32 -0
- package/dist/docs/api/index/type-aliases/RemapSnapshotOptions.md +21 -0
- package/dist/docs/api/index/type-aliases/SelectionContext.md +4 -4
- package/dist/docs/api/index/type-aliases/SerializeEntitySubtreeResult.md +25 -0
- package/dist/docs/api/index/type-aliases/SpawnPrefabOptions.md +27 -0
- package/dist/docs/api/index/type-aliases/SpawnPrefabSource.md +19 -0
- package/dist/docs/api/index/type-aliases/SubtreeSnapshot.md +43 -0
- package/dist/docs/api/index/variables/ADDED_NODE_MARKER_COMPONENT.md +19 -0
- package/dist/docs/api/index/variables/HYDRATABLE_ENTITY_KINDS.md +1 -1
- package/dist/docs/api/index/variables/KeyboardKeys.md +89 -89
- package/dist/docs/api/index/variables/NODE_KEY_SEPARATOR.md +13 -0
- package/dist/docs/api/index/variables/OVERRIDE_DIFF_EXCLUDED_COMPONENTS.md +15 -0
- package/dist/docs/api/index/variables/OVERRIDE_ROOT_EXCLUDED_COMPONENTS.md +16 -0
- package/dist/docs/api/index/variables/PREFAB_FILE_VERSION.md +13 -0
- package/dist/docs/api/index/variables/PREFAB_FILE_VERSION_NESTED.md +15 -0
- package/dist/docs/api/index/variables/SCRIPT_OBJECT_ROOT_FLAG.md +15 -0
- package/dist/docs/api/index/variables/SHARED_MODEL_RESOURCE_FLAG.md +17 -0
- package/dist/docs/api/typedoc-sidebar.json +1 -1
- package/dist/docs/api/types/type-aliases/AssetInput.md +3 -3
- package/dist/docs/api/types/type-aliases/CheckboxInput.md +3 -3
- package/dist/docs/api/types/type-aliases/ColorInput.md +1 -1
- package/dist/docs/api/types/type-aliases/ComponentInput.md +4 -4
- package/dist/docs/api/types/type-aliases/ComponentKind.md +2 -1
- package/dist/docs/api/types/type-aliases/DropdownInput.md +3 -3
- package/dist/docs/api/types/type-aliases/DropdownOption.md +3 -3
- package/dist/docs/api/types/type-aliases/EcsEntityEditorKind.md +1 -1
- package/dist/docs/api/types/type-aliases/EcsEntityKind.md +3 -2
- package/dist/docs/api/types/type-aliases/EntityId.md +1 -1
- package/dist/docs/api/types/type-aliases/EntityInput.md +3 -3
- package/dist/docs/api/types/type-aliases/FloatInput.md +1 -1
- package/dist/docs/api/types/type-aliases/IntersectionResult.md +3 -3
- package/dist/docs/api/types/type-aliases/ParentLookup.md +3 -3
- package/dist/docs/api/types/type-aliases/SelectionListener.md +1 -1
- package/dist/docs/api/types/type-aliases/SliderInput.md +5 -5
- package/dist/docs/api/types/type-aliases/TextInput.md +1 -1
- package/dist/docs/api/types/type-aliases/ToggleInput.md +1 -1
- package/dist/docs/api/types/type-aliases/Vec3.md +1 -1
- package/dist/docs/api/types/type-aliases/Vector2Input.md +3 -3
- package/dist/docs/api/types/type-aliases/Vector3Input.md +4 -4
- package/dist/docs/api/types/type-aliases/WorldEntityView.md +1 -1
- package/dist/docs/guide/components/_sidebar.json +4 -0
- package/dist/docs/guide/components/material.md +1 -0
- package/dist/docs/guide/components/script-object.md +32 -0
- package/dist/factories/index.cjs +271 -118
- package/dist/factories/index.cjs.map +1 -1
- package/dist/factories/index.d.cts +9 -3
- package/dist/factories/index.d.ts +9 -3
- package/dist/factories/index.js +3 -3
- package/dist/{index-Gr8aCPRM.d.cts → index-CUFd71ri.d.cts} +12 -3
- package/dist/index-D84o_UA6.d.ts +488 -0
- package/dist/index-YYypJaVw.d.cts +488 -0
- package/dist/{index-BwiRJNIT.d.ts → index-w1oqWl_M.d.ts} +12 -3
- package/dist/index.cjs +1014 -208
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +42 -8
- package/dist/index.d.ts +42 -8
- package/dist/index.js +24 -8
- package/dist/index.js.map +1 -1
- package/dist/systems/index.cjs +717 -12
- package/dist/systems/index.cjs.map +1 -1
- package/dist/systems/index.d.cts +3 -278
- package/dist/systems/index.d.ts +3 -278
- package/dist/systems/index.js +3 -3
- package/dist/types.d.cts +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/worldSnapshotUtils.d.cts +1 -1
- package/dist/worldSnapshotUtils.d.ts +1 -1
- package/package.json +4 -4
- package/dist/chunk-3P3ZBP7K.js.map +0 -1
- package/dist/chunk-J6736FFO.js.map +0 -1
- package/dist/chunk-RJ4J5UEX.js.map +0 -1
package/dist/factories/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var THREE31 = require('three');
|
|
4
4
|
var SkeletonUtils_js = require('three/examples/jsm/utils/SkeletonUtils.js');
|
|
5
5
|
var RectAreaLightHelper_js = require('three/examples/jsm/helpers/RectAreaLightHelper.js');
|
|
6
6
|
var DRACOLoader_js = require('three/examples/jsm/loaders/DRACOLoader.js');
|
|
@@ -25,7 +25,7 @@ function _interopNamespace(e) {
|
|
|
25
25
|
return Object.freeze(n);
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
var
|
|
28
|
+
var THREE31__namespace = /*#__PURE__*/_interopNamespace(THREE31);
|
|
29
29
|
|
|
30
30
|
var __defProp = Object.defineProperty;
|
|
31
31
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
@@ -298,14 +298,14 @@ var _AnimationComponent = class _AnimationComponent extends Component {
|
|
|
298
298
|
return;
|
|
299
299
|
}
|
|
300
300
|
this.importedClips = clips.map((entry) => {
|
|
301
|
-
if (entry instanceof
|
|
301
|
+
if (entry instanceof THREE31__namespace.AnimationClip) {
|
|
302
302
|
return { clip: entry, sourceUrl: null };
|
|
303
303
|
}
|
|
304
304
|
if (!entry || typeof entry !== "object") {
|
|
305
305
|
return null;
|
|
306
306
|
}
|
|
307
307
|
const candidate = entry;
|
|
308
|
-
if (!(candidate.clip instanceof
|
|
308
|
+
if (!(candidate.clip instanceof THREE31__namespace.AnimationClip)) {
|
|
309
309
|
return null;
|
|
310
310
|
}
|
|
311
311
|
return {
|
|
@@ -513,11 +513,11 @@ function normalizeDistanceModel(distanceModel) {
|
|
|
513
513
|
}
|
|
514
514
|
__name(normalizeDistanceModel, "normalizeDistanceModel");
|
|
515
515
|
function createConfiguredAudio(listener, options) {
|
|
516
|
-
const sound = options.positional ? new
|
|
516
|
+
const sound = options.positional ? new THREE31__namespace.PositionalAudio(listener) : new THREE31__namespace.Audio(listener);
|
|
517
517
|
sound.setLoop(options.loop);
|
|
518
518
|
sound.setVolume(options.volume);
|
|
519
519
|
sound.setPlaybackRate(options.pitch);
|
|
520
|
-
if (sound instanceof
|
|
520
|
+
if (sound instanceof THREE31__namespace.PositionalAudio) {
|
|
521
521
|
sound.setRefDistance(options.refDistance);
|
|
522
522
|
sound.setDistanceModel(normalizeDistanceModel(options.distanceModel));
|
|
523
523
|
sound.setRolloffFactor(options.rolloffFactor);
|
|
@@ -527,16 +527,16 @@ function createConfiguredAudio(listener, options) {
|
|
|
527
527
|
__name(createConfiguredAudio, "createConfiguredAudio");
|
|
528
528
|
function createAudioEditorHelper() {
|
|
529
529
|
if (typeof document === "undefined") {
|
|
530
|
-
const geometry = new
|
|
531
|
-
new
|
|
530
|
+
const geometry = new THREE31__namespace.EdgesGeometry(
|
|
531
|
+
new THREE31__namespace.OctahedronGeometry(0.22, 0)
|
|
532
532
|
);
|
|
533
|
-
const material2 = new
|
|
533
|
+
const material2 = new THREE31__namespace.LineBasicMaterial({
|
|
534
534
|
color: "#8bc8ff",
|
|
535
535
|
transparent: true,
|
|
536
536
|
opacity: 0.95,
|
|
537
537
|
depthTest: false
|
|
538
538
|
});
|
|
539
|
-
const fallback = new
|
|
539
|
+
const fallback = new THREE31__namespace.LineSegments(geometry, material2);
|
|
540
540
|
fallback.renderOrder = 10;
|
|
541
541
|
fallback.userData.ecsHelper = true;
|
|
542
542
|
fallback.visible = false;
|
|
@@ -548,7 +548,7 @@ function createAudioEditorHelper() {
|
|
|
548
548
|
canvas.height = size;
|
|
549
549
|
const ctx = canvas.getContext("2d");
|
|
550
550
|
if (!ctx) {
|
|
551
|
-
return new
|
|
551
|
+
return new THREE31__namespace.Object3D();
|
|
552
552
|
}
|
|
553
553
|
ctx.clearRect(0, 0, size, size);
|
|
554
554
|
ctx.fillStyle = "rgba(27, 35, 52, 0.9)";
|
|
@@ -579,14 +579,14 @@ function createAudioEditorHelper() {
|
|
|
579
579
|
ctx.beginPath();
|
|
580
580
|
ctx.arc(56, 48, 16, -0.8, 0.8);
|
|
581
581
|
ctx.stroke();
|
|
582
|
-
const texture = new
|
|
582
|
+
const texture = new THREE31__namespace.CanvasTexture(canvas);
|
|
583
583
|
texture.needsUpdate = true;
|
|
584
|
-
const material = new
|
|
584
|
+
const material = new THREE31__namespace.SpriteMaterial({
|
|
585
585
|
map: texture,
|
|
586
586
|
transparent: true,
|
|
587
587
|
depthTest: false
|
|
588
588
|
});
|
|
589
|
-
const helper = new
|
|
589
|
+
const helper = new THREE31__namespace.Sprite(material);
|
|
590
590
|
helper.scale.set(0.68, 0.68, 0.68);
|
|
591
591
|
helper.renderOrder = 10;
|
|
592
592
|
helper.userData.ecsHelper = true;
|
|
@@ -620,7 +620,7 @@ var DEFAULT_ORTHO_TOP = 5;
|
|
|
620
620
|
var DEFAULT_ORTHO_BOTTOM = -5;
|
|
621
621
|
var DEFAULT_ZOOM = 1;
|
|
622
622
|
function inferProjection(camera) {
|
|
623
|
-
if (camera instanceof
|
|
623
|
+
if (camera instanceof THREE31__namespace.OrthographicCamera) {
|
|
624
624
|
return "orthographic";
|
|
625
625
|
}
|
|
626
626
|
return "perspective";
|
|
@@ -641,7 +641,7 @@ function readCameraFar(camera) {
|
|
|
641
641
|
}
|
|
642
642
|
__name(readCameraFar, "readCameraFar");
|
|
643
643
|
function inferFov(camera) {
|
|
644
|
-
if (camera instanceof
|
|
644
|
+
if (camera instanceof THREE31__namespace.PerspectiveCamera && Number.isFinite(camera.fov)) {
|
|
645
645
|
return camera.fov;
|
|
646
646
|
}
|
|
647
647
|
return DEFAULT_FOV;
|
|
@@ -664,28 +664,28 @@ function inferFar(camera) {
|
|
|
664
664
|
}
|
|
665
665
|
__name(inferFar, "inferFar");
|
|
666
666
|
function inferOrthoLeft(camera) {
|
|
667
|
-
if (camera instanceof
|
|
667
|
+
if (camera instanceof THREE31__namespace.OrthographicCamera && Number.isFinite(camera.left)) {
|
|
668
668
|
return camera.left;
|
|
669
669
|
}
|
|
670
670
|
return DEFAULT_ORTHO_LEFT;
|
|
671
671
|
}
|
|
672
672
|
__name(inferOrthoLeft, "inferOrthoLeft");
|
|
673
673
|
function inferOrthoRight(camera) {
|
|
674
|
-
if (camera instanceof
|
|
674
|
+
if (camera instanceof THREE31__namespace.OrthographicCamera && Number.isFinite(camera.right)) {
|
|
675
675
|
return camera.right;
|
|
676
676
|
}
|
|
677
677
|
return DEFAULT_ORTHO_RIGHT;
|
|
678
678
|
}
|
|
679
679
|
__name(inferOrthoRight, "inferOrthoRight");
|
|
680
680
|
function inferOrthoTop(camera) {
|
|
681
|
-
if (camera instanceof
|
|
681
|
+
if (camera instanceof THREE31__namespace.OrthographicCamera && Number.isFinite(camera.top)) {
|
|
682
682
|
return camera.top;
|
|
683
683
|
}
|
|
684
684
|
return DEFAULT_ORTHO_TOP;
|
|
685
685
|
}
|
|
686
686
|
__name(inferOrthoTop, "inferOrthoTop");
|
|
687
687
|
function inferOrthoBottom(camera) {
|
|
688
|
-
if (camera instanceof
|
|
688
|
+
if (camera instanceof THREE31__namespace.OrthographicCamera && Number.isFinite(camera.bottom)) {
|
|
689
689
|
return camera.bottom;
|
|
690
690
|
}
|
|
691
691
|
return DEFAULT_ORTHO_BOTTOM;
|
|
@@ -701,7 +701,7 @@ __name(inferZoom, "inferZoom");
|
|
|
701
701
|
var _CameraComponent = class _CameraComponent extends Component {
|
|
702
702
|
constructor(payload = {}) {
|
|
703
703
|
super();
|
|
704
|
-
this.camera = payload.camera ?? new
|
|
704
|
+
this.camera = payload.camera ?? new THREE31__namespace.PerspectiveCamera();
|
|
705
705
|
this.type = payload.type ?? "3d";
|
|
706
706
|
this.isDefault = typeof payload.isDefault === "boolean" ? payload.isDefault : false;
|
|
707
707
|
this.projection = payload.projection ?? inferProjection(payload.camera);
|
|
@@ -732,7 +732,7 @@ var Object3DRef = _Object3DRef;
|
|
|
732
732
|
// core/factories/components/CameraFactory.ts
|
|
733
733
|
function createCameraComponent(world, entityId, payload = {}) {
|
|
734
734
|
const object = world.getComponent(entityId, Object3DRef)?.object;
|
|
735
|
-
const objectCamera = object instanceof
|
|
735
|
+
const objectCamera = object instanceof THREE31__namespace.Camera ? object : void 0;
|
|
736
736
|
const component = new CameraComponent({
|
|
737
737
|
...payload,
|
|
738
738
|
camera: payload.camera ?? objectCamera
|
|
@@ -1290,15 +1290,15 @@ function createValueState(light) {
|
|
|
1290
1290
|
castShadow: light.castShadow ?? false,
|
|
1291
1291
|
frustumCulling: light.frustumCulled
|
|
1292
1292
|
};
|
|
1293
|
-
if (light instanceof
|
|
1293
|
+
if (light instanceof THREE31__namespace.PointLight) {
|
|
1294
1294
|
base.distance = light.distance;
|
|
1295
1295
|
base.decay = light.decay;
|
|
1296
|
-
} else if (light instanceof
|
|
1296
|
+
} else if (light instanceof THREE31__namespace.SpotLight) {
|
|
1297
1297
|
base.distance = light.distance;
|
|
1298
1298
|
base.decay = light.decay;
|
|
1299
1299
|
base.angle = light.angle;
|
|
1300
1300
|
base.penumbra = light.penumbra;
|
|
1301
|
-
} else if (light instanceof
|
|
1301
|
+
} else if (light instanceof THREE31__namespace.RectAreaLight) {
|
|
1302
1302
|
base.width = light.width;
|
|
1303
1303
|
base.height = light.height;
|
|
1304
1304
|
}
|
|
@@ -1341,18 +1341,34 @@ function toHexColor2(value, fallback) {
|
|
|
1341
1341
|
}
|
|
1342
1342
|
__name(toHexColor2, "toHexColor");
|
|
1343
1343
|
function getMaterialType(material) {
|
|
1344
|
-
if (material instanceof
|
|
1344
|
+
if (material instanceof THREE31__namespace.MeshPhysicalMaterial) {
|
|
1345
1345
|
return "physical";
|
|
1346
1346
|
}
|
|
1347
|
-
if (material instanceof
|
|
1347
|
+
if (material instanceof THREE31__namespace.MeshPhongMaterial) {
|
|
1348
1348
|
return "phong";
|
|
1349
1349
|
}
|
|
1350
|
-
if (material instanceof
|
|
1350
|
+
if (material instanceof THREE31__namespace.MeshBasicMaterial) {
|
|
1351
1351
|
return "basic";
|
|
1352
1352
|
}
|
|
1353
1353
|
return "standard";
|
|
1354
1354
|
}
|
|
1355
1355
|
__name(getMaterialType, "getMaterialType");
|
|
1356
|
+
function textureImageSrc(texture) {
|
|
1357
|
+
const src = texture?.image?.src;
|
|
1358
|
+
return typeof src === "string" ? src : void 0;
|
|
1359
|
+
}
|
|
1360
|
+
__name(textureImageSrc, "textureImageSrc");
|
|
1361
|
+
function textureSourceUrl(texture) {
|
|
1362
|
+
if (!texture?.image) {
|
|
1363
|
+
return void 0;
|
|
1364
|
+
}
|
|
1365
|
+
const currentSrc = texture.source?.data?.currentSrc;
|
|
1366
|
+
if (typeof currentSrc === "string" && currentSrc) {
|
|
1367
|
+
return currentSrc;
|
|
1368
|
+
}
|
|
1369
|
+
return textureImageSrc(texture);
|
|
1370
|
+
}
|
|
1371
|
+
__name(textureSourceUrl, "textureSourceUrl");
|
|
1356
1372
|
function createMaterialValue(material) {
|
|
1357
1373
|
const materialRecord = material;
|
|
1358
1374
|
const normalScale = materialRecord.normalScale;
|
|
@@ -1366,24 +1382,40 @@ function createMaterialValue(material) {
|
|
|
1366
1382
|
opacity: typeof materialRecord.opacity === "number" ? materialRecord.opacity : 1,
|
|
1367
1383
|
emissive: toHexColor2(materialRecord.emissive, "#000000"),
|
|
1368
1384
|
emissiveIntensity: typeof materialRecord.emissiveIntensity === "number" ? materialRecord.emissiveIntensity : 0,
|
|
1369
|
-
side: typeof materialRecord.side === "number" ? materialRecord.side :
|
|
1370
|
-
blending: typeof materialRecord.blending === "number" ? materialRecord.blending :
|
|
1385
|
+
side: typeof materialRecord.side === "number" ? materialRecord.side : THREE31__namespace.FrontSide,
|
|
1386
|
+
blending: typeof materialRecord.blending === "number" ? materialRecord.blending : THREE31__namespace.NormalBlending,
|
|
1371
1387
|
depthTest: materialRecord.depthTest !== false,
|
|
1372
1388
|
depthWrite: materialRecord.depthWrite !== false,
|
|
1373
1389
|
wireframe: Boolean(materialRecord.wireframe),
|
|
1374
1390
|
transparent: Boolean(materialRecord.transparent),
|
|
1375
|
-
textureMap: map
|
|
1376
|
-
alphaTextureMap:
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1391
|
+
textureMap: textureSourceUrl(map),
|
|
1392
|
+
alphaTextureMap: textureImageSrc(
|
|
1393
|
+
materialRecord.alphaMap
|
|
1394
|
+
),
|
|
1395
|
+
normalMap: textureImageSrc(
|
|
1396
|
+
materialRecord.normalMap
|
|
1397
|
+
),
|
|
1398
|
+
roughnessMap: textureImageSrc(
|
|
1399
|
+
materialRecord.roughnessMap
|
|
1400
|
+
),
|
|
1401
|
+
metalnessMap: textureImageSrc(
|
|
1402
|
+
materialRecord.metalnessMap
|
|
1403
|
+
),
|
|
1404
|
+
aoMap: textureImageSrc(materialRecord.aoMap),
|
|
1405
|
+
emissiveMap: textureImageSrc(
|
|
1406
|
+
materialRecord.emissiveMap
|
|
1407
|
+
),
|
|
1408
|
+
bumpMap: textureImageSrc(
|
|
1409
|
+
materialRecord.bumpMap
|
|
1410
|
+
),
|
|
1411
|
+
displacementMap: textureImageSrc(
|
|
1412
|
+
materialRecord.displacementMap
|
|
1413
|
+
),
|
|
1414
|
+
lightMap: textureImageSrc(
|
|
1415
|
+
materialRecord.lightMap
|
|
1416
|
+
),
|
|
1417
|
+
envMap: textureImageSrc(materialRecord.envMap),
|
|
1418
|
+
textureFiltering: map?.magFilter === THREE31__namespace.NearestFilter ? "sharp" : "smooth",
|
|
1387
1419
|
useMipmaps: map?.generateMipmaps !== false
|
|
1388
1420
|
};
|
|
1389
1421
|
}
|
|
@@ -1398,8 +1430,8 @@ function defaultMaterialValue() {
|
|
|
1398
1430
|
opacity: 1,
|
|
1399
1431
|
emissive: "#000000",
|
|
1400
1432
|
emissiveIntensity: 0,
|
|
1401
|
-
side:
|
|
1402
|
-
blending:
|
|
1433
|
+
side: THREE31__namespace.FrontSide,
|
|
1434
|
+
blending: THREE31__namespace.NormalBlending,
|
|
1403
1435
|
depthTest: true,
|
|
1404
1436
|
depthWrite: true,
|
|
1405
1437
|
wireframe: false,
|
|
@@ -1970,14 +2002,14 @@ var _TransformComponent = class _TransformComponent extends Component {
|
|
|
1970
2002
|
z: scale.z ?? 1
|
|
1971
2003
|
};
|
|
1972
2004
|
}
|
|
1973
|
-
toPositionVector3(target = new
|
|
2005
|
+
toPositionVector3(target = new THREE31.Vector3()) {
|
|
1974
2006
|
return target.set(this.position.x, this.position.y, this.position.z);
|
|
1975
2007
|
}
|
|
1976
|
-
toRotationEuler(target = new
|
|
2008
|
+
toRotationEuler(target = new THREE31.Euler(), order = "XYZ") {
|
|
1977
2009
|
return target.set(this.rotation.x, this.rotation.y, this.rotation.z, order);
|
|
1978
2010
|
}
|
|
1979
|
-
toRotationQuaternion(target = new
|
|
1980
|
-
const euler = new
|
|
2011
|
+
toRotationQuaternion(target = new THREE31.Quaternion(), order = "XYZ") {
|
|
2012
|
+
const euler = new THREE31.Euler(
|
|
1981
2013
|
this.rotation.x,
|
|
1982
2014
|
this.rotation.y,
|
|
1983
2015
|
this.rotation.z,
|
|
@@ -1985,7 +2017,7 @@ var _TransformComponent = class _TransformComponent extends Component {
|
|
|
1985
2017
|
);
|
|
1986
2018
|
return target.setFromEuler(euler);
|
|
1987
2019
|
}
|
|
1988
|
-
toScaleVector3(target = new
|
|
2020
|
+
toScaleVector3(target = new THREE31.Vector3()) {
|
|
1989
2021
|
return target.set(this.scale.x, this.scale.y, this.scale.z);
|
|
1990
2022
|
}
|
|
1991
2023
|
setPosition(input) {
|
|
@@ -2003,8 +2035,8 @@ var _TransformComponent = class _TransformComponent extends Component {
|
|
|
2003
2035
|
return this;
|
|
2004
2036
|
}
|
|
2005
2037
|
setRotation(input, order = "XYZ") {
|
|
2006
|
-
if (input instanceof
|
|
2007
|
-
const euler = new
|
|
2038
|
+
if (input instanceof THREE31.Quaternion) {
|
|
2039
|
+
const euler = new THREE31.Euler().setFromQuaternion(input, order);
|
|
2008
2040
|
this.rotation.x = euler.x;
|
|
2009
2041
|
this.rotation.y = euler.y;
|
|
2010
2042
|
this.rotation.z = euler.z;
|
|
@@ -2209,6 +2241,71 @@ function createVideoComponent(world, entityId, ...args) {
|
|
|
2209
2241
|
}
|
|
2210
2242
|
__name(createVideoComponent, "createVideoComponent");
|
|
2211
2243
|
|
|
2244
|
+
// core/components/XRRig.ts
|
|
2245
|
+
var _XRRigComponent = class _XRRigComponent extends Component {
|
|
2246
|
+
constructor(options) {
|
|
2247
|
+
super();
|
|
2248
|
+
this.locomotion = options?.locomotion ?? "teleport";
|
|
2249
|
+
this.moveSpeed = options?.moveSpeed ?? 2;
|
|
2250
|
+
this.snapTurn = options?.snapTurn ?? true;
|
|
2251
|
+
this.snapTurnDegrees = options?.snapTurnDegrees ?? 30;
|
|
2252
|
+
this.fallbackEyeHeight = options?.fallbackEyeHeight ?? 1.6;
|
|
2253
|
+
}
|
|
2254
|
+
};
|
|
2255
|
+
__name(_XRRigComponent, "XRRigComponent");
|
|
2256
|
+
var XRRigComponent = _XRRigComponent;
|
|
2257
|
+
|
|
2258
|
+
// core/factories/components/XRRigFactory.ts
|
|
2259
|
+
function createXRRigComponent(world, entityId, ...args) {
|
|
2260
|
+
const component = new XRRigComponent(...args);
|
|
2261
|
+
world.addComponent(entityId, component);
|
|
2262
|
+
return component;
|
|
2263
|
+
}
|
|
2264
|
+
__name(createXRRigComponent, "createXRRigComponent");
|
|
2265
|
+
|
|
2266
|
+
// core/components/VRTeleportArea.ts
|
|
2267
|
+
var _VRTeleportAreaComponent = class _VRTeleportAreaComponent extends Component {
|
|
2268
|
+
constructor(options) {
|
|
2269
|
+
super();
|
|
2270
|
+
this.enabled = options?.enabled ?? true;
|
|
2271
|
+
this.shape = options?.shape ?? "plane";
|
|
2272
|
+
this.width = options?.width ?? 10;
|
|
2273
|
+
this.depth = options?.depth ?? 10;
|
|
2274
|
+
}
|
|
2275
|
+
};
|
|
2276
|
+
__name(_VRTeleportAreaComponent, "VRTeleportAreaComponent");
|
|
2277
|
+
var VRTeleportAreaComponent = _VRTeleportAreaComponent;
|
|
2278
|
+
|
|
2279
|
+
// core/factories/components/VRTeleportAreaFactory.ts
|
|
2280
|
+
function createVRTeleportAreaComponent(world, entityId, ...args) {
|
|
2281
|
+
const component = new VRTeleportAreaComponent(...args);
|
|
2282
|
+
world.addComponent(entityId, component);
|
|
2283
|
+
return component;
|
|
2284
|
+
}
|
|
2285
|
+
__name(createVRTeleportAreaComponent, "createVRTeleportAreaComponent");
|
|
2286
|
+
|
|
2287
|
+
// core/components/XRInteractable.ts
|
|
2288
|
+
var _XRInteractableComponent = class _XRInteractableComponent extends Component {
|
|
2289
|
+
constructor(options) {
|
|
2290
|
+
super();
|
|
2291
|
+
this.enabled = options?.enabled ?? true;
|
|
2292
|
+
this.grabbable = options?.grabbable ?? true;
|
|
2293
|
+
this.pointable = options?.pointable ?? true;
|
|
2294
|
+
this.grabMode = options?.grabMode ?? "kinematic";
|
|
2295
|
+
this.highlightOnHover = options?.highlightOnHover ?? true;
|
|
2296
|
+
}
|
|
2297
|
+
};
|
|
2298
|
+
__name(_XRInteractableComponent, "XRInteractableComponent");
|
|
2299
|
+
var XRInteractableComponent = _XRInteractableComponent;
|
|
2300
|
+
|
|
2301
|
+
// core/factories/components/XRInteractableFactory.ts
|
|
2302
|
+
function createXRInteractableComponent(world, entityId, ...args) {
|
|
2303
|
+
const component = new XRInteractableComponent(...args);
|
|
2304
|
+
world.addComponent(entityId, component);
|
|
2305
|
+
return component;
|
|
2306
|
+
}
|
|
2307
|
+
__name(createXRInteractableComponent, "createXRInteractableComponent");
|
|
2308
|
+
|
|
2212
2309
|
// core/factories/registerDefaultComponentFactories.ts
|
|
2213
2310
|
function registerDefaultComponentFactories(objectManagementSystem) {
|
|
2214
2311
|
objectManagementSystem.registerComponentFactory("animation", createAnimationComponent);
|
|
@@ -2218,6 +2315,9 @@ function registerDefaultComponentFactories(objectManagementSystem) {
|
|
|
2218
2315
|
objectManagementSystem.registerComponentFactory("environment", createEnvironmentComponent);
|
|
2219
2316
|
objectManagementSystem.registerComponentFactory("entityType", createEntityTypeComponent);
|
|
2220
2317
|
objectManagementSystem.registerComponentFactory("image", createImageComponent);
|
|
2318
|
+
objectManagementSystem.registerComponentFactory("xrRig", createXRRigComponent);
|
|
2319
|
+
objectManagementSystem.registerComponentFactory("vrTeleportArea", createVRTeleportAreaComponent);
|
|
2320
|
+
objectManagementSystem.registerComponentFactory("xrInteractable", createXRInteractableComponent);
|
|
2221
2321
|
objectManagementSystem.registerComponentFactory(
|
|
2222
2322
|
"imageTargetAnchor",
|
|
2223
2323
|
createImageTargetAnchorComponent
|
|
@@ -2261,7 +2361,7 @@ var SHARED_MODEL_RESOURCE_FLAG = "spatialEcsSharedModelResource";
|
|
|
2261
2361
|
var modelCache = /* @__PURE__ */ new Map();
|
|
2262
2362
|
function markSharedResources(root) {
|
|
2263
2363
|
root.traverse((child) => {
|
|
2264
|
-
if (!(child instanceof
|
|
2364
|
+
if (!(child instanceof THREE31__namespace.Mesh)) {
|
|
2265
2365
|
return;
|
|
2266
2366
|
}
|
|
2267
2367
|
if (child.geometry) {
|
|
@@ -2335,10 +2435,10 @@ __name(createBaseEntity, "createBaseEntity");
|
|
|
2335
2435
|
// core/factories/objects/AudioFactory.ts
|
|
2336
2436
|
function getOrCreateListener(camera) {
|
|
2337
2437
|
const existing = camera.userData.ecsAudioListener;
|
|
2338
|
-
if (existing instanceof
|
|
2438
|
+
if (existing instanceof THREE31__namespace.AudioListener) {
|
|
2339
2439
|
return existing;
|
|
2340
2440
|
}
|
|
2341
|
-
const listener = new
|
|
2441
|
+
const listener = new THREE31__namespace.AudioListener();
|
|
2342
2442
|
camera.add(listener);
|
|
2343
2443
|
camera.userData.ecsAudioListener = listener;
|
|
2344
2444
|
return listener;
|
|
@@ -2351,7 +2451,7 @@ function createAudio({
|
|
|
2351
2451
|
payload,
|
|
2352
2452
|
isEditor
|
|
2353
2453
|
}) {
|
|
2354
|
-
const anchor = new
|
|
2454
|
+
const anchor = new THREE31__namespace.Object3D();
|
|
2355
2455
|
const entityId = createBaseEntity(world, anchor, {
|
|
2356
2456
|
label: payload.name ?? "Audio",
|
|
2357
2457
|
entityType: "audio",
|
|
@@ -2373,7 +2473,7 @@ function createAudio({
|
|
|
2373
2473
|
return entityId;
|
|
2374
2474
|
}
|
|
2375
2475
|
if (!isEditor) {
|
|
2376
|
-
const loader = new
|
|
2476
|
+
const loader = new THREE31__namespace.AudioLoader();
|
|
2377
2477
|
loader.load(
|
|
2378
2478
|
audio.path,
|
|
2379
2479
|
(buffer) => {
|
|
@@ -2448,7 +2548,7 @@ function applyCameraSettings(camera, options) {
|
|
|
2448
2548
|
const near = typeof options.near === "number" ? options.near : DEFAULT_NEAR2;
|
|
2449
2549
|
const far = typeof options.far === "number" ? options.far : DEFAULT_FAR2;
|
|
2450
2550
|
const projection = options.projection;
|
|
2451
|
-
if (camera instanceof
|
|
2551
|
+
if (camera instanceof THREE31__namespace.PerspectiveCamera) {
|
|
2452
2552
|
if (!projection || projection === "perspective") {
|
|
2453
2553
|
camera.fov = typeof options.fov === "number" ? options.fov : DEFAULT_FOV2;
|
|
2454
2554
|
}
|
|
@@ -2458,7 +2558,7 @@ function applyCameraSettings(camera, options) {
|
|
|
2458
2558
|
camera.updateProjectionMatrix();
|
|
2459
2559
|
return;
|
|
2460
2560
|
}
|
|
2461
|
-
if (camera instanceof
|
|
2561
|
+
if (camera instanceof THREE31__namespace.OrthographicCamera) {
|
|
2462
2562
|
camera.left = typeof options.left === "number" ? options.left : -DEFAULT_ORTHOGRAPHIC_HALF_HEIGHT;
|
|
2463
2563
|
camera.right = typeof options.right === "number" ? options.right : DEFAULT_ORTHOGRAPHIC_HALF_HEIGHT;
|
|
2464
2564
|
camera.top = typeof options.top === "number" ? options.top : DEFAULT_ORTHOGRAPHIC_HALF_HEIGHT;
|
|
@@ -2479,7 +2579,7 @@ function createCameraObject(options) {
|
|
|
2479
2579
|
const bottom = options.bottom ?? -DEFAULT_ORTHOGRAPHIC_HALF_HEIGHT;
|
|
2480
2580
|
const left = options.left ?? -DEFAULT_ORTHOGRAPHIC_HALF_HEIGHT;
|
|
2481
2581
|
const right = options.right ?? DEFAULT_ORTHOGRAPHIC_HALF_HEIGHT;
|
|
2482
|
-
const camera = new
|
|
2582
|
+
const camera = new THREE31__namespace.OrthographicCamera(
|
|
2483
2583
|
left,
|
|
2484
2584
|
right,
|
|
2485
2585
|
top,
|
|
@@ -2491,7 +2591,7 @@ function createCameraObject(options) {
|
|
|
2491
2591
|
camera.updateProjectionMatrix();
|
|
2492
2592
|
return camera;
|
|
2493
2593
|
}
|
|
2494
|
-
return new
|
|
2594
|
+
return new THREE31__namespace.PerspectiveCamera(
|
|
2495
2595
|
options.fov ?? DEFAULT_FOV2,
|
|
2496
2596
|
readViewportAspect(),
|
|
2497
2597
|
near,
|
|
@@ -2509,7 +2609,7 @@ function createCamera({ world, scene, camera, payload, isEditor }) {
|
|
|
2509
2609
|
transformInput: payload.transform
|
|
2510
2610
|
});
|
|
2511
2611
|
const objectRef = world.getComponent(entityId, Object3DRef);
|
|
2512
|
-
if (objectRef?.object instanceof
|
|
2612
|
+
if (objectRef?.object instanceof THREE31__namespace.Camera) {
|
|
2513
2613
|
objectRef.object.userData.entityId = entityId;
|
|
2514
2614
|
}
|
|
2515
2615
|
const componentOptions = {
|
|
@@ -2541,9 +2641,9 @@ function createCapsule({
|
|
|
2541
2641
|
scene,
|
|
2542
2642
|
payload
|
|
2543
2643
|
}) {
|
|
2544
|
-
const geometry = new
|
|
2545
|
-
const material = new
|
|
2546
|
-
const mesh = new
|
|
2644
|
+
const geometry = new THREE31__namespace.CapsuleGeometry(0.5, 1, 4, 8);
|
|
2645
|
+
const material = new THREE31__namespace.MeshStandardMaterial({ color: "#ffffff" });
|
|
2646
|
+
const mesh = new THREE31__namespace.Mesh(geometry, material);
|
|
2547
2647
|
const entityId = createBaseEntity(world, mesh, {
|
|
2548
2648
|
label: payload.name ?? "Capsule",
|
|
2549
2649
|
entityType: "capsule",
|
|
@@ -2563,9 +2663,9 @@ function createCapsule({
|
|
|
2563
2663
|
}
|
|
2564
2664
|
__name(createCapsule, "createCapsule");
|
|
2565
2665
|
function createCube({ world, scene, payload }) {
|
|
2566
|
-
const geometry = new
|
|
2567
|
-
const material = new
|
|
2568
|
-
const mesh = new
|
|
2666
|
+
const geometry = new THREE31__namespace.BoxGeometry(1, 1, 1);
|
|
2667
|
+
const material = new THREE31__namespace.MeshStandardMaterial({ color: "#ffffff" });
|
|
2668
|
+
const mesh = new THREE31__namespace.Mesh(geometry, material);
|
|
2569
2669
|
const entityId = createBaseEntity(world, mesh, {
|
|
2570
2670
|
label: payload.name ?? "Cube",
|
|
2571
2671
|
entityType: "cube",
|
|
@@ -2590,9 +2690,9 @@ function createCylinder({
|
|
|
2590
2690
|
scene,
|
|
2591
2691
|
payload
|
|
2592
2692
|
}) {
|
|
2593
|
-
const geometry = new
|
|
2594
|
-
const material = new
|
|
2595
|
-
const mesh = new
|
|
2693
|
+
const geometry = new THREE31__namespace.CylinderGeometry(0.5, 0.5, 1, 20);
|
|
2694
|
+
const material = new THREE31__namespace.MeshStandardMaterial({ color: "#ffffff" });
|
|
2695
|
+
const mesh = new THREE31__namespace.Mesh(geometry, material);
|
|
2596
2696
|
const entityId = createBaseEntity(world, mesh, {
|
|
2597
2697
|
label: payload.name ?? "Cylinder",
|
|
2598
2698
|
entityType: "cylinder",
|
|
@@ -2612,7 +2712,7 @@ function createCylinder({
|
|
|
2612
2712
|
}
|
|
2613
2713
|
__name(createCylinder, "createCylinder");
|
|
2614
2714
|
function createEmpty({ world, scene, payload, isEditor }) {
|
|
2615
|
-
const object = new
|
|
2715
|
+
const object = new THREE31__namespace.Group();
|
|
2616
2716
|
const entityId = createBaseEntity(world, object, {
|
|
2617
2717
|
label: payload.name ?? "Empty",
|
|
2618
2718
|
entityType: "empty",
|
|
@@ -2623,7 +2723,7 @@ function createEmpty({ world, scene, payload, isEditor }) {
|
|
|
2623
2723
|
}
|
|
2624
2724
|
__name(createEmpty, "createEmpty");
|
|
2625
2725
|
function createImage({ world, scene, payload }) {
|
|
2626
|
-
const anchor = new
|
|
2726
|
+
const anchor = new THREE31__namespace.Object3D();
|
|
2627
2727
|
const imagePath = payload.path ?? "";
|
|
2628
2728
|
const entityId = createBaseEntity(world, anchor, {
|
|
2629
2729
|
label: payload.name ?? "Image",
|
|
@@ -2636,7 +2736,7 @@ function createImage({ world, scene, payload }) {
|
|
|
2636
2736
|
if (!imagePath) {
|
|
2637
2737
|
return entityId;
|
|
2638
2738
|
}
|
|
2639
|
-
const loader = new
|
|
2739
|
+
const loader = new THREE31__namespace.TextureLoader();
|
|
2640
2740
|
loader.load(
|
|
2641
2741
|
imagePath,
|
|
2642
2742
|
(texture) => {
|
|
@@ -2644,13 +2744,13 @@ function createImage({ world, scene, payload }) {
|
|
|
2644
2744
|
texture.dispose();
|
|
2645
2745
|
return;
|
|
2646
2746
|
}
|
|
2647
|
-
const material = new
|
|
2747
|
+
const material = new THREE31__namespace.MeshBasicMaterial({
|
|
2648
2748
|
map: texture,
|
|
2649
2749
|
transparent: true,
|
|
2650
|
-
side:
|
|
2750
|
+
side: THREE31__namespace.DoubleSide
|
|
2651
2751
|
});
|
|
2652
|
-
const geometry = new
|
|
2653
|
-
const plane = new
|
|
2752
|
+
const geometry = new THREE31__namespace.PlaneGeometry(1, 1);
|
|
2753
|
+
const plane = new THREE31__namespace.Mesh(geometry, material);
|
|
2654
2754
|
plane.userData.entityId = entityId;
|
|
2655
2755
|
const textureImage = texture.image;
|
|
2656
2756
|
const width = textureImage?.width ?? 1;
|
|
@@ -2696,7 +2796,7 @@ function createImageTarget({
|
|
|
2696
2796
|
payload,
|
|
2697
2797
|
isEditor
|
|
2698
2798
|
}) {
|
|
2699
|
-
const anchor = new
|
|
2799
|
+
const anchor = new THREE31__namespace.Object3D();
|
|
2700
2800
|
const imagePath = payload.path ?? "";
|
|
2701
2801
|
const entityId = createBaseEntity(world, anchor, {
|
|
2702
2802
|
label: payload.name ?? "Image Target",
|
|
@@ -2713,7 +2813,7 @@ function createImageTarget({
|
|
|
2713
2813
|
if (!isEditor || !imagePath) {
|
|
2714
2814
|
return entityId;
|
|
2715
2815
|
}
|
|
2716
|
-
const loader = new
|
|
2816
|
+
const loader = new THREE31__namespace.TextureLoader();
|
|
2717
2817
|
loader.load(
|
|
2718
2818
|
imagePath,
|
|
2719
2819
|
(texture) => {
|
|
@@ -2721,13 +2821,13 @@ function createImageTarget({
|
|
|
2721
2821
|
texture.dispose();
|
|
2722
2822
|
return;
|
|
2723
2823
|
}
|
|
2724
|
-
const material = new
|
|
2824
|
+
const material = new THREE31__namespace.MeshBasicMaterial({
|
|
2725
2825
|
map: texture,
|
|
2726
2826
|
transparent: true,
|
|
2727
|
-
side:
|
|
2827
|
+
side: THREE31__namespace.DoubleSide
|
|
2728
2828
|
});
|
|
2729
|
-
const geometry = new
|
|
2730
|
-
const plane = new
|
|
2829
|
+
const geometry = new THREE31__namespace.PlaneGeometry(1, 1);
|
|
2830
|
+
const plane = new THREE31__namespace.Mesh(geometry, material);
|
|
2731
2831
|
plane.userData.entityId = entityId;
|
|
2732
2832
|
const textureImage = texture.image;
|
|
2733
2833
|
const width = textureImage?.width ?? 1;
|
|
@@ -2778,7 +2878,7 @@ function createInstancedMesh({
|
|
|
2778
2878
|
scene,
|
|
2779
2879
|
payload
|
|
2780
2880
|
}) {
|
|
2781
|
-
const anchor = new
|
|
2881
|
+
const anchor = new THREE31__namespace.Object3D();
|
|
2782
2882
|
const opts = payload.options ?? {};
|
|
2783
2883
|
const meshKind = isInstancedMeshKind(opts.meshKind) ? opts.meshKind : "cube";
|
|
2784
2884
|
const meshParameters = opts.meshParameters && typeof opts.meshParameters === "object" ? opts.meshParameters : void 0;
|
|
@@ -2849,7 +2949,7 @@ function createAmbientLight({
|
|
|
2849
2949
|
scene,
|
|
2850
2950
|
payload
|
|
2851
2951
|
}) {
|
|
2852
|
-
const light = new
|
|
2952
|
+
const light = new THREE31__namespace.AmbientLight("#ffffff", 0.6);
|
|
2853
2953
|
const entityId = createBaseEntity(world, light, {
|
|
2854
2954
|
label: payload.name ?? "Ambient Light",
|
|
2855
2955
|
entityType: "ambientLight",
|
|
@@ -2866,7 +2966,7 @@ function createAreaLight({
|
|
|
2866
2966
|
payload,
|
|
2867
2967
|
isEditor
|
|
2868
2968
|
}) {
|
|
2869
|
-
const light = new
|
|
2969
|
+
const light = new THREE31__namespace.RectAreaLight("#ffffff", 5, 4, 4);
|
|
2870
2970
|
light.lookAt(0, 0, 0);
|
|
2871
2971
|
const entityId = createBaseEntity(world, light, {
|
|
2872
2972
|
label: payload.name ?? "Area Light",
|
|
@@ -2895,7 +2995,7 @@ function createDirectionalLight({
|
|
|
2895
2995
|
payload,
|
|
2896
2996
|
isEditor
|
|
2897
2997
|
}) {
|
|
2898
|
-
const light = new
|
|
2998
|
+
const light = new THREE31__namespace.DirectionalLight("#ffffff", 1.5);
|
|
2899
2999
|
light.castShadow = true;
|
|
2900
3000
|
const entityId = createBaseEntity(world, light, {
|
|
2901
3001
|
label: payload.name ?? "Directional Light",
|
|
@@ -2906,7 +3006,7 @@ function createDirectionalLight({
|
|
|
2906
3006
|
});
|
|
2907
3007
|
createLightComponent(world, entityId, light);
|
|
2908
3008
|
if (isEditor) {
|
|
2909
|
-
const helper = new
|
|
3009
|
+
const helper = new THREE31__namespace.DirectionalLightHelper(light, 1.8, "#38bdf8");
|
|
2910
3010
|
helper.onBeforeRender = () => {
|
|
2911
3011
|
helper.update();
|
|
2912
3012
|
};
|
|
@@ -2924,7 +3024,7 @@ function createPointLight({
|
|
|
2924
3024
|
payload,
|
|
2925
3025
|
isEditor
|
|
2926
3026
|
}) {
|
|
2927
|
-
const light = new
|
|
3027
|
+
const light = new THREE31__namespace.PointLight("#ffffff", 1, 10);
|
|
2928
3028
|
const entityId = createBaseEntity(world, light, {
|
|
2929
3029
|
label: payload.name ?? "Point Light",
|
|
2930
3030
|
entityType: "pointLight",
|
|
@@ -2934,7 +3034,7 @@ function createPointLight({
|
|
|
2934
3034
|
});
|
|
2935
3035
|
createLightComponent(world, entityId, light);
|
|
2936
3036
|
if (isEditor) {
|
|
2937
|
-
const helper = new
|
|
3037
|
+
const helper = new THREE31__namespace.PointLightHelper(light, 0.35, "#fbbf24");
|
|
2938
3038
|
helper.onBeforeRender = () => {
|
|
2939
3039
|
helper.update();
|
|
2940
3040
|
};
|
|
@@ -2952,7 +3052,7 @@ function createSpotLight({
|
|
|
2952
3052
|
payload,
|
|
2953
3053
|
isEditor
|
|
2954
3054
|
}) {
|
|
2955
|
-
const light = new
|
|
3055
|
+
const light = new THREE31__namespace.SpotLight("#ffffff", 1, 20, Math.PI / 6, 0.1, 1);
|
|
2956
3056
|
const entityId = createBaseEntity(world, light, {
|
|
2957
3057
|
label: payload.name ?? "Spot Light",
|
|
2958
3058
|
entityType: "spotLight",
|
|
@@ -2962,7 +3062,7 @@ function createSpotLight({
|
|
|
2962
3062
|
});
|
|
2963
3063
|
createLightComponent(world, entityId, light);
|
|
2964
3064
|
if (isEditor) {
|
|
2965
|
-
const helper = new
|
|
3065
|
+
const helper = new THREE31__namespace.SpotLightHelper(light, "#f59e0b");
|
|
2966
3066
|
helper.onBeforeRender = () => {
|
|
2967
3067
|
helper.update();
|
|
2968
3068
|
};
|
|
@@ -3022,7 +3122,7 @@ function createModel({
|
|
|
3022
3122
|
payload,
|
|
3023
3123
|
isEditor
|
|
3024
3124
|
}) {
|
|
3025
|
-
const anchor = new
|
|
3125
|
+
const anchor = new THREE31__namespace.Object3D();
|
|
3026
3126
|
const modelPath = payload.path ?? "";
|
|
3027
3127
|
const entityId = createBaseEntity(world, anchor, {
|
|
3028
3128
|
label: payload.name ?? "Model",
|
|
@@ -3088,12 +3188,12 @@ function createModel({
|
|
|
3088
3188
|
}
|
|
3089
3189
|
__name(createModel, "createModel");
|
|
3090
3190
|
function createPlane({ world, scene, payload }) {
|
|
3091
|
-
const geometry = new
|
|
3092
|
-
const material = new
|
|
3191
|
+
const geometry = new THREE31__namespace.PlaneGeometry(100, 100);
|
|
3192
|
+
const material = new THREE31__namespace.MeshStandardMaterial({
|
|
3093
3193
|
color: "#ffffff",
|
|
3094
|
-
side:
|
|
3194
|
+
side: THREE31__namespace.DoubleSide
|
|
3095
3195
|
});
|
|
3096
|
-
const mesh = new
|
|
3196
|
+
const mesh = new THREE31__namespace.Mesh(geometry, material);
|
|
3097
3197
|
const entityId = createBaseEntity(
|
|
3098
3198
|
world,
|
|
3099
3199
|
mesh,
|
|
@@ -3129,7 +3229,7 @@ function createScriptObject({
|
|
|
3129
3229
|
scene,
|
|
3130
3230
|
payload
|
|
3131
3231
|
}) {
|
|
3132
|
-
const object = new
|
|
3232
|
+
const object = new THREE31__namespace.Group();
|
|
3133
3233
|
const entityId = createBaseEntity(world, object, {
|
|
3134
3234
|
label: payload.name ?? "Script Object",
|
|
3135
3235
|
entityType: "scriptObject",
|
|
@@ -3146,8 +3246,56 @@ function createScriptObject({
|
|
|
3146
3246
|
return entityId;
|
|
3147
3247
|
}
|
|
3148
3248
|
__name(createScriptObject, "createScriptObject");
|
|
3249
|
+
function createTeleportArea({
|
|
3250
|
+
world,
|
|
3251
|
+
scene,
|
|
3252
|
+
payload
|
|
3253
|
+
}) {
|
|
3254
|
+
const options = payload.options ?? {};
|
|
3255
|
+
const width = typeof options.width === "number" ? options.width : 10;
|
|
3256
|
+
const depth = typeof options.depth === "number" ? options.depth : 10;
|
|
3257
|
+
const geometry = new THREE31__namespace.PlaneGeometry(width, depth);
|
|
3258
|
+
const material = new THREE31__namespace.MeshBasicMaterial({
|
|
3259
|
+
color: "#4da3ff",
|
|
3260
|
+
transparent: true,
|
|
3261
|
+
opacity: 0.18,
|
|
3262
|
+
side: THREE31__namespace.DoubleSide,
|
|
3263
|
+
depthWrite: false
|
|
3264
|
+
});
|
|
3265
|
+
const object = new THREE31__namespace.Mesh(geometry, material);
|
|
3266
|
+
object.rotation.x = -Math.PI / 2;
|
|
3267
|
+
const entityId = createBaseEntity(world, object, {
|
|
3268
|
+
label: payload.name ?? "Teleport Area",
|
|
3269
|
+
entityType: "teleportArea",
|
|
3270
|
+
transformInput: payload.transform
|
|
3271
|
+
});
|
|
3272
|
+
world.addComponent(
|
|
3273
|
+
entityId,
|
|
3274
|
+
new VRTeleportAreaComponent({ width, depth, ...options })
|
|
3275
|
+
);
|
|
3276
|
+
scene.add(object);
|
|
3277
|
+
return entityId;
|
|
3278
|
+
}
|
|
3279
|
+
__name(createTeleportArea, "createTeleportArea");
|
|
3280
|
+
function createXRRig({
|
|
3281
|
+
world,
|
|
3282
|
+
scene,
|
|
3283
|
+
payload
|
|
3284
|
+
}) {
|
|
3285
|
+
const object = new THREE31__namespace.Group();
|
|
3286
|
+
const entityId = createBaseEntity(world, object, {
|
|
3287
|
+
label: payload.name ?? "XR Rig",
|
|
3288
|
+
entityType: "xrRig",
|
|
3289
|
+
transformInput: payload.transform
|
|
3290
|
+
});
|
|
3291
|
+
const options = payload.options ?? {};
|
|
3292
|
+
world.addComponent(entityId, new XRRigComponent(options));
|
|
3293
|
+
scene.add(object);
|
|
3294
|
+
return entityId;
|
|
3295
|
+
}
|
|
3296
|
+
__name(createXRRig, "createXRRig");
|
|
3149
3297
|
function createSprite({ world, scene, payload }) {
|
|
3150
|
-
const anchor = new
|
|
3298
|
+
const anchor = new THREE31__namespace.Object3D();
|
|
3151
3299
|
const imagePath = payload.path ?? "";
|
|
3152
3300
|
const entityId = createBaseEntity(world, anchor, {
|
|
3153
3301
|
label: payload.name ?? "Sprite",
|
|
@@ -3159,7 +3307,7 @@ function createSprite({ world, scene, payload }) {
|
|
|
3159
3307
|
if (!imagePath) {
|
|
3160
3308
|
return entityId;
|
|
3161
3309
|
}
|
|
3162
|
-
const loader = new
|
|
3310
|
+
const loader = new THREE31__namespace.TextureLoader();
|
|
3163
3311
|
loader.load(
|
|
3164
3312
|
imagePath,
|
|
3165
3313
|
(texture) => {
|
|
@@ -3167,11 +3315,11 @@ function createSprite({ world, scene, payload }) {
|
|
|
3167
3315
|
texture.dispose();
|
|
3168
3316
|
return;
|
|
3169
3317
|
}
|
|
3170
|
-
const material = new
|
|
3318
|
+
const material = new THREE31__namespace.SpriteMaterial({
|
|
3171
3319
|
map: texture,
|
|
3172
3320
|
transparent: true
|
|
3173
3321
|
});
|
|
3174
|
-
const sprite = new
|
|
3322
|
+
const sprite = new THREE31__namespace.Sprite(material);
|
|
3175
3323
|
sprite.userData.entityId = entityId;
|
|
3176
3324
|
const textureImage = texture.image;
|
|
3177
3325
|
spriteComponent.width = textureImage?.width ?? 1;
|
|
@@ -3189,9 +3337,9 @@ function createSprite({ world, scene, payload }) {
|
|
|
3189
3337
|
}
|
|
3190
3338
|
__name(createSprite, "createSprite");
|
|
3191
3339
|
function createSphere({ world, scene, payload }) {
|
|
3192
|
-
const geometry = new
|
|
3193
|
-
const material = new
|
|
3194
|
-
const mesh = new
|
|
3340
|
+
const geometry = new THREE31__namespace.SphereGeometry(0.5, 24, 24);
|
|
3341
|
+
const material = new THREE31__namespace.MeshStandardMaterial({ color: "#ffffff" });
|
|
3342
|
+
const mesh = new THREE31__namespace.Mesh(geometry, material);
|
|
3195
3343
|
const entityId = createBaseEntity(world, mesh, {
|
|
3196
3344
|
label: payload.name ?? "Sphere",
|
|
3197
3345
|
entityType: "sphere",
|
|
@@ -3211,10 +3359,10 @@ function createSphere({ world, scene, payload }) {
|
|
|
3211
3359
|
__name(createSphere, "createSphere");
|
|
3212
3360
|
function getOrCreateListener2(camera) {
|
|
3213
3361
|
const existing = camera.userData.ecsAudioListener;
|
|
3214
|
-
if (existing instanceof
|
|
3362
|
+
if (existing instanceof THREE31__namespace.AudioListener) {
|
|
3215
3363
|
return existing;
|
|
3216
3364
|
}
|
|
3217
|
-
const listener = new
|
|
3365
|
+
const listener = new THREE31__namespace.AudioListener();
|
|
3218
3366
|
camera.add(listener);
|
|
3219
3367
|
camera.userData.ecsAudioListener = listener;
|
|
3220
3368
|
return listener;
|
|
@@ -3264,10 +3412,10 @@ function normalizeOptions(input) {
|
|
|
3264
3412
|
}
|
|
3265
3413
|
__name(normalizeOptions, "normalizeOptions");
|
|
3266
3414
|
function createChromaMaterial(texture, options) {
|
|
3267
|
-
return new
|
|
3415
|
+
return new THREE31__namespace.ShaderMaterial({
|
|
3268
3416
|
uniforms: {
|
|
3269
3417
|
tex: { value: texture },
|
|
3270
|
-
keyColor: { value: new
|
|
3418
|
+
keyColor: { value: new THREE31__namespace.Color(options.backgroundColor) },
|
|
3271
3419
|
similarity: { value: options.similarity },
|
|
3272
3420
|
smoothness: { value: options.smoothness },
|
|
3273
3421
|
spill: { value: options.spill }
|
|
@@ -3299,22 +3447,22 @@ function createChromaMaterial(texture, options) {
|
|
|
3299
3447
|
}
|
|
3300
3448
|
`,
|
|
3301
3449
|
transparent: true,
|
|
3302
|
-
side:
|
|
3450
|
+
side: THREE31__namespace.DoubleSide
|
|
3303
3451
|
});
|
|
3304
3452
|
}
|
|
3305
3453
|
__name(createChromaMaterial, "createChromaMaterial");
|
|
3306
3454
|
function createStandardMaterial(texture) {
|
|
3307
|
-
return new
|
|
3455
|
+
return new THREE31__namespace.MeshBasicMaterial({
|
|
3308
3456
|
map: texture,
|
|
3309
3457
|
transparent: true,
|
|
3310
|
-
side:
|
|
3458
|
+
side: THREE31__namespace.DoubleSide
|
|
3311
3459
|
});
|
|
3312
3460
|
}
|
|
3313
3461
|
__name(createStandardMaterial, "createStandardMaterial");
|
|
3314
3462
|
function createVideoMesh(entityId, texture, options) {
|
|
3315
|
-
const geometry = new
|
|
3463
|
+
const geometry = new THREE31__namespace.PlaneGeometry(1, 1);
|
|
3316
3464
|
const material = options.isGreenScreen ? createChromaMaterial(texture, options) : createStandardMaterial(texture);
|
|
3317
|
-
const mesh = new
|
|
3465
|
+
const mesh = new THREE31__namespace.Mesh(geometry, material);
|
|
3318
3466
|
mesh.userData.entityId = entityId;
|
|
3319
3467
|
mesh.scale.set(options.width, options.height, 1);
|
|
3320
3468
|
return { mesh, material };
|
|
@@ -3349,7 +3497,7 @@ function createVideo({
|
|
|
3349
3497
|
payload,
|
|
3350
3498
|
isEditor
|
|
3351
3499
|
}) {
|
|
3352
|
-
const anchor = new
|
|
3500
|
+
const anchor = new THREE31__namespace.Object3D();
|
|
3353
3501
|
const path = payload.path ?? "";
|
|
3354
3502
|
const options = normalizeOptions(payload.options);
|
|
3355
3503
|
const entityId = createBaseEntity(world, anchor, {
|
|
@@ -3364,8 +3512,8 @@ function createVideo({
|
|
|
3364
3512
|
return entityId;
|
|
3365
3513
|
}
|
|
3366
3514
|
const video = createVideoElement(path, options);
|
|
3367
|
-
const texture = new
|
|
3368
|
-
texture.colorSpace =
|
|
3515
|
+
const texture = new THREE31__namespace.VideoTexture(video);
|
|
3516
|
+
texture.colorSpace = THREE31__namespace.SRGBColorSpace;
|
|
3369
3517
|
texture.needsUpdate = true;
|
|
3370
3518
|
const { mesh, material } = createVideoMesh(entityId, texture, options);
|
|
3371
3519
|
anchor.add(mesh);
|
|
@@ -3381,7 +3529,7 @@ function createVideo({
|
|
|
3381
3529
|
});
|
|
3382
3530
|
if (!isEditor && options.positional) {
|
|
3383
3531
|
const listener = getOrCreateListener2(camera);
|
|
3384
|
-
const audioNode = new
|
|
3532
|
+
const audioNode = new THREE31__namespace.PositionalAudio(listener);
|
|
3385
3533
|
audioNode.setVolume(options.volume);
|
|
3386
3534
|
audioNode.setRefDistance(options.refDistance);
|
|
3387
3535
|
audioNode.setDistanceModel(normalizeDistanceModel2(options.distanceModel));
|
|
@@ -3421,6 +3569,8 @@ function registerDefaultFactories(objectManagementSystem) {
|
|
|
3421
3569
|
objectManagementSystem.register("spotLight", createSpotLight);
|
|
3422
3570
|
objectManagementSystem.register("areaLight", createAreaLight);
|
|
3423
3571
|
objectManagementSystem.register("scriptObject", createScriptObject);
|
|
3572
|
+
objectManagementSystem.register("xrRig", createXRRig);
|
|
3573
|
+
objectManagementSystem.register("teleportArea", createTeleportArea);
|
|
3424
3574
|
registerDefaultComponentFactories(objectManagementSystem);
|
|
3425
3575
|
}
|
|
3426
3576
|
__name(registerDefaultFactories, "registerDefaultFactories");
|
|
@@ -3451,7 +3601,10 @@ exports.createSelectableComponent = createSelectableComponent;
|
|
|
3451
3601
|
exports.createSelectionTransformStateComponent = createSelectionTransformStateComponent;
|
|
3452
3602
|
exports.createSpriteComponent = createSpriteComponent;
|
|
3453
3603
|
exports.createTransformComponent = createTransformComponent;
|
|
3604
|
+
exports.createVRTeleportAreaComponent = createVRTeleportAreaComponent;
|
|
3454
3605
|
exports.createVideoComponent = createVideoComponent;
|
|
3606
|
+
exports.createXRInteractableComponent = createXRInteractableComponent;
|
|
3607
|
+
exports.createXRRigComponent = createXRRigComponent;
|
|
3455
3608
|
exports.registerDefaultComponentFactories = registerDefaultComponentFactories;
|
|
3456
3609
|
exports.registerDefaultFactories = registerDefaultFactories;
|
|
3457
3610
|
//# sourceMappingURL=index.cjs.map
|