@thatopen/components 2.0.0-alpha.17 → 2.0.0-alpha.18
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/core/OrthoPerspectiveCamera/index.d.ts +1 -0
- package/dist/index.cjs +5 -5
- package/dist/index.mjs +6 -11
- package/dist/namespace.d.ts +1513 -1512
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -6236,14 +6236,15 @@ class na extends ke {
|
|
|
6236
6236
|
I(this, "_userInputButtons", {});
|
|
6237
6237
|
I(this, "_frustumSize", 50);
|
|
6238
6238
|
I(this, "_navigationModes", /* @__PURE__ */ new Map());
|
|
6239
|
+
I(this, "previousSize", null);
|
|
6239
6240
|
this.threePersp = this.three, this.threeOrtho = this.newOrthoCamera(), this.projection = new Wr(this), this.onAspectUpdated.add(() => {
|
|
6240
6241
|
this.setOrthoPerspCameraAspect();
|
|
6241
6242
|
}), this.projection.onChanged.add(
|
|
6242
6243
|
(e) => {
|
|
6243
|
-
this.three = e;
|
|
6244
|
+
this.three = e, this.updateAspect();
|
|
6244
6245
|
}
|
|
6245
6246
|
), this.onWorldChanged.add(() => {
|
|
6246
|
-
this._navigationModes.clear(), this._navigationModes.set("Orbit", new Hr(this)), this._navigationModes.set("FirstPerson", new zr(this)), this._navigationModes.set("Plan", new kr(this)), this._mode = this._navigationModes.get("Orbit"), this.mode.set(!0, { preventTargetAdjustment: !0 });
|
|
6247
|
+
this._navigationModes.clear(), this._navigationModes.set("Orbit", new Hr(this)), this._navigationModes.set("FirstPerson", new zr(this)), this._navigationModes.set("Plan", new kr(this)), this._mode = this._navigationModes.get("Orbit"), this.mode.set(!0, { preventTargetAdjustment: !0 }), this.currentWorld && this.currentWorld.renderer && (this.previousSize = this.currentWorld.renderer.getSize().clone());
|
|
6247
6248
|
});
|
|
6248
6249
|
}
|
|
6249
6250
|
get mode() {
|
|
@@ -6315,16 +6316,10 @@ class na extends ke {
|
|
|
6315
6316
|
);
|
|
6316
6317
|
}
|
|
6317
6318
|
setOrthoPerspCameraAspect() {
|
|
6318
|
-
if (!this.currentWorld || !this.currentWorld.renderer)
|
|
6319
|
+
if (!this.currentWorld || !this.currentWorld.renderer || !this.previousSize)
|
|
6319
6320
|
return;
|
|
6320
|
-
const t = this.currentWorld.renderer.getSize();
|
|
6321
|
-
this.
|
|
6322
|
-
const e = new g.Vector3();
|
|
6323
|
-
this.threePersp.getWorldDirection(e);
|
|
6324
|
-
const i = new g.Vector3();
|
|
6325
|
-
this.controls.getTarget(i);
|
|
6326
|
-
const n = i.clone().sub(this.threePersp.position).dot(e), r = this.currentWorld.renderer.getSize(), a = r.x / r.y, l = this.threePersp, E = n * 2 * Math.atan(l.fov * (Math.PI / 180) / 2), d = E * a;
|
|
6327
|
-
this.threeOrtho.zoom = 1, this.threeOrtho.left = d / -2, this.threeOrtho.right = d / 2, this.threeOrtho.top = E / 2, this.threeOrtho.bottom = E / -2, this.threeOrtho.updateProjectionMatrix();
|
|
6321
|
+
const t = this.currentWorld.renderer.getSize(), e = this.threeOrtho.top, i = this.threeOrtho.right, o = t.y / this.previousSize.y, n = t.x / this.previousSize.x, r = e * o, a = i * n;
|
|
6322
|
+
this.threeOrtho.left = -a, this.threeOrtho.right = a, this.threeOrtho.top = r, this.threeOrtho.bottom = -r, this.threeOrtho.updateProjectionMatrix(), this.previousSize.copy(t);
|
|
6328
6323
|
}
|
|
6329
6324
|
}
|
|
6330
6325
|
const At = class At extends J {
|