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.mjs
CHANGED
|
@@ -241,7 +241,7 @@ registerNodeEnv();
|
|
|
241
241
|
// src/Axis.ts
|
|
242
242
|
import { Vector3 } from "three";
|
|
243
243
|
var Axis = /* @__PURE__ */ ((Axis3) => {
|
|
244
|
-
Axis3["X"] = "
|
|
244
|
+
Axis3["X"] = "x";
|
|
245
245
|
Axis3["Y"] = "y";
|
|
246
246
|
Axis3["Z"] = "z";
|
|
247
247
|
return Axis3;
|
|
@@ -249,7 +249,7 @@ var Axis = /* @__PURE__ */ ((Axis3) => {
|
|
|
249
249
|
var AXES = Object.values(Axis);
|
|
250
250
|
function axisToVec3(axis) {
|
|
251
251
|
switch (axis) {
|
|
252
|
-
case "
|
|
252
|
+
case "x" /* X */:
|
|
253
253
|
return new Vector3(1, 0, 0);
|
|
254
254
|
case "y" /* Y */:
|
|
255
255
|
return new Vector3(0, 1, 0);
|
|
@@ -1179,9 +1179,9 @@ var ModelMerger = class {
|
|
|
1179
1179
|
const models = await this.collectAllParents(model);
|
|
1180
1180
|
let merged = {};
|
|
1181
1181
|
for (let parentModel of models) {
|
|
1182
|
-
merged =
|
|
1182
|
+
merged = import_ts_deepmerge.default.withOptions({ mergeArrays: false }, merged, parentModel);
|
|
1183
1183
|
}
|
|
1184
|
-
merged =
|
|
1184
|
+
merged = import_ts_deepmerge.default.withOptions({ mergeArrays: false }, merged, model);
|
|
1185
1185
|
merged.hierarchy = models.map((m) => m.parent).filter((p12) => `${p12}`);
|
|
1186
1186
|
merged.hierarchy.push(`${merged.parent}`);
|
|
1187
1187
|
return merged;
|
|
@@ -1441,7 +1441,7 @@ function applyElementRotation(rotation, geometry) {
|
|
|
1441
1441
|
const origin = new Vector32(rotation.origin[0], rotation.origin[1], rotation.origin[2]);
|
|
1442
1442
|
geometry.translate(-origin.x, -origin.y, -origin.z);
|
|
1443
1443
|
switch (rotation.axis) {
|
|
1444
|
-
case "
|
|
1444
|
+
case "x" /* X */:
|
|
1445
1445
|
geometry.rotateX(toRadians(rotation.angle));
|
|
1446
1446
|
break;
|
|
1447
1447
|
case "y" /* Y */:
|
|
@@ -1472,7 +1472,7 @@ function applyModelPartRotation(modelPart, geometry) {
|
|
|
1472
1472
|
}
|
|
1473
1473
|
function applyGenericRotation(axis, rotation, obj) {
|
|
1474
1474
|
switch (axis) {
|
|
1475
|
-
case "
|
|
1475
|
+
case "x" /* X */:
|
|
1476
1476
|
obj.rotateOnAxis(new Vector32(1, 0, 0), toRadians(rotation));
|
|
1477
1477
|
break;
|
|
1478
1478
|
case "y" /* Y */:
|
|
@@ -2385,17 +2385,13 @@ var UVMapper = class {
|
|
|
2385
2385
|
this.setCubeFaceUvInArray(uv, faceIndex * 4, [0, 1, 8 / size, (size - 8) / size]);
|
|
2386
2386
|
continue;
|
|
2387
2387
|
}
|
|
2388
|
+
if (!face.texture) continue;
|
|
2388
2389
|
if (!face.uv) {
|
|
2389
2390
|
face.uv = this.getFallbackUv(element, faceName);
|
|
2390
2391
|
}
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
if (faceTexture) {
|
|
2395
|
-
faceTexture = faceTexture.substr(1);
|
|
2396
|
-
texPosition = positions[faceTexture] || [0, 0];
|
|
2397
|
-
texSize = sizes[faceTexture] || [16, 16];
|
|
2398
|
-
}
|
|
2392
|
+
const faceTexture = face.texture.substr(1);
|
|
2393
|
+
const texPosition = positions[faceTexture] || [0, 0];
|
|
2394
|
+
const texSize = sizes[faceTexture] || [16, 16];
|
|
2399
2395
|
let texPosV = new Vector2(texPosition[0], texPosition[1]);
|
|
2400
2396
|
const [tl, tr, bl, br] = this.expandAndRotateMcUvs(face.uv, face.rotation, texSize[0], texSize[1]);
|
|
2401
2397
|
tl.add(texPosV);
|
|
@@ -4470,9 +4466,6 @@ var BlockObject = class _BlockObject extends SceneObject {
|
|
|
4470
4466
|
}
|
|
4471
4467
|
}
|
|
4472
4468
|
obj.setRotation(rotation);
|
|
4473
|
-
setTimeout(() => {
|
|
4474
|
-
obj.setRotation(rotation);
|
|
4475
|
-
}, 150);
|
|
4476
4469
|
console.log(obj);
|
|
4477
4470
|
return obj;
|
|
4478
4471
|
}
|
|
@@ -4563,10 +4556,11 @@ var BlockObject = class _BlockObject extends SceneObject {
|
|
|
4563
4556
|
}
|
|
4564
4557
|
}
|
|
4565
4558
|
setPosition(position) {
|
|
4566
|
-
|
|
4559
|
+
this.position.copy(position);
|
|
4567
4560
|
for (let model of this._models) {
|
|
4568
4561
|
model.setPosition(position);
|
|
4569
4562
|
}
|
|
4563
|
+
this.notifyDirty();
|
|
4570
4564
|
}
|
|
4571
4565
|
//TODO: should override rotation + scale methods
|
|
4572
4566
|
//TODO
|