@relu-interactives/spatial-ecs 0.2.4 → 0.2.6
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-BWhbvVPg.d.ts → Video-B-qMljTn.d.ts} +147 -75
- package/dist/{Video-D2H5H-K3.d.cts → Video-Dj4KBqQ1.d.cts} +147 -75
- package/dist/{chunk-XWIEEJ7Z.js → chunk-EIC5B3A7.js} +128 -82
- package/dist/chunk-EIC5B3A7.js.map +1 -0
- package/dist/{chunk-AYEF3X2P.js → chunk-FDWNCXU3.js} +3 -3
- package/dist/chunk-FDWNCXU3.js.map +1 -0
- package/dist/{chunk-NFDTIYR4.js → chunk-G2DUXNTQ.js} +18 -2
- package/dist/chunk-G2DUXNTQ.js.map +1 -0
- package/dist/{chunk-P2YDX5DB.js → chunk-NRSUYDBA.js} +275 -5
- package/dist/chunk-NRSUYDBA.js.map +1 -0
- package/dist/{chunk-MAWBTMCG.js → chunk-R5D5PWXV.js} +160 -88
- package/dist/chunk-R5D5PWXV.js.map +1 -0
- package/dist/components/index.cjs +165 -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/factories/index.cjs +221 -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-B12sx9yF.d.cts} +8 -3
- package/dist/{index-Dm6zF1MY.d.ts → index-Cf-PaKyN.d.ts} +8 -3
- package/dist/index.cjs +627 -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 +54 -12
- package/dist/index.js.map +1 -1
- package/dist/systems/index.cjs +403 -63
- package/dist/systems/index.cjs.map +1 -1
- package/dist/systems/index.d.cts +27 -3
- package/dist/systems/index.d.ts +27 -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 +16 -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
1
|
import { __export, __name, Component } from './chunk-OY7ZODZP.js';
|
|
2
|
-
import * as
|
|
2
|
+
import * as THREE5 from 'three';
|
|
3
3
|
import { Vector3, Euler, Quaternion } from 'three';
|
|
4
4
|
|
|
5
5
|
// core/components/index.ts
|
|
@@ -10,6 +10,8 @@ __export(components_exports, {
|
|
|
10
10
|
CameraComponent: () => CameraComponent,
|
|
11
11
|
DEFAULT_COLLIDER_STATE: () => DEFAULT_COLLIDER_STATE,
|
|
12
12
|
DEFAULT_ENVIRONMENT_STATE: () => DEFAULT_ENVIRONMENT_STATE,
|
|
13
|
+
DEFAULT_INSTANCED_MESH_PARAMETERS: () => DEFAULT_INSTANCED_MESH_PARAMETERS,
|
|
14
|
+
DEFAULT_INSTANCE_TRANSFORM: () => DEFAULT_INSTANCE_TRANSFORM,
|
|
13
15
|
DEFAULT_MESH_GEOMETRY_PARAMETERS: () => DEFAULT_MESH_GEOMETRY_PARAMETERS,
|
|
14
16
|
DEFAULT_PHYSICS_STATE: () => DEFAULT_PHYSICS_STATE,
|
|
15
17
|
DEFAULT_POSTPROCESSING_STATE: () => DEFAULT_POSTPROCESSING_STATE,
|
|
@@ -19,6 +21,7 @@ __export(components_exports, {
|
|
|
19
21
|
ImageComponent: () => ImageComponent,
|
|
20
22
|
ImageTarget: () => ImageTarget,
|
|
21
23
|
ImageTargetAnchor: () => ImageTargetAnchor,
|
|
24
|
+
InstancedMeshComponent: () => InstancedMeshComponent,
|
|
22
25
|
LightComponent: () => LightComponent,
|
|
23
26
|
MaterialComponent: () => MaterialComponent,
|
|
24
27
|
MeshComponent: () => MeshComponent,
|
|
@@ -300,14 +303,14 @@ var _AnimationComponent = class _AnimationComponent extends Component {
|
|
|
300
303
|
return;
|
|
301
304
|
}
|
|
302
305
|
this.importedClips = clips.map((entry) => {
|
|
303
|
-
if (entry instanceof
|
|
306
|
+
if (entry instanceof THREE5.AnimationClip) {
|
|
304
307
|
return { clip: entry, sourceUrl: null };
|
|
305
308
|
}
|
|
306
309
|
if (!entry || typeof entry !== "object") {
|
|
307
310
|
return null;
|
|
308
311
|
}
|
|
309
312
|
const candidate = entry;
|
|
310
|
-
if (!(candidate.clip instanceof
|
|
313
|
+
if (!(candidate.clip instanceof THREE5.AnimationClip)) {
|
|
311
314
|
return null;
|
|
312
315
|
}
|
|
313
316
|
return {
|
|
@@ -441,7 +444,7 @@ var DEFAULT_ORTHO_TOP = 5;
|
|
|
441
444
|
var DEFAULT_ORTHO_BOTTOM = -5;
|
|
442
445
|
var DEFAULT_ZOOM = 1;
|
|
443
446
|
function inferProjection(camera) {
|
|
444
|
-
if (camera instanceof
|
|
447
|
+
if (camera instanceof THREE5.OrthographicCamera) {
|
|
445
448
|
return "orthographic";
|
|
446
449
|
}
|
|
447
450
|
return "perspective";
|
|
@@ -462,7 +465,7 @@ function readCameraFar(camera) {
|
|
|
462
465
|
}
|
|
463
466
|
__name(readCameraFar, "readCameraFar");
|
|
464
467
|
function inferFov(camera) {
|
|
465
|
-
if (camera instanceof
|
|
468
|
+
if (camera instanceof THREE5.PerspectiveCamera && Number.isFinite(camera.fov)) {
|
|
466
469
|
return camera.fov;
|
|
467
470
|
}
|
|
468
471
|
return DEFAULT_FOV;
|
|
@@ -485,28 +488,28 @@ function inferFar(camera) {
|
|
|
485
488
|
}
|
|
486
489
|
__name(inferFar, "inferFar");
|
|
487
490
|
function inferOrthoLeft(camera) {
|
|
488
|
-
if (camera instanceof
|
|
491
|
+
if (camera instanceof THREE5.OrthographicCamera && Number.isFinite(camera.left)) {
|
|
489
492
|
return camera.left;
|
|
490
493
|
}
|
|
491
494
|
return DEFAULT_ORTHO_LEFT;
|
|
492
495
|
}
|
|
493
496
|
__name(inferOrthoLeft, "inferOrthoLeft");
|
|
494
497
|
function inferOrthoRight(camera) {
|
|
495
|
-
if (camera instanceof
|
|
498
|
+
if (camera instanceof THREE5.OrthographicCamera && Number.isFinite(camera.right)) {
|
|
496
499
|
return camera.right;
|
|
497
500
|
}
|
|
498
501
|
return DEFAULT_ORTHO_RIGHT;
|
|
499
502
|
}
|
|
500
503
|
__name(inferOrthoRight, "inferOrthoRight");
|
|
501
504
|
function inferOrthoTop(camera) {
|
|
502
|
-
if (camera instanceof
|
|
505
|
+
if (camera instanceof THREE5.OrthographicCamera && Number.isFinite(camera.top)) {
|
|
503
506
|
return camera.top;
|
|
504
507
|
}
|
|
505
508
|
return DEFAULT_ORTHO_TOP;
|
|
506
509
|
}
|
|
507
510
|
__name(inferOrthoTop, "inferOrthoTop");
|
|
508
511
|
function inferOrthoBottom(camera) {
|
|
509
|
-
if (camera instanceof
|
|
512
|
+
if (camera instanceof THREE5.OrthographicCamera && Number.isFinite(camera.bottom)) {
|
|
510
513
|
return camera.bottom;
|
|
511
514
|
}
|
|
512
515
|
return DEFAULT_ORTHO_BOTTOM;
|
|
@@ -522,7 +525,7 @@ __name(inferZoom, "inferZoom");
|
|
|
522
525
|
var _CameraComponent = class _CameraComponent extends Component {
|
|
523
526
|
constructor(payload = {}) {
|
|
524
527
|
super();
|
|
525
|
-
this.camera = payload.camera ?? new
|
|
528
|
+
this.camera = payload.camera ?? new THREE5.PerspectiveCamera();
|
|
526
529
|
this.type = payload.type ?? "3d";
|
|
527
530
|
this.isDefault = typeof payload.isDefault === "boolean" ? payload.isDefault : false;
|
|
528
531
|
this.projection = payload.projection ?? inferProjection(payload.camera);
|
|
@@ -957,6 +960,139 @@ var _Postprocessing = class _Postprocessing extends Component {
|
|
|
957
960
|
};
|
|
958
961
|
__name(_Postprocessing, "Postprocessing");
|
|
959
962
|
var Postprocessing = _Postprocessing;
|
|
963
|
+
var DEFAULT_MESH_GEOMETRY_PARAMETERS = {
|
|
964
|
+
capsule: { radius: 0.5, height: 1 },
|
|
965
|
+
cube: { width: 1, height: 1, depth: 1 },
|
|
966
|
+
cylinder: { radius: 0.5, height: 1 },
|
|
967
|
+
model: {},
|
|
968
|
+
plane: { width: 100, height: 100 },
|
|
969
|
+
sphere: { radius: 0.5 }
|
|
970
|
+
};
|
|
971
|
+
var GEOMETRY_TYPE_BY_KIND = {
|
|
972
|
+
capsule: "CapsuleGeometry",
|
|
973
|
+
cube: "BoxGeometry",
|
|
974
|
+
cylinder: "CylinderGeometry",
|
|
975
|
+
model: "Model",
|
|
976
|
+
plane: "PlaneGeometry",
|
|
977
|
+
sphere: "SphereGeometry"
|
|
978
|
+
};
|
|
979
|
+
var _MeshGeometryComponent = class _MeshGeometryComponent extends Component {
|
|
980
|
+
constructor(kind, object, parameters, options) {
|
|
981
|
+
super();
|
|
982
|
+
this.kind = kind;
|
|
983
|
+
this.geometryType = GEOMETRY_TYPE_BY_KIND[kind];
|
|
984
|
+
this.object = object;
|
|
985
|
+
this.modelName = options?.modelName ?? "";
|
|
986
|
+
this.castShadow = options?.castShadow ?? false;
|
|
987
|
+
this.receiveShadow = options?.receiveShadow ?? false;
|
|
988
|
+
switch (kind) {
|
|
989
|
+
case "cube":
|
|
990
|
+
this.parameters = {
|
|
991
|
+
...DEFAULT_MESH_GEOMETRY_PARAMETERS.cube,
|
|
992
|
+
...parameters
|
|
993
|
+
};
|
|
994
|
+
break;
|
|
995
|
+
case "plane":
|
|
996
|
+
this.parameters = {
|
|
997
|
+
...DEFAULT_MESH_GEOMETRY_PARAMETERS.plane,
|
|
998
|
+
...parameters
|
|
999
|
+
};
|
|
1000
|
+
break;
|
|
1001
|
+
case "sphere":
|
|
1002
|
+
this.parameters = {
|
|
1003
|
+
...DEFAULT_MESH_GEOMETRY_PARAMETERS.sphere,
|
|
1004
|
+
...parameters
|
|
1005
|
+
};
|
|
1006
|
+
break;
|
|
1007
|
+
case "cylinder":
|
|
1008
|
+
this.parameters = {
|
|
1009
|
+
...DEFAULT_MESH_GEOMETRY_PARAMETERS.cylinder,
|
|
1010
|
+
...parameters
|
|
1011
|
+
};
|
|
1012
|
+
break;
|
|
1013
|
+
case "capsule":
|
|
1014
|
+
this.parameters = {
|
|
1015
|
+
...DEFAULT_MESH_GEOMETRY_PARAMETERS.capsule,
|
|
1016
|
+
...parameters
|
|
1017
|
+
};
|
|
1018
|
+
break;
|
|
1019
|
+
case "model":
|
|
1020
|
+
this.parameters = {};
|
|
1021
|
+
break;
|
|
1022
|
+
}
|
|
1023
|
+
}
|
|
1024
|
+
};
|
|
1025
|
+
__name(_MeshGeometryComponent, "MeshGeometryComponent");
|
|
1026
|
+
var MeshGeometryComponent = _MeshGeometryComponent;
|
|
1027
|
+
|
|
1028
|
+
// core/components/InstancedMesh.ts
|
|
1029
|
+
var DEFAULT_INSTANCE_TRANSFORM = {
|
|
1030
|
+
position: { x: 0, y: 0, z: 0 },
|
|
1031
|
+
rotation: { x: 0, y: 0, z: 0 },
|
|
1032
|
+
scale: { x: 1, y: 1, z: 1 }
|
|
1033
|
+
};
|
|
1034
|
+
var DEFAULT_INSTANCED_MESH_PARAMETERS = {
|
|
1035
|
+
capsule: DEFAULT_MESH_GEOMETRY_PARAMETERS.capsule,
|
|
1036
|
+
cube: DEFAULT_MESH_GEOMETRY_PARAMETERS.cube,
|
|
1037
|
+
cylinder: DEFAULT_MESH_GEOMETRY_PARAMETERS.cylinder,
|
|
1038
|
+
model: DEFAULT_MESH_GEOMETRY_PARAMETERS.cube,
|
|
1039
|
+
plane: DEFAULT_MESH_GEOMETRY_PARAMETERS.plane,
|
|
1040
|
+
sphere: DEFAULT_MESH_GEOMETRY_PARAMETERS.sphere
|
|
1041
|
+
};
|
|
1042
|
+
var _InstancedMeshComponent = class _InstancedMeshComponent extends Component {
|
|
1043
|
+
constructor(meshKind = "cube", meshParameters, options) {
|
|
1044
|
+
super();
|
|
1045
|
+
this.meshKind = meshKind;
|
|
1046
|
+
this.modelPath = options?.modelPath ?? "";
|
|
1047
|
+
this.meshParameters = {
|
|
1048
|
+
...DEFAULT_INSTANCED_MESH_PARAMETERS[meshKind],
|
|
1049
|
+
...meshParameters ?? {}
|
|
1050
|
+
};
|
|
1051
|
+
this.castShadow = options?.castShadow ?? false;
|
|
1052
|
+
this.receiveShadow = options?.receiveShadow ?? false;
|
|
1053
|
+
this.instances = options?.instances && options.instances.length > 0 ? options.instances : [{ ...DEFAULT_INSTANCE_TRANSFORM }];
|
|
1054
|
+
this.instancedMesh = null;
|
|
1055
|
+
}
|
|
1056
|
+
/** Sanitize and return a copy of the current mesh parameters with valid values. */
|
|
1057
|
+
getSanitizedParameters() {
|
|
1058
|
+
const MIN_DIM = 0.01;
|
|
1059
|
+
const MIN_RAD = 1e-3;
|
|
1060
|
+
const sanitize = /* @__PURE__ */ __name((v, min) => Number.isFinite(v) ? Math.max(min, v) : min, "sanitize");
|
|
1061
|
+
switch (this.meshKind) {
|
|
1062
|
+
case "cube": {
|
|
1063
|
+
const p = this.meshParameters;
|
|
1064
|
+
return {
|
|
1065
|
+
width: sanitize(p.width, MIN_DIM),
|
|
1066
|
+
height: sanitize(p.height, MIN_DIM),
|
|
1067
|
+
depth: sanitize(p.depth, MIN_DIM)
|
|
1068
|
+
};
|
|
1069
|
+
}
|
|
1070
|
+
case "plane": {
|
|
1071
|
+
const p = this.meshParameters;
|
|
1072
|
+
return {
|
|
1073
|
+
width: sanitize(p.width, MIN_DIM),
|
|
1074
|
+
height: sanitize(p.height, MIN_DIM)
|
|
1075
|
+
};
|
|
1076
|
+
}
|
|
1077
|
+
case "sphere": {
|
|
1078
|
+
const p = this.meshParameters;
|
|
1079
|
+
return { radius: sanitize(p.radius, MIN_RAD) };
|
|
1080
|
+
}
|
|
1081
|
+
case "cylinder":
|
|
1082
|
+
case "capsule": {
|
|
1083
|
+
const p = this.meshParameters;
|
|
1084
|
+
return {
|
|
1085
|
+
radius: sanitize(p.radius, MIN_RAD),
|
|
1086
|
+
height: sanitize(p.height, MIN_DIM)
|
|
1087
|
+
};
|
|
1088
|
+
}
|
|
1089
|
+
case "model":
|
|
1090
|
+
return DEFAULT_MESH_GEOMETRY_PARAMETERS.cube;
|
|
1091
|
+
}
|
|
1092
|
+
}
|
|
1093
|
+
};
|
|
1094
|
+
__name(_InstancedMeshComponent, "InstancedMeshComponent");
|
|
1095
|
+
var InstancedMeshComponent = _InstancedMeshComponent;
|
|
960
1096
|
|
|
961
1097
|
// core/components/Physics.ts
|
|
962
1098
|
var DEFAULT_RIGIDBODY_STATE = {
|
|
@@ -1216,15 +1352,15 @@ function createValueState(light) {
|
|
|
1216
1352
|
castShadow: light.castShadow ?? false,
|
|
1217
1353
|
frustumCulling: light.frustumCulled
|
|
1218
1354
|
};
|
|
1219
|
-
if (light instanceof
|
|
1355
|
+
if (light instanceof THREE5.PointLight) {
|
|
1220
1356
|
base.distance = light.distance;
|
|
1221
1357
|
base.decay = light.decay;
|
|
1222
|
-
} else if (light instanceof
|
|
1358
|
+
} else if (light instanceof THREE5.SpotLight) {
|
|
1223
1359
|
base.distance = light.distance;
|
|
1224
1360
|
base.decay = light.decay;
|
|
1225
1361
|
base.angle = light.angle;
|
|
1226
1362
|
base.penumbra = light.penumbra;
|
|
1227
|
-
} else if (light instanceof
|
|
1363
|
+
} else if (light instanceof THREE5.RectAreaLight) {
|
|
1228
1364
|
base.width = light.width;
|
|
1229
1365
|
base.height = light.height;
|
|
1230
1366
|
}
|
|
@@ -1259,13 +1395,13 @@ function toHexColor2(value, fallback) {
|
|
|
1259
1395
|
}
|
|
1260
1396
|
__name(toHexColor2, "toHexColor");
|
|
1261
1397
|
function getMaterialType(material) {
|
|
1262
|
-
if (material instanceof
|
|
1398
|
+
if (material instanceof THREE5.MeshPhysicalMaterial) {
|
|
1263
1399
|
return "physical";
|
|
1264
1400
|
}
|
|
1265
|
-
if (material instanceof
|
|
1401
|
+
if (material instanceof THREE5.MeshPhongMaterial) {
|
|
1266
1402
|
return "phong";
|
|
1267
1403
|
}
|
|
1268
|
-
if (material instanceof
|
|
1404
|
+
if (material instanceof THREE5.MeshBasicMaterial) {
|
|
1269
1405
|
return "basic";
|
|
1270
1406
|
}
|
|
1271
1407
|
return "standard";
|
|
@@ -1284,8 +1420,8 @@ function createMaterialValue(material) {
|
|
|
1284
1420
|
opacity: typeof materialRecord.opacity === "number" ? materialRecord.opacity : 1,
|
|
1285
1421
|
emissive: toHexColor2(materialRecord.emissive, "#000000"),
|
|
1286
1422
|
emissiveIntensity: typeof materialRecord.emissiveIntensity === "number" ? materialRecord.emissiveIntensity : 0,
|
|
1287
|
-
side: typeof materialRecord.side === "number" ? materialRecord.side :
|
|
1288
|
-
blending: typeof materialRecord.blending === "number" ? materialRecord.blending :
|
|
1423
|
+
side: typeof materialRecord.side === "number" ? materialRecord.side : THREE5.FrontSide,
|
|
1424
|
+
blending: typeof materialRecord.blending === "number" ? materialRecord.blending : THREE5.NormalBlending,
|
|
1289
1425
|
depthTest: materialRecord.depthTest !== false,
|
|
1290
1426
|
depthWrite: materialRecord.depthWrite !== false,
|
|
1291
1427
|
wireframe: Boolean(materialRecord.wireframe),
|
|
@@ -1301,7 +1437,7 @@ function createMaterialValue(material) {
|
|
|
1301
1437
|
displacementMap: materialRecord.displacementMap?.image?.src,
|
|
1302
1438
|
lightMap: materialRecord.lightMap?.image?.src,
|
|
1303
1439
|
envMap: materialRecord.envMap?.image?.src,
|
|
1304
|
-
textureFiltering: map?.magFilter ===
|
|
1440
|
+
textureFiltering: map?.magFilter === THREE5.NearestFilter ? "sharp" : "smooth",
|
|
1305
1441
|
useMipmaps: map?.generateMipmaps !== false
|
|
1306
1442
|
};
|
|
1307
1443
|
}
|
|
@@ -1316,8 +1452,8 @@ function defaultMaterialValue() {
|
|
|
1316
1452
|
opacity: 1,
|
|
1317
1453
|
emissive: "#000000",
|
|
1318
1454
|
emissiveIntensity: 0,
|
|
1319
|
-
side:
|
|
1320
|
-
blending:
|
|
1455
|
+
side: THREE5.FrontSide,
|
|
1456
|
+
blending: THREE5.NormalBlending,
|
|
1321
1457
|
depthTest: true,
|
|
1322
1458
|
depthWrite: true,
|
|
1323
1459
|
wireframe: false,
|
|
@@ -1387,70 +1523,6 @@ var _MeshComponent = class _MeshComponent extends Component {
|
|
|
1387
1523
|
};
|
|
1388
1524
|
__name(_MeshComponent, "MeshComponent");
|
|
1389
1525
|
var MeshComponent = _MeshComponent;
|
|
1390
|
-
var DEFAULT_MESH_GEOMETRY_PARAMETERS = {
|
|
1391
|
-
capsule: { radius: 0.5, height: 1 },
|
|
1392
|
-
cube: { width: 1, height: 1, depth: 1 },
|
|
1393
|
-
cylinder: { radius: 0.5, height: 1 },
|
|
1394
|
-
model: {},
|
|
1395
|
-
plane: { width: 100, height: 100 },
|
|
1396
|
-
sphere: { radius: 0.5 }
|
|
1397
|
-
};
|
|
1398
|
-
var GEOMETRY_TYPE_BY_KIND = {
|
|
1399
|
-
capsule: "CapsuleGeometry",
|
|
1400
|
-
cube: "BoxGeometry",
|
|
1401
|
-
cylinder: "CylinderGeometry",
|
|
1402
|
-
model: "Model",
|
|
1403
|
-
plane: "PlaneGeometry",
|
|
1404
|
-
sphere: "SphereGeometry"
|
|
1405
|
-
};
|
|
1406
|
-
var _MeshGeometryComponent = class _MeshGeometryComponent extends Component {
|
|
1407
|
-
constructor(kind, object, parameters, options) {
|
|
1408
|
-
super();
|
|
1409
|
-
this.kind = kind;
|
|
1410
|
-
this.geometryType = GEOMETRY_TYPE_BY_KIND[kind];
|
|
1411
|
-
this.object = object;
|
|
1412
|
-
this.modelName = options?.modelName ?? "";
|
|
1413
|
-
this.castShadow = options?.castShadow ?? false;
|
|
1414
|
-
this.receiveShadow = options?.receiveShadow ?? false;
|
|
1415
|
-
switch (kind) {
|
|
1416
|
-
case "cube":
|
|
1417
|
-
this.parameters = {
|
|
1418
|
-
...DEFAULT_MESH_GEOMETRY_PARAMETERS.cube,
|
|
1419
|
-
...parameters
|
|
1420
|
-
};
|
|
1421
|
-
break;
|
|
1422
|
-
case "plane":
|
|
1423
|
-
this.parameters = {
|
|
1424
|
-
...DEFAULT_MESH_GEOMETRY_PARAMETERS.plane,
|
|
1425
|
-
...parameters
|
|
1426
|
-
};
|
|
1427
|
-
break;
|
|
1428
|
-
case "sphere":
|
|
1429
|
-
this.parameters = {
|
|
1430
|
-
...DEFAULT_MESH_GEOMETRY_PARAMETERS.sphere,
|
|
1431
|
-
...parameters
|
|
1432
|
-
};
|
|
1433
|
-
break;
|
|
1434
|
-
case "cylinder":
|
|
1435
|
-
this.parameters = {
|
|
1436
|
-
...DEFAULT_MESH_GEOMETRY_PARAMETERS.cylinder,
|
|
1437
|
-
...parameters
|
|
1438
|
-
};
|
|
1439
|
-
break;
|
|
1440
|
-
case "capsule":
|
|
1441
|
-
this.parameters = {
|
|
1442
|
-
...DEFAULT_MESH_GEOMETRY_PARAMETERS.capsule,
|
|
1443
|
-
...parameters
|
|
1444
|
-
};
|
|
1445
|
-
break;
|
|
1446
|
-
case "model":
|
|
1447
|
-
this.parameters = {};
|
|
1448
|
-
break;
|
|
1449
|
-
}
|
|
1450
|
-
}
|
|
1451
|
-
};
|
|
1452
|
-
__name(_MeshGeometryComponent, "MeshGeometryComponent");
|
|
1453
|
-
var MeshGeometryComponent = _MeshGeometryComponent;
|
|
1454
1526
|
|
|
1455
1527
|
// core/components/Model.ts
|
|
1456
1528
|
var _ModelComponent = class _ModelComponent extends Component {
|
|
@@ -1717,6 +1789,6 @@ var _VideoComponent = class _VideoComponent extends Component {
|
|
|
1717
1789
|
__name(_VideoComponent, "VideoComponent");
|
|
1718
1790
|
var VideoComponent = _VideoComponent;
|
|
1719
1791
|
|
|
1720
|
-
export { AnimationComponent, AnimationStateMachine, AnimationStateManager, AudioComponent, CameraComponent, DEFAULT_COLLIDER_STATE, DEFAULT_ENVIRONMENT_STATE, DEFAULT_MESH_GEOMETRY_PARAMETERS, DEFAULT_PHYSICS_STATE, DEFAULT_POSTPROCESSING_STATE, DEFAULT_RIGIDBODY_STATE, EntityType, Environment, ImageComponent, ImageTarget, ImageTargetAnchor, LightComponent, MaterialComponent, MeshComponent, MeshGeometryComponent, ModelComponent, Name, Object3DRef, ParentId, PhysicsComponent, Postprocessing, ScriptComponent, Selectable, SelectionTransformState, SpriteComponent, TransformComponent, VideoComponent, components_exports, normalizePhysicsState };
|
|
1721
|
-
//# sourceMappingURL=chunk-
|
|
1722
|
-
//# sourceMappingURL=chunk-
|
|
1792
|
+
export { AnimationComponent, AnimationStateMachine, AnimationStateManager, AudioComponent, CameraComponent, DEFAULT_COLLIDER_STATE, DEFAULT_ENVIRONMENT_STATE, DEFAULT_INSTANCED_MESH_PARAMETERS, DEFAULT_INSTANCE_TRANSFORM, DEFAULT_MESH_GEOMETRY_PARAMETERS, DEFAULT_PHYSICS_STATE, DEFAULT_POSTPROCESSING_STATE, DEFAULT_RIGIDBODY_STATE, EntityType, Environment, ImageComponent, ImageTarget, ImageTargetAnchor, InstancedMeshComponent, LightComponent, MaterialComponent, MeshComponent, MeshGeometryComponent, ModelComponent, Name, Object3DRef, ParentId, PhysicsComponent, Postprocessing, ScriptComponent, Selectable, SelectionTransformState, SpriteComponent, TransformComponent, VideoComponent, components_exports, normalizePhysicsState };
|
|
1793
|
+
//# sourceMappingURL=chunk-R5D5PWXV.js.map
|
|
1794
|
+
//# sourceMappingURL=chunk-R5D5PWXV.js.map
|