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.
- package/dist/browser/index.d.mts +1 -1
- package/dist/browser/index.d.ts +1 -1
- package/dist/browser/index.js +12 -18
- package/dist/browser/index.js.map +1 -1
- package/dist/browser/index.mjs +12 -18
- package/dist/browser/index.mjs.map +1 -1
- package/dist/bundle.js +12 -18
- package/dist/bundle.js.map +1 -1
- package/dist/node/index.d.mts +1 -1
- package/dist/node/index.d.ts +1 -1
- package/dist/node/index.js +12 -18
- package/dist/node/index.js.map +1 -1
- package/dist/node/index.mjs +12 -18
- package/dist/node/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/node/index.d.mts
CHANGED
package/dist/node/index.d.ts
CHANGED
package/dist/node/index.js
CHANGED
|
@@ -396,7 +396,7 @@ registerNodeEnv();
|
|
|
396
396
|
// src/Axis.ts
|
|
397
397
|
var import_three = require("three");
|
|
398
398
|
var Axis = /* @__PURE__ */ ((Axis3) => {
|
|
399
|
-
Axis3["X"] = "
|
|
399
|
+
Axis3["X"] = "x";
|
|
400
400
|
Axis3["Y"] = "y";
|
|
401
401
|
Axis3["Z"] = "z";
|
|
402
402
|
return Axis3;
|
|
@@ -404,7 +404,7 @@ var Axis = /* @__PURE__ */ ((Axis3) => {
|
|
|
404
404
|
var AXES = Object.values(Axis);
|
|
405
405
|
function axisToVec3(axis) {
|
|
406
406
|
switch (axis) {
|
|
407
|
-
case "
|
|
407
|
+
case "x" /* X */:
|
|
408
408
|
return new import_three.Vector3(1, 0, 0);
|
|
409
409
|
case "y" /* Y */:
|
|
410
410
|
return new import_three.Vector3(0, 1, 0);
|
|
@@ -1334,9 +1334,9 @@ var ModelMerger = class {
|
|
|
1334
1334
|
const models = await this.collectAllParents(model);
|
|
1335
1335
|
let merged = {};
|
|
1336
1336
|
for (let parentModel of models) {
|
|
1337
|
-
merged =
|
|
1337
|
+
merged = import_ts_deepmerge.default.withOptions({ mergeArrays: false }, merged, parentModel);
|
|
1338
1338
|
}
|
|
1339
|
-
merged =
|
|
1339
|
+
merged = import_ts_deepmerge.default.withOptions({ mergeArrays: false }, merged, model);
|
|
1340
1340
|
merged.hierarchy = models.map((m) => m.parent).filter((p12) => `${p12}`);
|
|
1341
1341
|
merged.hierarchy.push(`${merged.parent}`);
|
|
1342
1342
|
return merged;
|
|
@@ -1596,7 +1596,7 @@ function applyElementRotation(rotation, geometry) {
|
|
|
1596
1596
|
const origin = new import_three7.Vector3(rotation.origin[0], rotation.origin[1], rotation.origin[2]);
|
|
1597
1597
|
geometry.translate(-origin.x, -origin.y, -origin.z);
|
|
1598
1598
|
switch (rotation.axis) {
|
|
1599
|
-
case "
|
|
1599
|
+
case "x" /* X */:
|
|
1600
1600
|
geometry.rotateX(toRadians(rotation.angle));
|
|
1601
1601
|
break;
|
|
1602
1602
|
case "y" /* Y */:
|
|
@@ -1627,7 +1627,7 @@ function applyModelPartRotation(modelPart, geometry) {
|
|
|
1627
1627
|
}
|
|
1628
1628
|
function applyGenericRotation(axis, rotation, obj) {
|
|
1629
1629
|
switch (axis) {
|
|
1630
|
-
case "
|
|
1630
|
+
case "x" /* X */:
|
|
1631
1631
|
obj.rotateOnAxis(new import_three7.Vector3(1, 0, 0), toRadians(rotation));
|
|
1632
1632
|
break;
|
|
1633
1633
|
case "y" /* Y */:
|
|
@@ -2540,17 +2540,13 @@ var UVMapper = class {
|
|
|
2540
2540
|
this.setCubeFaceUvInArray(uv, faceIndex * 4, [0, 1, 8 / size, (size - 8) / size]);
|
|
2541
2541
|
continue;
|
|
2542
2542
|
}
|
|
2543
|
+
if (!face.texture) continue;
|
|
2543
2544
|
if (!face.uv) {
|
|
2544
2545
|
face.uv = this.getFallbackUv(element, faceName);
|
|
2545
2546
|
}
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
if (faceTexture) {
|
|
2550
|
-
faceTexture = faceTexture.substr(1);
|
|
2551
|
-
texPosition = positions[faceTexture] || [0, 0];
|
|
2552
|
-
texSize = sizes[faceTexture] || [16, 16];
|
|
2553
|
-
}
|
|
2547
|
+
const faceTexture = face.texture.substr(1);
|
|
2548
|
+
const texPosition = positions[faceTexture] || [0, 0];
|
|
2549
|
+
const texSize = sizes[faceTexture] || [16, 16];
|
|
2554
2550
|
let texPosV = new import_three8.Vector2(texPosition[0], texPosition[1]);
|
|
2555
2551
|
const [tl, tr, bl, br] = this.expandAndRotateMcUvs(face.uv, face.rotation, texSize[0], texSize[1]);
|
|
2556
2552
|
tl.add(texPosV);
|
|
@@ -4615,9 +4611,6 @@ var BlockObject = class _BlockObject extends SceneObject {
|
|
|
4615
4611
|
}
|
|
4616
4612
|
}
|
|
4617
4613
|
obj.setRotation(rotation);
|
|
4618
|
-
setTimeout(() => {
|
|
4619
|
-
obj.setRotation(rotation);
|
|
4620
|
-
}, 150);
|
|
4621
4614
|
console.log(obj);
|
|
4622
4615
|
return obj;
|
|
4623
4616
|
}
|
|
@@ -4708,10 +4701,11 @@ var BlockObject = class _BlockObject extends SceneObject {
|
|
|
4708
4701
|
}
|
|
4709
4702
|
}
|
|
4710
4703
|
setPosition(position) {
|
|
4711
|
-
|
|
4704
|
+
this.position.copy(position);
|
|
4712
4705
|
for (let model of this._models) {
|
|
4713
4706
|
model.setPosition(position);
|
|
4714
4707
|
}
|
|
4708
|
+
this.notifyDirty();
|
|
4715
4709
|
}
|
|
4716
4710
|
//TODO: should override rotation + scale methods
|
|
4717
4711
|
//TODO
|