@relu-interactives/spatial-ecs 0.2.3 → 0.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{System-BTyYvKVH.d.cts → System-CIiWteft.d.cts} +2 -2
- package/dist/{System-BTyYvKVH.d.ts → System-CIiWteft.d.ts} +2 -2
- package/dist/{Video-D2H5H-K3.d.cts → Video-ChVFs9Tl.d.cts} +139 -75
- package/dist/{Video-BWhbvVPg.d.ts → Video-DCMCLInA.d.ts} +139 -75
- package/dist/{chunk-XWIEEJ7Z.js → chunk-4A66FSFT.js} +128 -82
- package/dist/chunk-4A66FSFT.js.map +1 -0
- package/dist/{chunk-AYEF3X2P.js → chunk-CRP3W2GK.js} +3 -3
- package/dist/chunk-CRP3W2GK.js.map +1 -0
- package/dist/{chunk-MAWBTMCG.js → chunk-KRZLEPRI.js} +156 -88
- package/dist/chunk-KRZLEPRI.js.map +1 -0
- package/dist/{chunk-NFDTIYR4.js → chunk-NB6I5JJN.js} +17 -2
- package/dist/chunk-NB6I5JJN.js.map +1 -0
- package/dist/{chunk-P2YDX5DB.js → chunk-RXCUHGRB.js} +124 -5
- package/dist/chunk-RXCUHGRB.js.map +1 -0
- package/dist/components/index.cjs +161 -93
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.d.cts +2 -2
- package/dist/components/index.d.ts +2 -2
- package/dist/components/index.js +1 -1
- package/dist/docs/api/Behaviour/classes/Behaviour.md +29 -29
- package/dist/docs/api/Component/classes/Component.md +1 -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 +3 -3
- 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/LightComponent.md +6 -6
- package/dist/docs/api/components/classes/MaterialComponent.md +11 -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 +6 -6
- package/dist/docs/api/components/classes/Postprocessing.md +3 -3
- package/dist/docs/api/components/classes/ScriptComponent.md +5 -5
- 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/normalizePhysicsState.md +1 -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/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 +9 -9
- 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_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/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 +4 -4
- 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 +95 -81
- 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 +1 -1
- 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/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 +1 -1
- 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/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/hydrateWorldFromSnapshot.md +1 -1
- package/dist/docs/api/index/functions/hydrateWorldFromSnapshotDetailed.md +1 -1
- 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/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/ComponentFactory.md +1 -1
- package/dist/docs/api/index/type-aliases/EcsComponentFactoryKind.md +1 -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/HydrateWorldFromSnapshotResult.md +3 -3
- package/dist/docs/api/index/type-aliases/KeyboardKey.md +1 -1
- package/dist/docs/api/index/type-aliases/MouseButton.md +1 -1
- package/dist/docs/api/index/type-aliases/SelectionContext.md +4 -4
- 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/types/type-aliases/AssetInput.md +3 -3
- package/dist/docs/api/types/type-aliases/CheckboxInput.md +1 -1
- 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 +1 -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 +1 -1
- 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/spawning/ambient-light.md +2 -2
- package/dist/docs/guide/spawning/area-light.md +2 -2
- package/dist/docs/guide/spawning/audio.md +27 -16
- package/dist/docs/guide/spawning/camera.md +2 -2
- package/dist/docs/guide/spawning/capsule.md +2 -2
- package/dist/docs/guide/spawning/cube.md +2 -2
- package/dist/docs/guide/spawning/cylinder.md +2 -2
- package/dist/docs/guide/spawning/directional-light.md +2 -2
- package/dist/docs/guide/spawning/empty.md +2 -2
- package/dist/docs/guide/spawning/image-target.md +2 -2
- package/dist/docs/guide/spawning/image.md +2 -2
- package/dist/docs/guide/spawning/index.md +2 -2
- package/dist/docs/guide/spawning/model.md +2 -2
- package/dist/docs/guide/spawning/plane.md +2 -2
- package/dist/docs/guide/spawning/point-light.md +2 -2
- package/dist/docs/guide/spawning/sphere.md +2 -2
- package/dist/docs/guide/spawning/spot-light.md +2 -2
- package/dist/docs/guide/spawning/sprite.md +2 -2
- package/dist/docs/guide/spawning/video.md +2 -2
- package/dist/docs/guide/world-api.md +3 -5
- package/dist/factories/index.cjs +217 -105
- 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-KdEzEZox.d.cts → index-D1I5L7bA.d.cts} +8 -3
- package/dist/{index-Dm6zF1MY.d.ts → index-DGZDgt3p.d.ts} +8 -3
- package/dist/index.cjs +468 -179
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -7
- package/dist/index.d.ts +7 -7
- package/dist/index.js +51 -12
- package/dist/index.js.map +1 -1
- package/dist/systems/index.cjs +248 -63
- package/dist/systems/index.cjs.map +1 -1
- package/dist/systems/index.d.cts +15 -3
- package/dist/systems/index.d.ts +15 -3
- package/dist/systems/index.js +3 -3
- package/dist/types.d.cts +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/worldSnapshotUtils.cjs +15 -0
- package/dist/worldSnapshotUtils.cjs.map +1 -1
- package/dist/worldSnapshotUtils.d.cts +1 -1
- package/dist/worldSnapshotUtils.d.ts +1 -1
- package/dist/worldSnapshotUtils.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-AYEF3X2P.js.map +0 -1
- package/dist/chunk-MAWBTMCG.js.map +0 -1
- package/dist/chunk-NFDTIYR4.js.map +0 -1
- package/dist/chunk-P2YDX5DB.js.map +0 -1
- package/dist/chunk-XWIEEJ7Z.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { resolveDracoDecoderPath, applyTransform } from './chunk-
|
|
2
|
-
import { AnimationComponent, ModelComponent, CameraComponent, Object3DRef, Environment, Postprocessing, TransformComponent, PhysicsComponent, LightComponent, MaterialComponent, DEFAULT_MESH_GEOMETRY_PARAMETERS, MeshGeometryComponent, ParentId, ScriptComponent, AudioComponent, VideoComponent } from './chunk-
|
|
1
|
+
import { resolveDracoDecoderPath, applyTransform } from './chunk-CRP3W2GK.js';
|
|
2
|
+
import { AnimationComponent, ModelComponent, CameraComponent, Object3DRef, Environment, Postprocessing, TransformComponent, PhysicsComponent, LightComponent, MaterialComponent, DEFAULT_MESH_GEOMETRY_PARAMETERS, MeshGeometryComponent, InstancedMeshComponent, ParentId, ScriptComponent, AudioComponent, VideoComponent } from './chunk-KRZLEPRI.js';
|
|
3
3
|
import { __name } from './chunk-OY7ZODZP.js';
|
|
4
4
|
import * as THREE7 from 'three';
|
|
5
5
|
import { DRACOLoader } from 'three/examples/jsm/loaders/DRACOLoader.js';
|
|
@@ -2269,6 +2269,125 @@ var _MeshGeometrySystem = class _MeshGeometrySystem {
|
|
|
2269
2269
|
};
|
|
2270
2270
|
__name(_MeshGeometrySystem, "MeshGeometrySystem");
|
|
2271
2271
|
var MeshGeometrySystem = _MeshGeometrySystem;
|
|
2272
|
+
function buildGeometry(component) {
|
|
2273
|
+
const p = component.getSanitizedParameters();
|
|
2274
|
+
switch (component.meshKind) {
|
|
2275
|
+
case "cube": {
|
|
2276
|
+
const params = p;
|
|
2277
|
+
return new THREE7.BoxGeometry(params.width, params.height, params.depth);
|
|
2278
|
+
}
|
|
2279
|
+
case "plane": {
|
|
2280
|
+
const params = p;
|
|
2281
|
+
return new THREE7.PlaneGeometry(params.width, params.height);
|
|
2282
|
+
}
|
|
2283
|
+
case "sphere": {
|
|
2284
|
+
const params = p;
|
|
2285
|
+
return new THREE7.SphereGeometry(params.radius, 24, 24);
|
|
2286
|
+
}
|
|
2287
|
+
case "cylinder": {
|
|
2288
|
+
const params = p;
|
|
2289
|
+
return new THREE7.CylinderGeometry(params.radius, params.radius, params.height, 20);
|
|
2290
|
+
}
|
|
2291
|
+
case "capsule": {
|
|
2292
|
+
const params = p;
|
|
2293
|
+
return new THREE7.CapsuleGeometry(params.radius, params.height, 4, 8);
|
|
2294
|
+
}
|
|
2295
|
+
}
|
|
2296
|
+
}
|
|
2297
|
+
__name(buildGeometry, "buildGeometry");
|
|
2298
|
+
var _position = new THREE7.Vector3();
|
|
2299
|
+
var _quaternion = new THREE7.Quaternion();
|
|
2300
|
+
var _euler = new THREE7.Euler();
|
|
2301
|
+
var _scale = new THREE7.Vector3();
|
|
2302
|
+
var _matrix = new THREE7.Matrix4();
|
|
2303
|
+
function instanceTransformToMatrix4(inst, out) {
|
|
2304
|
+
_position.set(inst.position.x, inst.position.y, inst.position.z);
|
|
2305
|
+
_euler.set(inst.rotation.x, inst.rotation.y, inst.rotation.z, "XYZ");
|
|
2306
|
+
_quaternion.setFromEuler(_euler);
|
|
2307
|
+
_scale.set(inst.scale.x, inst.scale.y, inst.scale.z);
|
|
2308
|
+
out.compose(_position, _quaternion, _scale);
|
|
2309
|
+
}
|
|
2310
|
+
__name(instanceTransformToMatrix4, "instanceTransformToMatrix4");
|
|
2311
|
+
var _InstancedMeshSystem = class _InstancedMeshSystem {
|
|
2312
|
+
constructor() {
|
|
2313
|
+
/** Signature tracking for geometry + instance count changes. */
|
|
2314
|
+
this.geometrySignatures = /* @__PURE__ */ new Map();
|
|
2315
|
+
}
|
|
2316
|
+
update(world) {
|
|
2317
|
+
const entityIds = world.query(InstancedMeshComponent);
|
|
2318
|
+
const alive = new Set(entityIds);
|
|
2319
|
+
for (const trackedId of this.geometrySignatures.keys()) {
|
|
2320
|
+
if (!alive.has(trackedId)) {
|
|
2321
|
+
this.geometrySignatures.delete(trackedId);
|
|
2322
|
+
}
|
|
2323
|
+
}
|
|
2324
|
+
for (const entityId of entityIds) {
|
|
2325
|
+
const comp = world.getComponent(
|
|
2326
|
+
entityId,
|
|
2327
|
+
InstancedMeshComponent
|
|
2328
|
+
);
|
|
2329
|
+
if (!comp) {
|
|
2330
|
+
continue;
|
|
2331
|
+
}
|
|
2332
|
+
let anchor = null;
|
|
2333
|
+
const objectRef = world.getComponent(entityId, Object3DRef);
|
|
2334
|
+
if (objectRef?.object) {
|
|
2335
|
+
anchor = objectRef.object;
|
|
2336
|
+
}
|
|
2337
|
+
if (!anchor) {
|
|
2338
|
+
continue;
|
|
2339
|
+
}
|
|
2340
|
+
const instanceCount = comp.instances.length;
|
|
2341
|
+
const geometrySignature = `${comp.meshKind}:${JSON.stringify(comp.meshParameters)}:${instanceCount}`;
|
|
2342
|
+
const needsRebuild = comp.instancedMesh === null || this.geometrySignatures.get(entityId) !== geometrySignature;
|
|
2343
|
+
if (needsRebuild) {
|
|
2344
|
+
if (comp.instancedMesh) {
|
|
2345
|
+
anchor.remove(comp.instancedMesh);
|
|
2346
|
+
comp.instancedMesh.geometry.dispose();
|
|
2347
|
+
if (Array.isArray(comp.instancedMesh.material)) {
|
|
2348
|
+
for (const m of comp.instancedMesh.material) {
|
|
2349
|
+
m.dispose();
|
|
2350
|
+
}
|
|
2351
|
+
} else {
|
|
2352
|
+
comp.instancedMesh.material.dispose();
|
|
2353
|
+
}
|
|
2354
|
+
comp.instancedMesh = null;
|
|
2355
|
+
}
|
|
2356
|
+
const count = Math.max(1, instanceCount);
|
|
2357
|
+
const geometry = buildGeometry(comp);
|
|
2358
|
+
const material = new THREE7.MeshStandardMaterial({ color: "#ffffff" });
|
|
2359
|
+
const instancedMesh = new THREE7.InstancedMesh(geometry, material, count);
|
|
2360
|
+
instancedMesh.castShadow = comp.castShadow;
|
|
2361
|
+
instancedMesh.receiveShadow = comp.receiveShadow;
|
|
2362
|
+
for (let i = 0; i < count; i++) {
|
|
2363
|
+
const inst = comp.instances[i] ?? {
|
|
2364
|
+
position: { x: 0, y: 0, z: 0 },
|
|
2365
|
+
rotation: { x: 0, y: 0, z: 0 },
|
|
2366
|
+
scale: { x: 1, y: 1, z: 1 }
|
|
2367
|
+
};
|
|
2368
|
+
instanceTransformToMatrix4(inst, _matrix);
|
|
2369
|
+
instancedMesh.setMatrixAt(i, _matrix);
|
|
2370
|
+
}
|
|
2371
|
+
instancedMesh.instanceMatrix.needsUpdate = true;
|
|
2372
|
+
anchor.add(instancedMesh);
|
|
2373
|
+
comp.instancedMesh = instancedMesh;
|
|
2374
|
+
this.geometrySignatures.set(entityId, geometrySignature);
|
|
2375
|
+
} else {
|
|
2376
|
+
const im = comp.instancedMesh;
|
|
2377
|
+
const count = comp.instances.length;
|
|
2378
|
+
for (let i = 0; i < count; i++) {
|
|
2379
|
+
instanceTransformToMatrix4(comp.instances[i], _matrix);
|
|
2380
|
+
im.setMatrixAt(i, _matrix);
|
|
2381
|
+
}
|
|
2382
|
+
im.instanceMatrix.needsUpdate = true;
|
|
2383
|
+
im.castShadow = comp.castShadow;
|
|
2384
|
+
im.receiveShadow = comp.receiveShadow;
|
|
2385
|
+
}
|
|
2386
|
+
}
|
|
2387
|
+
}
|
|
2388
|
+
};
|
|
2389
|
+
__name(_InstancedMeshSystem, "InstancedMeshSystem");
|
|
2390
|
+
var InstancedMeshSystem = _InstancedMeshSystem;
|
|
2272
2391
|
|
|
2273
2392
|
// core/systems/RenderSystem.ts
|
|
2274
2393
|
var _RenderSystem = class _RenderSystem {
|
|
@@ -3299,6 +3418,6 @@ var _VideoSystem = class _VideoSystem {
|
|
|
3299
3418
|
__name(_VideoSystem, "VideoSystem");
|
|
3300
3419
|
var VideoSystem = _VideoSystem;
|
|
3301
3420
|
|
|
3302
|
-
export { AnimationSystem, AudioSystem, Behaviour, CameraSyncSystem, EnvironmentSyncSystem, InputSystem, KeyboardKeys, LightSyncSystem, MaterialSyncSystem, MeshGeometrySystem, ObjectVisibilitySystem, PhysicsSyncSystem, PostprocessingSyncSystem, RenderSystem, ScriptBehaviourSystem, TransformSyncSystem, VideoSystem };
|
|
3303
|
-
//# sourceMappingURL=chunk-
|
|
3304
|
-
//# sourceMappingURL=chunk-
|
|
3421
|
+
export { AnimationSystem, AudioSystem, Behaviour, CameraSyncSystem, EnvironmentSyncSystem, InputSystem, InstancedMeshSystem, KeyboardKeys, LightSyncSystem, MaterialSyncSystem, MeshGeometrySystem, ObjectVisibilitySystem, PhysicsSyncSystem, PostprocessingSyncSystem, RenderSystem, ScriptBehaviourSystem, TransformSyncSystem, VideoSystem };
|
|
3422
|
+
//# sourceMappingURL=chunk-RXCUHGRB.js.map
|
|
3423
|
+
//# sourceMappingURL=chunk-RXCUHGRB.js.map
|