mirror of
https://github.com/openglobus/openglobus.git
synced 2025-12-08 19:25:27 +00:00
Wip.1
This commit is contained in:
parent
e2371242a8
commit
b8ce8dfb48
@ -281,18 +281,28 @@ class Node {
|
||||
let h = Math.abs(cam._lonLat.height);
|
||||
|
||||
let horizonDist = cam.eye.length2() - planet.ellipsoid.polarSizeSqr;
|
||||
horizonDist = horizonDist < 106876472875.63281 * planet._heightFactor ? 106876472875.63281 * planet._heightFactor : horizonDist;
|
||||
let maxDist = 106876472875.63281 * planet._heightFactor;
|
||||
horizonDist = horizonDist < maxDist ? maxDist : horizonDist;
|
||||
|
||||
let altVis = seg.tileZoom < 2 || seg.tileZoom > 19 ||
|
||||
/* Could be replaced with camera frustum always looking down check,
|
||||
and not to go through nodes from the opposite of the globe*/
|
||||
(seg.tileZoom < 6 && !seg.terrainReady);
|
||||
|
||||
altVis = altVis ||
|
||||
cam.eye.distance2(seg._sw) < horizonDist ||
|
||||
cam.eye.distance2(seg._nw) < horizonDist ||
|
||||
cam.eye.distance2(seg._ne) < horizonDist ||
|
||||
cam.eye.distance2(seg._se) < horizonDist;
|
||||
if (cam.isOrthographic) {
|
||||
let f = cam.getForward();
|
||||
altVis = altVis ||
|
||||
f.dot(seg._sw.getNormal()) < -0 ||
|
||||
f.dot(seg._nw.getNormal()) < -0 ||
|
||||
f.dot(seg._ne.getNormal()) < -0 ||
|
||||
f.dot(seg._se.getNormal()) < -0;
|
||||
} else {
|
||||
altVis = altVis ||
|
||||
cam.eye.distance2(seg._sw) < horizonDist ||
|
||||
cam.eye.distance2(seg._nw) < horizonDist ||
|
||||
cam.eye.distance2(seg._ne) < horizonDist ||
|
||||
cam.eye.distance2(seg._se) < horizonDist;
|
||||
}
|
||||
|
||||
if ((this.inFrustum && (altVis || h > 10000.0)) || this._cameraInside) {
|
||||
this.quadTreeStrategy.collectVisibleNode(this);
|
||||
|
||||
@ -250,7 +250,7 @@ export class QuadTreeStrategy {
|
||||
this._renderedNodes = [];
|
||||
}
|
||||
|
||||
protected _clearRenderNodesInFrustum() {
|
||||
protected _clearRenderNodesInFrustum() {1
|
||||
for (let i = 0, len = this._renderedNodesInFrustum.length; i < len; i++) {
|
||||
this._renderedNodesInFrustum[i].length = 0;
|
||||
this._renderedNodesInFrustum[i] = [];
|
||||
@ -258,7 +258,7 @@ export class QuadTreeStrategy {
|
||||
}
|
||||
|
||||
protected _collectRenderedNodesMaxZoom(cam: PlanetCamera) {
|
||||
if (cam.slope > this.minEqualZoomCameraSlope && cam._lonLat.height < this.maxEqualZoomAltitude && cam._lonLat.height > this.minEqualZoomAltitude) {
|
||||
if (cam.isOrthographic || cam.slope > this.minEqualZoomCameraSlope && cam._lonLat.height < this.maxEqualZoomAltitude && cam._lonLat.height > this.minEqualZoomAltitude) {
|
||||
|
||||
this.minCurrZoom = this.maxCurrZoom;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user