@relu-interactives/spatial-ecs 0.2.16 → 0.2.20
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-BeuJ1xt5.d.cts → System-BjwOBx81.d.cts} +146 -1
- package/dist/{System-BeuJ1xt5.d.ts → System-BjwOBx81.d.ts} +146 -1
- package/dist/{Video-D4B-z74P.d.cts → Video-B8yVI1tF.d.cts} +17 -3
- package/dist/{Video-Cym2C52L.d.ts → Video-B9z5AtIf.d.ts} +17 -3
- package/dist/{chunk-EPK6MA7X.js → chunk-67MFQDHX.js} +1646 -8
- package/dist/chunk-67MFQDHX.js.map +1 -0
- package/dist/{chunk-GRUK5TNL.js → chunk-DY4ETMP2.js} +3 -3
- package/dist/{chunk-GRUK5TNL.js.map → chunk-DY4ETMP2.js.map} +1 -1
- package/dist/{chunk-CJW6K3CL.js → chunk-HUHN6IFD.js} +62 -5
- package/dist/chunk-HUHN6IFD.js.map +1 -0
- package/dist/{chunk-FTIQQK62.js → chunk-Z6OMYEXU.js} +42 -3
- package/dist/chunk-Z6OMYEXU.js.map +1 -0
- package/dist/{chunk-R2WMVXZZ.js → chunk-ZXGHKX7N.js} +5 -3
- package/dist/chunk-ZXGHKX7N.js.map +1 -0
- package/dist/components/index.cjs +39 -0
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.d.cts +3 -2
- package/dist/components/index.d.ts +3 -2
- package/dist/components/index.js +1 -1
- package/dist/docs/guide/accessing-components.md +9 -9
- package/dist/docs/guide/camera-rigs.md +525 -0
- package/dist/docs/guide/components/animation.md +5 -5
- package/dist/docs/guide/components/entity-type.md +2 -2
- package/dist/docs/guide/components/image.md +2 -2
- package/dist/docs/guide/components/instanced-mesh.md +3 -3
- package/dist/docs/guide/components/material.md +4 -0
- package/dist/docs/guide/components/mesh-geometry.md +3 -3
- package/dist/docs/guide/components/mesh.md +3 -3
- package/dist/docs/guide/components/model.md +2 -2
- package/dist/docs/guide/components/name.md +4 -4
- package/dist/docs/guide/components/object3d-ref.md +2 -2
- package/dist/docs/guide/components/parent-id.md +2 -2
- package/dist/docs/guide/components/physics.md +10 -0
- package/dist/docs/guide/components/video.md +2 -2
- package/dist/docs/guide/getting-started/editor/assets-browser.md +1 -1
- package/dist/docs/guide/prefabs.md +133 -0
- package/dist/docs/guide/world-api.md +4 -3
- package/dist/factories/index.cjs +136 -64
- package/dist/factories/index.cjs.map +1 -1
- package/dist/factories/index.d.cts +5 -4
- package/dist/factories/index.d.ts +5 -4
- package/dist/factories/index.js +3 -3
- package/dist/{index-BoJ3_6a3.d.ts → index-BBI2YdCu.d.ts} +60 -4
- package/dist/{index-BfoOC2CG.d.cts → index-LHLKpJhZ.d.cts} +60 -4
- package/dist/index.cjs +5978 -4972
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +215 -7
- package/dist/index.d.ts +215 -7
- package/dist/index.js +203 -960
- package/dist/index.js.map +1 -1
- package/dist/systems/index.cjs +1367 -0
- package/dist/systems/index.cjs.map +1 -1
- package/dist/systems/index.d.cts +2 -2
- package/dist/systems/index.d.ts +2 -2
- 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 +3 -1
- 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 +4 -2
- package/dist/chunk-CJW6K3CL.js.map +0 -1
- package/dist/chunk-EPK6MA7X.js.map +0 -1
- package/dist/chunk-FTIQQK62.js.map +0 -1
- package/dist/chunk-R2WMVXZZ.js.map +0 -1
|
@@ -1470,8 +1470,23 @@ var _MaterialComponent = class _MaterialComponent extends Component {
|
|
|
1470
1470
|
this.materials = [];
|
|
1471
1471
|
this.material = null;
|
|
1472
1472
|
this.values = [];
|
|
1473
|
+
this.assetRefs = [];
|
|
1473
1474
|
this.setMaterials(materialOrMaterials);
|
|
1474
1475
|
}
|
|
1476
|
+
/** Link/unlink a slot to a material asset URL (editor bookkeeping only). */
|
|
1477
|
+
setAssetRef(index, url) {
|
|
1478
|
+
if (index < 0) {
|
|
1479
|
+
return;
|
|
1480
|
+
}
|
|
1481
|
+
while (this.assetRefs.length <= index) {
|
|
1482
|
+
this.assetRefs.push(null);
|
|
1483
|
+
}
|
|
1484
|
+
this.assetRefs[index] = url;
|
|
1485
|
+
}
|
|
1486
|
+
/** The material-asset URL a slot is linked to, or null when local. */
|
|
1487
|
+
getAssetRef(index) {
|
|
1488
|
+
return this.assetRefs[index] ?? null;
|
|
1489
|
+
}
|
|
1475
1490
|
setMaterials(materialOrMaterials = []) {
|
|
1476
1491
|
this.materials = Array.isArray(materialOrMaterials) ? materialOrMaterials.filter(Boolean) : materialOrMaterials ? [materialOrMaterials] : [];
|
|
1477
1492
|
this.material = this.materials[0] ?? null;
|
|
@@ -1567,6 +1582,27 @@ var _ParentId = class _ParentId extends Component {
|
|
|
1567
1582
|
__name(_ParentId, "ParentId");
|
|
1568
1583
|
var ParentId = _ParentId;
|
|
1569
1584
|
|
|
1585
|
+
// core/components/PrefabInstance.ts
|
|
1586
|
+
var _PrefabInstance = class _PrefabInstance extends Component {
|
|
1587
|
+
constructor(url, overrides = []) {
|
|
1588
|
+
super();
|
|
1589
|
+
this.url = url;
|
|
1590
|
+
this.overrides = overrides;
|
|
1591
|
+
}
|
|
1592
|
+
};
|
|
1593
|
+
__name(_PrefabInstance, "PrefabInstance");
|
|
1594
|
+
var PrefabInstance = _PrefabInstance;
|
|
1595
|
+
|
|
1596
|
+
// core/components/PrefabNode.ts
|
|
1597
|
+
var _PrefabNode = class _PrefabNode extends Component {
|
|
1598
|
+
constructor(nodeId) {
|
|
1599
|
+
super();
|
|
1600
|
+
this.nodeId = nodeId;
|
|
1601
|
+
}
|
|
1602
|
+
};
|
|
1603
|
+
__name(_PrefabNode, "PrefabNode");
|
|
1604
|
+
var PrefabNode = _PrefabNode;
|
|
1605
|
+
|
|
1570
1606
|
// core/components/ScriptComponent.ts
|
|
1571
1607
|
var _ScriptComponent = class _ScriptComponent extends Component {
|
|
1572
1608
|
constructor(entries = []) {
|
|
@@ -1818,12 +1854,15 @@ exports.Object3DRef = Object3DRef;
|
|
|
1818
1854
|
exports.ParentId = ParentId;
|
|
1819
1855
|
exports.PhysicsComponent = PhysicsComponent;
|
|
1820
1856
|
exports.Postprocessing = Postprocessing;
|
|
1857
|
+
exports.PrefabInstance = PrefabInstance;
|
|
1858
|
+
exports.PrefabNode = PrefabNode;
|
|
1821
1859
|
exports.ScriptComponent = ScriptComponent;
|
|
1822
1860
|
exports.Selectable = Selectable;
|
|
1823
1861
|
exports.SelectionTransformState = SelectionTransformState;
|
|
1824
1862
|
exports.SpriteComponent = SpriteComponent;
|
|
1825
1863
|
exports.TransformComponent = TransformComponent;
|
|
1826
1864
|
exports.VideoComponent = VideoComponent;
|
|
1865
|
+
exports.defaultMaterialValue = defaultMaterialValue;
|
|
1827
1866
|
exports.normalizePhysicsState = normalizePhysicsState;
|
|
1828
1867
|
//# sourceMappingURL=index.cjs.map
|
|
1829
1868
|
//# sourceMappingURL=index.cjs.map
|