@openglobus/openglobus-react 0.4.2 → 0.4.3
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/index.js +20 -15
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +2 -2
- package/dist/index.umd.cjs.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -10094,7 +10094,7 @@ const dc = ["viewchange", "moveend", "flystart", "flyend", "flystop"], Po = cc.C
|
|
|
10094
10094
|
s.cameraFrustumIndex = this.frustums.length, this.frustums.push(s), this.frustumColors.push(s._pickingColorU[0], s._pickingColorU[1], s._pickingColorU[2]);
|
|
10095
10095
|
}
|
|
10096
10096
|
else {
|
|
10097
|
-
let t =
|
|
10097
|
+
let t = 1, i = 500, r = new an({ fov: this._viewAngle, aspect: this.getAspectRatio(), near: t, far: i });
|
|
10098
10098
|
r.cameraFrustumIndex = this.frustums.length, this.frustums.push(r), this.frustumColors.push(r._pickingColorU[0], r._pickingColorU[1], r._pickingColorU[2]);
|
|
10099
10099
|
}
|
|
10100
10100
|
this.FARTHEST_FRUSTUM_INDEX = this.frustums.length - 1, this.currentFrustumIndex = 0, this.frustumColorIndex = 0, this.isFirstPass = !1, this._projSizeConst = 0, this.set(e.eye || new m(0, 0, 1), e.look || new m(), e.up || new m(0, 1, 0));
|
|
@@ -12189,7 +12189,7 @@ Object.freeze(Object.defineProperty({ __proto__: null, AtmosphereConfig: class e
|
|
|
12189
12189
|
}
|
|
12190
12190
|
}, SimpleNavigation: class extends J {
|
|
12191
12191
|
constructor(o = {}) {
|
|
12192
|
-
super({ name: "SimpleNavigation", autoActivate: !0, ...o }), this._onMouseLeftButtonDown = (e) => {
|
|
12192
|
+
super({ name: "SimpleNavigation", autoActivate: !0, ...o }), this._wheelDelta = 0, this._nx = 0, this._ny = 0, this._onMouseLeftButtonDown = (e) => {
|
|
12193
12193
|
this._active && this.renderer && (this.renderer.handler.canvas.classList.add("ogGrabbingPoiner"), this._grabbedPoint = this.renderer.getCartesianFromPixel(e), this._grabbedScreenPoint.set(e.nx, e.ny), this._grabbedPoint && this._eye0.copy(this.renderer.activeCamera.eye));
|
|
12194
12194
|
}, this._onMouseLeftButtonUp = (e) => {
|
|
12195
12195
|
this.renderer.handler.canvas.classList.remove("ogGrabbingPoiner"), e.x === e.prev_x && (e.y, e.prev_y);
|
|
@@ -12226,12 +12226,18 @@ Object.freeze(Object.defineProperty({ __proto__: null, AtmosphereConfig: class e
|
|
|
12226
12226
|
let t = this.renderer.activeCamera, i = this.renderer.getCartesianFromPixel(e);
|
|
12227
12227
|
if (!i) {
|
|
12228
12228
|
i = new m();
|
|
12229
|
-
let
|
|
12230
|
-
new H(t.eye, e.direction).hitPlaneRes(
|
|
12229
|
+
let r = new we(m.ZERO, m.UP);
|
|
12230
|
+
new H(t.eye, e.direction).hitPlaneRes(r, i);
|
|
12231
|
+
}
|
|
12232
|
+
if (this._wheelPos.copy(i), t.isOrthographic) {
|
|
12233
|
+
if (this._wheelDist = this.renderer.getDistanceFromPixel(e.pos) || 0, !this._wheelDist) return;
|
|
12234
|
+
this._wheelDelta = e.wheelDelta, this._nx = e.nx, this._ny = e.ny;
|
|
12235
|
+
let r = i.sub(t.eye).normalize(), s = 8 * t.eye.distance(i);
|
|
12236
|
+
this.force.addA(r.scale(e.wheelDelta)).normalize().scale(s);
|
|
12237
|
+
} else {
|
|
12238
|
+
let r = i.sub(t.eye).normalize(), s = 8 * t.eye.distance(i);
|
|
12239
|
+
this.force.addA(r.scale(e.wheelDelta)).normalize().scale(s);
|
|
12231
12240
|
}
|
|
12232
|
-
this._wheelPos.copy(i);
|
|
12233
|
-
let r = i.sub(t.eye).normalize(), s = 8 * t.eye.distance(i);
|
|
12234
|
-
this.force.addA(r.scale(e.wheelDelta)).normalize().scale(s);
|
|
12235
12241
|
}
|
|
12236
12242
|
}, this.onCameraMoveForward = () => {
|
|
12237
12243
|
this.force.addA(this.renderer.activeCamera.getForward()).normalize();
|
|
@@ -12253,7 +12259,7 @@ Object.freeze(Object.defineProperty({ __proto__: null, AtmosphereConfig: class e
|
|
|
12253
12259
|
this.renderer.activeCamera.update();
|
|
12254
12260
|
}, this.onCameraRollRight = () => {
|
|
12255
12261
|
this.renderer.activeCamera.update();
|
|
12256
|
-
}, this.speed = o.speed || 1, this.force = new m(), this.vel = new m(), this.mass = 1, this._lookPos = void 0, this._grabbedPoint = void 0, this._grabbedScreenPoint = new N(), this._up = null, this._eye0 = new m(), this._wheelPos = new m();
|
|
12262
|
+
}, this.speed = o.speed || 1, this.force = new m(), this.vel = new m(), this.mass = 1, this._lookPos = void 0, this._grabbedPoint = void 0, this._grabbedScreenPoint = new N(), this._up = null, this._eye0 = new m(), this._wheelDist = 0, this._wheelPos = new m();
|
|
12257
12263
|
}
|
|
12258
12264
|
oninit() {
|
|
12259
12265
|
}
|
|
@@ -12270,13 +12276,12 @@ Object.freeze(Object.defineProperty({ __proto__: null, AtmosphereConfig: class e
|
|
|
12270
12276
|
o.events.off("mousewheel", this._onMouseWheel), o.events.off("keypress", W.KEY_W, this.onCameraMoveForward), o.events.off("keypress", W.KEY_S, this.onCameraMoveBackward), o.events.off("keypress", W.KEY_A, this.onCameraStrifeLeft), o.events.off("keypress", W.KEY_D, this.onCameraStrifeRight), o.events.off("keypress", W.KEY_UP, this.onCameraLookUp), o.events.off("keypress", W.KEY_DOWN, this.onCameraLookDown), o.events.off("keypress", W.KEY_LEFT, this.onCameraTurnLeft), o.events.off("keypress", W.KEY_RIGHT, this.onCameraTurnRight), o.events.off("keypress", W.KEY_Q, this.onCameraRollLeft), o.events.off("keypress", W.KEY_E, this.onCameraRollRight), o.events.off("rhold", this._onRHold), o.events.off("rdown", this._onRDown), o.events.off("lhold", this._onMouseLeftButtonHold), o.events.off("ldown", this._onMouseLeftButtonDown), o.events.off("lup", this._onMouseLeftButtonUp), o.events.off("draw", this.onDraw);
|
|
12271
12277
|
}
|
|
12272
12278
|
_handleMouseWheel() {
|
|
12273
|
-
let o = this.renderer.activeCamera
|
|
12274
|
-
if (o.
|
|
12275
|
-
|
|
12276
|
-
o.
|
|
12277
|
-
|
|
12278
|
-
|
|
12279
|
-
}
|
|
12279
|
+
let o = this.renderer.activeCamera;
|
|
12280
|
+
if (o.isOrthographic) {
|
|
12281
|
+
o.eye = this._wheelPos.add(o.getBackward().scale(this._wheelDist)), o.focusDistance -= o.focusDistance * this.vel.scaleTo(this.dt).length() * 5e-5 * this._wheelDelta;
|
|
12282
|
+
let e = o.frustums[0], t = (e.right - e.left) * (0.5 - this._nx), i = -(e.top - e.bottom) * (0.5 - this._ny), r = o.getUp().scale(i), s = o.getRight().scale(t);
|
|
12283
|
+
o.eye.addA(s.add(r));
|
|
12284
|
+
} else o.eye = o.eye.add(this.vel.scaleTo(this.dt));
|
|
12280
12285
|
o.update();
|
|
12281
12286
|
}
|
|
12282
12287
|
onDraw() {
|