|
@@ -280,6 +280,7 @@ Utils.getMousePointCloudIntersection = function(viewport, mouse, pointer, camera
|
|
let old_clipBoxes_out = new Map()
|
|
let old_clipBoxes_out = new Map()
|
|
let old_bigClipInBox = new Map()
|
|
let old_bigClipInBox = new Map()
|
|
let old_highlightBoxes = new Map()
|
|
let old_highlightBoxes = new Map()
|
|
|
|
+ let old_visibleNodes = new Map()
|
|
|
|
|
|
//bigClipInBox 最好也写下
|
|
//bigClipInBox 最好也写下
|
|
let density
|
|
let density
|
|
@@ -322,8 +323,11 @@ Utils.getMousePointCloudIntersection = function(viewport, mouse, pointer, camera
|
|
needsUpdate = true
|
|
needsUpdate = true
|
|
}
|
|
}
|
|
|
|
|
|
- if(needsUpdate){
|
|
|
|
-
|
|
|
|
|
|
+ if(old_visibleNodes) {
|
|
|
|
+ for(let pointcloud of pointclouds){
|
|
|
|
+ old_visibleNodes.set(pointcloud, pointcloud.visibleNodes)
|
|
|
|
+ }
|
|
|
|
+
|
|
if(window.notViewOffset){
|
|
if(window.notViewOffset){
|
|
Potree.updatePointClouds(pointclouds, camera, viewport.resolution );
|
|
Potree.updatePointClouds(pointclouds, camera, viewport.resolution );
|
|
}else{
|
|
}else{
|
|
@@ -332,10 +336,9 @@ Utils.getMousePointCloudIntersection = function(viewport, mouse, pointer, camera
|
|
let camera_ = camera.clone()
|
|
let camera_ = camera.clone()
|
|
camera_.setViewOffset( viewport.resolution.x, viewport.resolution.y, pickParams.x-viewWidth/2, pickParams.y-viewWidth/2, viewWidth, viewWidth );
|
|
camera_.setViewOffset( viewport.resolution.x, viewport.resolution.y, pickParams.x-viewWidth/2, pickParams.y-viewWidth/2, viewWidth, viewWidth );
|
|
Potree.updatePointClouds(pointclouds, camera_, viewport.resolution );
|
|
Potree.updatePointClouds(pointclouds, camera_, viewport.resolution );
|
|
-
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
+
|
|
//------------------------------------------------
|
|
//------------------------------------------------
|
|
|
|
|
|
|
|
|
|
@@ -380,12 +383,23 @@ Utils.getMousePointCloudIntersection = function(viewport, mouse, pointer, camera
|
|
viewport.afterRender && viewport.afterRender()
|
|
viewport.afterRender && viewport.afterRender()
|
|
} */
|
|
} */
|
|
}
|
|
}
|
|
|
|
+
|
|
if(!pickParams.pickClipped){//add
|
|
if(!pickParams.pickClipped){//add
|
|
for(let pointcloud of pointclouds){
|
|
for(let pointcloud of pointclouds){
|
|
pointcloud.material.setClipBoxes(old_bigClipInBox.get(pointcloud), old_clipBoxes_in.get(pointcloud), old_clipBoxes_out.get(pointcloud), old_highlightBoxes.get(pointcloud))
|
|
pointcloud.material.setClipBoxes(old_bigClipInBox.get(pointcloud), old_clipBoxes_in.get(pointcloud), old_clipBoxes_out.get(pointcloud), old_highlightBoxes.get(pointcloud))
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+ if(old_visibleNodes){
|
|
|
|
+ for(let pointcloud of pointclouds){ //不恢复的话(尤其cameraChanged时),在下次render前,再次pick可能是错的。表现为多数据集刚开始reticule消失了,直到ifPointBlockedByIntersect停止
|
|
|
|
+ pointcloud.visibleNodes = old_visibleNodes.get(pointcloud)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
if (selectedPointcloud) {
|
|
if (selectedPointcloud) {
|
|
return {
|
|
return {
|
|
location: closestIntersection,
|
|
location: closestIntersection,
|
|
@@ -928,6 +942,8 @@ BinaryLoader.prototype.load = function(node, callback){//解析点云
|
|
} else {
|
|
} else {
|
|
//console.error(`Failed to load file! HTTP status: ${xhr.status}, file: ${url}`);
|
|
//console.error(`Failed to load file! HTTP status: ${xhr.status}, file: ${url}`);
|
|
throw new Error(`Failed to load file! HTTP status: ${xhr.status}, file: ${url}`);
|
|
throw new Error(`Failed to load file! HTTP status: ${xhr.status}, file: ${url}`);
|
|
|
|
+ node.loadFailed = 'status:'+xhr.status+",url:"+url
|
|
|
|
+ Potree.numNodesLoading--;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
};
|
|
};
|
|
@@ -935,7 +951,9 @@ BinaryLoader.prototype.load = function(node, callback){//解析点云
|
|
try {
|
|
try {
|
|
xhr.send(null);
|
|
xhr.send(null);
|
|
} catch (e) {
|
|
} catch (e) {
|
|
- console.log('fehler beim laden der punktwolke: ' + e);
|
|
|
|
|
|
+ console.error('加载点云node出错 ', url, e );
|
|
|
|
+ node.loadFailed = 'catchError'
|
|
|
|
+ Potree.numNodesLoading--;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1504,15 +1522,13 @@ Potree.updateVisibility = function(pointclouds, camera, areaSize){
|
|
pointcloud.dem.update(updatingNodes);
|
|
pointcloud.dem.update(updatingNodes);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+ unloadedGeometry = unloadedGeometry.filter(e=>!e.loadFailed) //过滤加载失败的,否则有失败的就无法发送加载完成
|
|
|
|
|
|
if(unloadedGeometry.length){//加载点云
|
|
if(unloadedGeometry.length){//加载点云
|
|
-
|
|
|
|
- /* for (let i = 0; i < Math.min(Potree.maxNodesLoading, unloadedGeometry.length); i++) {
|
|
|
|
- unloadedGeometry[i].node.load(unloadedGeometry[i].pointcloud.pcoGeometry);
|
|
|
|
- } */
|
|
|
|
|
|
|
|
let maxNodesLoading = Common.getBestCount('unloadedGeometry', viewer.lastFrameChanged?1:3, 6, 4, 15 /* , true */ )//dur在iphoneX中静止有7,pc是2 //!lastFrameChanged静止时加速下载
|
|
let maxNodesLoading = Common.getBestCount('unloadedGeometry', viewer.lastFrameChanged?1:3, 6, 4, 15 /* , true */ )//dur在iphoneX中静止有7,pc是2 //!lastFrameChanged静止时加速下载
|
|
//THREE.Math.clamp(Math.round(9 - dur), 1, 6 )
|
|
//THREE.Math.clamp(Math.round(9 - dur), 1, 6 )
|