minerender 2.1.0-alpha.13 → 2.1.0-alpha.15

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.
@@ -14,7 +14,7 @@ interface AnimatorFunction {
14
14
  }
15
15
 
16
16
  declare enum Axis {
17
- X = "X",
17
+ X = "x",
18
18
  Y = "y",
19
19
  Z = "z"
20
20
  }
@@ -14,7 +14,7 @@ interface AnimatorFunction {
14
14
  }
15
15
 
16
16
  declare enum Axis {
17
- X = "X",
17
+ X = "x",
18
18
  Y = "y",
19
19
  Z = "z"
20
20
  }
@@ -434,7 +434,7 @@ registerBrowserEnv();
434
434
  // src/Axis.ts
435
435
  var import_three = require("three");
436
436
  var Axis = /* @__PURE__ */ ((Axis3) => {
437
- Axis3["X"] = "X";
437
+ Axis3["X"] = "x";
438
438
  Axis3["Y"] = "y";
439
439
  Axis3["Z"] = "z";
440
440
  return Axis3;
@@ -442,7 +442,7 @@ var Axis = /* @__PURE__ */ ((Axis3) => {
442
442
  var AXES = Object.values(Axis);
443
443
  function axisToVec3(axis) {
444
444
  switch (axis) {
445
- case "X" /* X */:
445
+ case "x" /* X */:
446
446
  return new import_three.Vector3(1, 0, 0);
447
447
  case "y" /* Y */:
448
448
  return new import_three.Vector3(0, 1, 0);
@@ -1332,9 +1332,9 @@ var ModelMerger = class {
1332
1332
  const models = await this.collectAllParents(model);
1333
1333
  let merged = {};
1334
1334
  for (let parentModel of models) {
1335
- merged = (0, import_ts_deepmerge.default)(merged, parentModel);
1335
+ merged = import_ts_deepmerge.default.withOptions({ mergeArrays: false }, merged, parentModel);
1336
1336
  }
1337
- merged = (0, import_ts_deepmerge.default)(merged, model);
1337
+ merged = import_ts_deepmerge.default.withOptions({ mergeArrays: false }, merged, model);
1338
1338
  merged.hierarchy = models.map((m) => m.parent).filter((p12) => `${p12}`);
1339
1339
  merged.hierarchy.push(`${merged.parent}`);
1340
1340
  return merged;
@@ -1594,7 +1594,7 @@ function applyElementRotation(rotation, geometry) {
1594
1594
  const origin = new import_three7.Vector3(rotation.origin[0], rotation.origin[1], rotation.origin[2]);
1595
1595
  geometry.translate(-origin.x, -origin.y, -origin.z);
1596
1596
  switch (rotation.axis) {
1597
- case "X" /* X */:
1597
+ case "x" /* X */:
1598
1598
  geometry.rotateX(toRadians(rotation.angle));
1599
1599
  break;
1600
1600
  case "y" /* Y */:
@@ -1625,7 +1625,7 @@ function applyModelPartRotation(modelPart, geometry) {
1625
1625
  }
1626
1626
  function applyGenericRotation(axis, rotation, obj) {
1627
1627
  switch (axis) {
1628
- case "X" /* X */:
1628
+ case "x" /* X */:
1629
1629
  obj.rotateOnAxis(new import_three7.Vector3(1, 0, 0), toRadians(rotation));
1630
1630
  break;
1631
1631
  case "y" /* Y */:
@@ -2503,17 +2503,13 @@ var UVMapper = class {
2503
2503
  this.setCubeFaceUvInArray(uv, faceIndex * 4, [0, 1, 8 / size, (size - 8) / size]);
2504
2504
  continue;
2505
2505
  }
2506
+ if (!face.texture) continue;
2506
2507
  if (!face.uv) {
2507
2508
  face.uv = this.getFallbackUv(element, faceName);
2508
2509
  }
2509
- let faceTexture = face.texture;
2510
- let texPosition;
2511
- let texSize;
2512
- if (faceTexture) {
2513
- faceTexture = faceTexture.substr(1);
2514
- texPosition = positions[faceTexture] || [0, 0];
2515
- texSize = sizes[faceTexture] || [16, 16];
2516
- }
2510
+ const faceTexture = face.texture.substr(1);
2511
+ const texPosition = positions[faceTexture] || [0, 0];
2512
+ const texSize = sizes[faceTexture] || [16, 16];
2517
2513
  let texPosV = new import_three8.Vector2(texPosition[0], texPosition[1]);
2518
2514
  const [tl, tr, bl, br] = this.expandAndRotateMcUvs(face.uv, face.rotation, texSize[0], texSize[1]);
2519
2515
  tl.add(texPosV);
@@ -4569,9 +4565,6 @@ var _BlockObject = class _BlockObject extends SceneObject {
4569
4565
  }
4570
4566
  }
4571
4567
  obj.setRotation(rotation);
4572
- setTimeout(() => {
4573
- obj.setRotation(rotation);
4574
- }, 150);
4575
4568
  console.log(obj);
4576
4569
  return obj;
4577
4570
  }
@@ -4662,10 +4655,11 @@ var _BlockObject = class _BlockObject extends SceneObject {
4662
4655
  }
4663
4656
  }
4664
4657
  setPosition(position) {
4665
- super.setPosition(position);
4658
+ this.position.copy(position);
4666
4659
  for (let model of this._models) {
4667
4660
  model.setPosition(position);
4668
4661
  }
4662
+ this.notifyDirty();
4669
4663
  }
4670
4664
  //TODO: should override rotation + scale methods
4671
4665
  //TODO