|
@@ -18972,7 +18972,7 @@
|
|
|
constructor() {
|
|
|
super();
|
|
|
delete this.sceneBG;
|
|
|
- this.cameraP = new PerspectiveCamera(this.fov, 1, Potree.config.view.near, Potree.config.view.near);
|
|
|
+ this.cameraP = new PerspectiveCamera(this.fov, 1, Potree.config.view.near, Potree.config.view.cameraFar);
|
|
|
this.cameraO = new OrthographicCamera(-1, 1, 1, -1, Potree.config.view.near, Potree.settings.cameraFar);
|
|
|
this.cameraP.limitFar = true; //add
|
|
|
this.initializeExtend();
|
|
@@ -22206,7 +22206,8 @@
|
|
|
view: {
|
|
|
fov: 70,
|
|
|
//navvis:50
|
|
|
- near: 0.1,
|
|
|
+ near: 0.05,
|
|
|
+ // too small will result in z-fighting
|
|
|
far: 10000
|
|
|
},
|
|
|
map: {
|
|
@@ -36099,7 +36100,7 @@
|
|
|
var str = this.temp.pointSize + ':' + this.maxLevel + ':' + nodeMaxLevel;
|
|
|
var value = this.temp.sizeFitToLevel[str]; //储存。防止每次渲染(反复切换density)都要算。
|
|
|
if (value) {
|
|
|
- size = value;
|
|
|
+ size = value *= this.scale.x;
|
|
|
} else {
|
|
|
if (this.maxLevel == Infinity) return;
|
|
|
var base = this.material.spacing / Math.pow(2, this.maxLevel); //点云大小在level为0时设置为spacing,每长一级,大小就除以2. (不同场景还是会有偏差)
|
|
@@ -68615,8 +68616,6 @@
|
|
|
//Potree.Utils.updateVisible(viewer.reticule, 'force', false)
|
|
|
viewer.composer.scaleRatio = 1;
|
|
|
viewer.composer.readTarget = false;
|
|
|
- viewer.mainViewport.camera.near = 0.05; // too small will result in z-fighting
|
|
|
-
|
|
|
viewer.addEventListener('updateModelBound', e => {
|
|
|
if (this.split) {
|
|
|
this.SplitScreen.updateCameraOutOfModel( /* this.selected && [this.selected] */);
|
|
@@ -76186,7 +76185,12 @@
|
|
|
var scroll = e => {
|
|
|
if (!this.enabled) return;
|
|
|
var resolvedRadius = this.currentViewport.view.radius + this.radiusDelta;
|
|
|
- if (resolvedRadius < 0.1 && e.delta > 0) return; //防止缩放太小,导致很慢
|
|
|
+ var I = viewer.inputHandler.intersect;
|
|
|
+ var min = 0.1;
|
|
|
+ if (I) {
|
|
|
+ min *= (I.model || I.pointcloud).scale.x;
|
|
|
+ }
|
|
|
+ if (resolvedRadius < min && e.delta > 0) return; //防止缩放太小,导致很慢
|
|
|
this.radiusDelta += -e.delta * resolvedRadius * 0.1;
|
|
|
this.stopTweens();
|
|
|
};
|
|
@@ -76373,7 +76377,8 @@
|
|
|
var bound = object.boundingBox.clone().applyMatrix4(object.matrixWorld);
|
|
|
var size = bound.getSize(new Vector3());
|
|
|
var len = size.length();
|
|
|
- var distance = MathUtils.clamp(dis, 0.1, Math.max(len * 0.1, 3));
|
|
|
+ var minDis = 3 * object.scale.x;
|
|
|
+ var distance = MathUtils.clamp(dis, 0.1 * object.scale.x, Math.max(len * 0.1, minDis));
|
|
|
minRadius = distance;
|
|
|
viewer.focusOnObject({
|
|
|
position: I
|