@mcolabs/threebox-plugin 4.0.2 → 4.0.4
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/threebox.cjs +1 -1
- package/dist/threebox.cjs.map +1 -1
- package/dist/threebox.iife.js +1 -1
- package/dist/threebox.iife.js.map +1 -1
- package/dist/threebox.js +9 -1
- package/dist/threebox.js.map +1 -1
- package/package.json +1 -1
- package/src/animation/AnimationManager.js +0 -1
- package/src/camera/CameraSync.js +13 -2
package/dist/threebox.js
CHANGED
|
@@ -473,6 +473,14 @@ CameraSync.prototype = {
|
|
|
473
473
|
}
|
|
474
474
|
const t = this.map.transform;
|
|
475
475
|
this.camera.aspect = t.width / t.height;
|
|
476
|
+
if (this.map.tb && this.map.tb.renderer) {
|
|
477
|
+
const canvas = this.map.getCanvas();
|
|
478
|
+
if (this._lastCanvasWidth !== canvas.clientWidth || this._lastCanvasHeight !== canvas.clientHeight) {
|
|
479
|
+
this._lastCanvasWidth = canvas.clientWidth;
|
|
480
|
+
this._lastCanvasHeight = canvas.clientHeight;
|
|
481
|
+
this.map.tb.renderer.setSize(canvas.clientWidth, canvas.clientHeight);
|
|
482
|
+
}
|
|
483
|
+
}
|
|
476
484
|
const offset = t.centerOffset || new THREE.Vector3();
|
|
477
485
|
let farZ = 0;
|
|
478
486
|
let furthestDistance = 0;
|
|
@@ -508,6 +516,7 @@ CameraSync.prototype = {
|
|
|
508
516
|
}
|
|
509
517
|
this.camera.projectionMatrix.elements[8] = -offset.x * 2 / t.width;
|
|
510
518
|
this.camera.projectionMatrix.elements[9] = offset.y * 2 / t.height;
|
|
519
|
+
this.camera.projectionMatrixInverse.copy(this.camera.projectionMatrix).invert();
|
|
511
520
|
let cameraWorldMatrix = this.calcCameraMatrix(t._pitch, t.angle);
|
|
512
521
|
if (t.elevation) cameraWorldMatrix.elements[14] = t._camera.position[2] * worldSize;
|
|
513
522
|
this.camera.matrixWorld.copy(cameraWorldMatrix);
|
|
@@ -1113,7 +1122,6 @@ AnimationManager.prototype = {
|
|
|
1113
1122
|
if (item.type === "playDefault") {
|
|
1114
1123
|
object.activateAllActions();
|
|
1115
1124
|
object.isPlaying = true;
|
|
1116
|
-
object.animationMethod = requestAnimationFrame(this.update);
|
|
1117
1125
|
object.mixer.update(object.clock.getDelta());
|
|
1118
1126
|
object.threebox.map.repaint = true;
|
|
1119
1127
|
}
|