This commit is contained in:
mige 2025-09-11 10:16:59 +04:00
parent f7d2ff07fd
commit 236479e5a8
2 changed files with 16 additions and 1 deletions

View File

@ -1,6 +1,6 @@
{
"name": "@openglobus/og",
"version": "0.27.8",
"version": "0.27.9",
"description": "[openglobus](https://www.openglobus.org/) is a javascript/typescript library designed to display interactive 3d maps and planets with map tiles, imagery and vector data, markers, and 3D objects. It uses the WebGL technology, open source, and completely free.",
"main": "lib/og.es.js",
"types": "lib/index.d.ts",

View File

@ -123,6 +123,21 @@ export class SimpleNavigation extends Control {
this.renderer.handler.canvas!.classList.add("ogGrabbingPoiner");
this._grabbedPoint = this.renderer.getCartesianFromPixel(e);
this._grabbedScreenPoint.set(e.nx, e.ny);
// let depth = this.renderer.getDepthMinDistance();
// console.log(depth);
if (!this._grabbedPoint) {
let cam = this.renderer.activeCamera;
let p0 = new Vec3(),
p1 = new Vec3(1, 0, 0),
p2 = new Vec3(0, 0, 1);
let px = new Vec3();
if (new Ray(cam.eye, e.direction).hitPlaneRes(Plane.fromPoints(p0, p1, p2), px) === Ray.INSIDE) {
this._grabbedPoint = px;
}
}
if (this._grabbedPoint) {
this._eye0.copy(this.renderer.activeCamera.eye);
}