|
@@ -766,11 +766,11 @@ export class InputHandler extends THREE.EventDispatcher {
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
- ifBlockedByIntersect({pos3d, margin=0, cameraPos, pickWindowSize, pano, useDepthTex}={}){//某点是否被遮挡(不允许camera修改位置, 因为depthTex不好置换)
|
|
|
|
|
|
+ ifBlockedByIntersect({point, margin=0, cameraPos, pickWindowSize, pano, useDepthTex}={}){//某点是否被遮挡(不允许camera修改位置, 因为depthTex不好置换)
|
|
|
|
|
|
- let intersect = this.getIntersect(this.hoverViewport, true, pickWindowSize, null, null, useDepthTex, {pos3d, cameraPos, pano})
|
|
|
|
|
|
+ let intersect = this.getIntersect(this.hoverViewport, true, pickWindowSize, null, null, useDepthTex, {point, cameraPos, pano})
|
|
let cameraPos_ = (!cameraPos && pano) ? pano.position : (cameraPos||this.hoverViewport.view.position)
|
|
let cameraPos_ = (!cameraPos && pano) ? pano.position : (cameraPos||this.hoverViewport.view.position)
|
|
- if(intersect && intersect.distance+margin <= pos3d.distanceTo(cameraPos_)){
|
|
|
|
|
|
+ if(intersect && intersect.distance+margin <= point.distanceTo(cameraPos_)){
|
|
return intersect //被遮挡
|
|
return intersect //被遮挡
|
|
}
|
|
}
|
|
//点云模式,对没加载出的点云不准确。 尤其是需要修改相机位置时,因临时修改并不能使点云加载。
|
|
//点云模式,对没加载出的点云不准确。 尤其是需要修改相机位置时,因临时修改并不能使点云加载。
|
|
@@ -787,14 +787,14 @@ export class InputHandler extends THREE.EventDispatcher {
|
|
|
|
|
|
let getByDepthTex = ()=>{
|
|
let getByDepthTex = ()=>{
|
|
let intersect
|
|
let intersect
|
|
- if(prop.pos3d){
|
|
|
|
|
|
+ if(prop.point){
|
|
let cameraPos = prop.pano ? prop.pano.position : camera.position
|
|
let cameraPos = prop.pano ? prop.pano.position : camera.position
|
|
- let dir = new THREE.Vector3().subVectors(prop.pos3d, cameraPos).normalize();
|
|
|
|
|
|
+ let dir = new THREE.Vector3().subVectors(prop.point, cameraPos).normalize();
|
|
intersect = {dir}
|
|
intersect = {dir}
|
|
}else{
|
|
}else{
|
|
intersect = Utils.getIntersect(camera, [viewer.images360.cube], this.pointer, raycaster)
|
|
intersect = Utils.getIntersect(camera, [viewer.images360.cube], this.pointer, raycaster)
|
|
}
|
|
}
|
|
- intersectPoint = viewer.images360.depthSampler.sample(intersect, prop.pano, !!prop.pos3d) //可能不准确, 因pano可能未加载depthTex
|
|
|
|
|
|
+ intersectPoint = viewer.images360.depthSampler.sample(intersect, prop.pano, !!prop.point) //可能不准确, 因pano可能未加载depthTex
|
|
if(intersectPoint && Potree.settings.depTexLocBindDataset){
|
|
if(intersectPoint && Potree.settings.depTexLocBindDataset){
|
|
intersectPoint.pointcloud = (prop.pano || viewer.images360.currentPano).pointcloud
|
|
intersectPoint.pointcloud = (prop.pano || viewer.images360.currentPano).pointcloud
|
|
//在全景模式下,虽然深度图上的点可能对应别的pointcloud,但因为是在当前全景图处得到的,所以即使将原本对应的点云移走,该点也不移动是有道理的。它可以永远跟着该全景图。
|
|
//在全景模式下,虽然深度图上的点可能对应别的pointcloud,但因为是在当前全景图处得到的,所以即使将原本对应的点云移走,该点也不移动是有道理的。它可以永远跟着该全景图。
|
|
@@ -802,9 +802,9 @@ export class InputHandler extends THREE.EventDispatcher {
|
|
}
|
|
}
|
|
|
|
|
|
let getByCloud = ()=>{
|
|
let getByCloud = ()=>{
|
|
- if(prop.pos3d){//指定了目标点,而非只是用pointer所在位置
|
|
|
|
|
|
+ if(prop.point){//指定了目标点,而非只是用pointer所在位置
|
|
prop.cameraPos && camera.position.copy(prop.cameraPos)
|
|
prop.cameraPos && camera.position.copy(prop.cameraPos)
|
|
- camera.lookAt(prop.pos3d)
|
|
|
|
|
|
+ camera.lookAt(prop.point)
|
|
camera.updateMatrixWorld()
|
|
camera.updateMatrixWorld()
|
|
prop.pointer = this.pointer.clone()
|
|
prop.pointer = this.pointer.clone()
|
|
prop.mouse = this.mouse.clone()
|
|
prop.mouse = this.mouse.clone()
|
|
@@ -819,13 +819,13 @@ export class InputHandler extends THREE.EventDispatcher {
|
|
camera,
|
|
camera,
|
|
this.viewer,
|
|
this.viewer,
|
|
this.viewer.scene.pointclouds,
|
|
this.viewer.scene.pointclouds,
|
|
- {pickClipped: true, isMeasuring: this.isMeasuring, pickWindowSize, cameraChanged: !!prop.pos3d }
|
|
|
|
|
|
+ {pickClipped: true, isMeasuring: this.isMeasuring, pickWindowSize, cameraChanged: !!prop.point }
|
|
|
|
|
|
);
|
|
);
|
|
|
|
|
|
|
|
|
|
//恢复
|
|
//恢复
|
|
- if(prop.pos3d){
|
|
|
|
|
|
+ if(prop.point){
|
|
viewport.view.applyToCamera(camera)
|
|
viewport.view.applyToCamera(camera)
|
|
this.pointer.copy(prop.pointer)
|
|
this.pointer.copy(prop.pointer)
|
|
this.mouse.copy(prop.mouse)
|
|
this.mouse.copy(prop.mouse)
|