|
@@ -63968,7 +63968,7 @@ void main() {
|
|
|
MergeEditor.moveBoundCenterTo(model, new Vector3(0,0,0));
|
|
|
MergeEditor.setModelBtmHeight(model, 0); //初始加载设置离地高度为0
|
|
|
|
|
|
- if(prop.mode != 'query'){//如果不是模型展示页,模型会随着鼠标位置移动
|
|
|
+ if(prop.mode != 'single'){//如果不是模型展示页,模型会随着鼠标位置移动
|
|
|
viewer.addEventListener('global_mousemove', moveModel);
|
|
|
viewer.addEventListener('global_click', confirmPos, 3);
|
|
|
modelEditing = model;
|
|
@@ -81586,15 +81586,9 @@ void main() {
|
|
|
};
|
|
|
|
|
|
let endPosition = new Vector3().copy(info.position);
|
|
|
-
|
|
|
- const startPosition = this.position.clone();
|
|
|
- const startTarget = this.getPivot();
|
|
|
- let startQuaternion = math.getQuaFromPosAim(startPosition,startTarget);
|
|
|
-
|
|
|
- let endTarget = null, endQuaternion ;
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+ let startPosition = this.position.clone();
|
|
|
+ let startQuaternion, endQuaternion, endTarget = null ;
|
|
|
+
|
|
|
|
|
|
if(info.target ){
|
|
|
endTarget = new Vector3().copy(info.target);
|
|
@@ -81603,7 +81597,14 @@ void main() {
|
|
|
endQuaternion = info.quaternion.clone();
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+ if(endQuaternion){
|
|
|
+ startQuaternion = new Quaternion().setFromEuler(this.rotation);
|
|
|
+ /* const startTarget = this.getPivot();
|
|
|
+ let startQuaternion = math.getQuaFromPosAim(startPosition,startTarget) */
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
if(!info.duration){
|
|
|
this.position.copy(endPosition);
|
|
|
this.restrictPos();
|
|
@@ -87836,6 +87837,7 @@ void main() {
|
|
|
|
|
|
|
|
|
let marker = new Mesh(planeGeo$1, getMarerMat() );
|
|
|
+ marker.name = 'marker_'+this.id;
|
|
|
marker.up.set(0,0,1);
|
|
|
marker.lookAt(marker.up);
|
|
|
marker.scale.set(2,2,2);
|
|
@@ -91689,7 +91691,7 @@ void main() {
|
|
|
|
|
|
viewer.addEventListener("global_mousemove", (e) => {
|
|
|
if(!Potree.settings.unableNavigate && Potree.settings.ifShowMarker && e.hoverViewport == viewer.mainViewport){//如果不显示marker,就在点击时再更新
|
|
|
- this.updateClosestPano(e.intersectPoint);
|
|
|
+ this.updateClosestPano(e.intersect);
|
|
|
}
|
|
|
});
|
|
|
|
|
@@ -93493,7 +93495,7 @@ void main() {
|
|
|
} */
|
|
|
|
|
|
if(!Potree.settings.ifShowMarker){//不显示marker的时候mousemove没更新鼠标最近点所以更新
|
|
|
- this.updateClosestPano(viewer.inputHandler.intersectPoint);
|
|
|
+ this.updateClosestPano(viewer.inputHandler.intersect);
|
|
|
}
|
|
|
//console.log('flyToPanoClosestToMouse',this.closestPano)
|
|
|
|
|
@@ -93683,36 +93685,42 @@ void main() {
|
|
|
|
|
|
|
|
|
updateClosestPano(intersect, state) {//hover到的pano 大多数时候是null
|
|
|
- /* if(this.isAtPano() ){
|
|
|
- filterFuncs.push(Images360.filters.not(this.currentPano));
|
|
|
-
|
|
|
- //当静止在漫游点时closestPano只限制在每个漫游点附近,而在观看整个模型时,范围夸大,识别为离鼠标最近的漫游点。 (故而要排除flying时)
|
|
|
- filterFuncs.push(Images360.filters.inFloorDirection(this.position, viewer.scene.view.direction, .25))//许钟文改
|
|
|
- filterFuncs.push(Images360.filters.isCloseEnoughTo(intersect, 0.35));
|
|
|
- filterFuncs.push(Images360.filters.isEnabled())
|
|
|
- }else{
|
|
|
-
|
|
|
- } */
|
|
|
|
|
|
-
|
|
|
- var pano;
|
|
|
- if(this.isAtPano() ){
|
|
|
+ /*
|
|
|
+ var pano
|
|
|
+ if(this.isAtPano() ){ //为什么之前Panorama要加这个限制?
|
|
|
if(intersect instanceof Panorama){
|
|
|
- pano = state ? intersect : null;
|
|
|
- }else {
|
|
|
+ pano = state ? intersect : null
|
|
|
+ }else{
|
|
|
return
|
|
|
}
|
|
|
- }else {
|
|
|
+ }else{
|
|
|
if(this.flying)return;
|
|
|
var filterFuncs = [];
|
|
|
- intersect = intersect && intersect.location;
|
|
|
+ intersect = intersect && intersect.location
|
|
|
if(!intersect)return
|
|
|
- let sortFuncs = Potree.settings.editType != 'pano'? [Images360.sortFunctions.floorDisSquaredToPoint(intersect)] : [Images360.sortFunctions.disSquaredToPoint(intersect)];
|
|
|
+ let sortFuncs = Potree.settings.editType != 'pano'? [Images360.sortFunctions.floorDisSquaredToPoint(intersect)] : [Images360.sortFunctions.disSquaredToPoint(intersect)]
|
|
|
pano = Common.find(this.panos, filterFuncs, sortFuncs);
|
|
|
}
|
|
|
+ */
|
|
|
|
|
|
|
|
|
-
|
|
|
+ var pano;
|
|
|
+
|
|
|
+ if(intersect instanceof Panorama){
|
|
|
+ pano = state ? intersect : null;
|
|
|
+ }else {
|
|
|
+ if(this.isAtPano()){
|
|
|
+ return
|
|
|
+ }else {
|
|
|
+ if(this.flying)return;
|
|
|
+ var filterFuncs = [];
|
|
|
+ intersect = intersect && intersect.location;
|
|
|
+ if(!intersect)return
|
|
|
+ let sortFuncs = Potree.settings.editType != 'pano'? [Images360.sortFunctions.floorDisSquaredToPoint(intersect)] : [Images360.sortFunctions.disSquaredToPoint(intersect)];
|
|
|
+ pano = Common.find(this.panos, filterFuncs, sortFuncs);
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
if (pano != this.closestPano) {
|
|
|
pano && (this.isPanoHover = !0);
|
|
@@ -118287,8 +118295,9 @@ ENDSEC
|
|
|
if(this.selected){
|
|
|
if(this.selected == model) return
|
|
|
else {
|
|
|
+ let transToolAttached = !!this.transformControls.object;
|
|
|
this.selectModel(this.selected, false, fitBound, by2d);
|
|
|
- this.transformControls.attach(model);
|
|
|
+ transToolAttached && this.transformControls.attach(model);
|
|
|
}
|
|
|
}
|
|
|
this.selected = model;
|
|
@@ -129335,25 +129344,26 @@ ENDSEC
|
|
|
*/
|
|
|
|
|
|
renderOverlay(params){
|
|
|
-
|
|
|
- let camera = params.camera ? params.camera : this.scene.getActiveCamera();
|
|
|
+ this.renderOverlay1(params);
|
|
|
+ this.renderOverlay2(params);
|
|
|
+ /* let camera = params.camera ? params.camera : this.scene.getActiveCamera();
|
|
|
|
|
|
- this.reticule.updateAtViewports(params.viewport);
|
|
|
- this.renderer.setRenderTarget(params.target||null);
|
|
|
+ this.reticule.updateAtViewports(params.viewport)
|
|
|
+ this.renderer.setRenderTarget(params.target||null)
|
|
|
|
|
|
//为什么要在点云之后渲染,否则透明失效 、 会被点云覆盖
|
|
|
- let cameraLayers;
|
|
|
+ let cameraLayers
|
|
|
|
|
|
- if(params.cameraLayers) cameraLayers = params.cameraLayers;
|
|
|
- else {
|
|
|
- if(params.isMap)cameraLayers = ['bothMapAndScene'];
|
|
|
+ if(params.cameraLayers) cameraLayers = params.cameraLayers
|
|
|
+ else{
|
|
|
+ if(params.isMap)cameraLayers = ['bothMapAndScene']
|
|
|
else cameraLayers = ['sceneObjects', 'model', 'bothMapAndScene' ];
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if(cameraLayers.length){
|
|
|
- this.setCameraLayers(camera, cameraLayers, params.extraEnableLayers); //透明贴图层 skybox 、reticule marker 不能遮住测量线
|
|
|
+ this.setCameraLayers(camera, cameraLayers, params.extraEnableLayers) //透明贴图层 skybox 、reticule marker 不能遮住测量线
|
|
|
|
|
|
this.renderer.render(this.scene.scene, camera);
|
|
|
}
|
|
@@ -129374,16 +129384,16 @@ ENDSEC
|
|
|
this.dispatchEvent({type: "render.pass.perspective_overlay", camera, screenshot:params.screenshot});
|
|
|
|
|
|
if(!params.screenshot && !params.isMap){
|
|
|
- this.setCameraLayers(camera, ['magnifier']); //magnifier 遮住测量线
|
|
|
+ this.setCameraLayers(camera, ['magnifier']) //magnifier 遮住测量线
|
|
|
this.renderer.render(this.scene.scene, camera);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if(!params.isMap) {
|
|
|
- this.setCameraLayers(camera, ['volume','transformationTool']);
|
|
|
+ this.setCameraLayers(camera, ['volume','transformationTool'])
|
|
|
this.renderer.render(this.clippingTool.sceneVolume, camera);
|
|
|
this.renderer.render(this.transformationTool.scene, camera);
|
|
|
- }
|
|
|
+ } */
|
|
|
|
|
|
}
|
|
|
|
|
@@ -129409,24 +129419,26 @@ ENDSEC
|
|
|
if(cameraLayers.length){
|
|
|
this.setCameraLayers(camera, cameraLayers, params.extraEnableLayers); //透明贴图层 skybox 、reticule marker 不能遮住测量线
|
|
|
|
|
|
- this.scene.scene.traverse((object)=>{
|
|
|
- if(object.material){
|
|
|
- this.updateVisible(object, 'renderOpa',
|
|
|
- (params.renderBeforeCloud && (object.material.opacity<1 || !object.material.depthTest) || (!params.renderBeforeCloud) && (object.material.opacity==1 && object.material.depthTest))? false:true);
|
|
|
- //点云之前渲染的话隐藏半透明的, 点云之后渲染的话隐藏不透明的。 depthTest==false的也最后渲染
|
|
|
- }
|
|
|
- });
|
|
|
- //ground的材质中opacity为1,所以被当做不透明了
|
|
|
-
|
|
|
- this.renderer.render(this.scene.scene, camera);
|
|
|
-
|
|
|
+ if('renderBeforeCloud' in params){
|
|
|
+ this.scene.scene.traverse((object)=>{
|
|
|
+ if(object.material){
|
|
|
+ this.updateVisible(object, 'renderOpa',
|
|
|
+ (params.renderBeforeCloud && (object.material.opacity<1 || !object.material.depthTest) || (!params.renderBeforeCloud) && (object.material.opacity==1 && object.material.depthTest))? false:true);
|
|
|
+ //点云之前渲染的话隐藏半透明的, 点云之后渲染的话隐藏不透明的。 depthTest==false的也最后渲染
|
|
|
+ }
|
|
|
+ });//ground的材质中opacity为1,所以被当做不透明了
|
|
|
+ }
|
|
|
|
|
|
|
|
|
- this.scene.scene.traverse((object)=>{
|
|
|
- if(object.material){
|
|
|
- this.updateVisible(object, 'renderOpa', true); //恢复
|
|
|
- }
|
|
|
- });
|
|
|
+ this.renderer.render(this.scene.scene, camera);
|
|
|
+
|
|
|
+ if('renderBeforeCloud' in params){
|
|
|
+ this.scene.scene.traverse((object)=>{
|
|
|
+ if(object.material){
|
|
|
+ this.updateVisible(object, 'renderOpa', true); //恢复
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
this.dispatchEvent({type: "render.pass.scene", viewer: viewer});
|