|
@@ -731,7 +731,7 @@
|
|
webSite:'testdata',//'data', //不同环境对应的静态文件的地址不同
|
|
webSite:'testdata',//'data', //不同环境对应的静态文件的地址不同
|
|
|
|
|
|
isLocal:false, //是否本地 局域网版本
|
|
isLocal:false, //是否本地 局域网版本
|
|
-
|
|
|
|
|
|
+ libsUrl:'../libs/',
|
|
displayMode:'',
|
|
displayMode:'',
|
|
isTest :browser.urlHasValue('test'),
|
|
isTest :browser.urlHasValue('test'),
|
|
prefix: getPrefix(),
|
|
prefix: getPrefix(),
|
|
@@ -63811,7 +63811,7 @@ void main() {
|
|
pointcloud.pos1MatrixInvert = new Matrix4().setPosition(pointcloud.initialPosition).invert();
|
|
pointcloud.pos1MatrixInvert = new Matrix4().setPosition(pointcloud.initialPosition).invert();
|
|
|
|
|
|
let maintainBtmZ = ()=>{
|
|
let maintainBtmZ = ()=>{
|
|
- MergeEditor.setModelBtmHeight(object);
|
|
|
|
|
|
+ MergeEditor.setModelBtmHeight(pointcloud);
|
|
updateMatrix();
|
|
updateMatrix();
|
|
};
|
|
};
|
|
let updateMatrix = ()=>{
|
|
let updateMatrix = ()=>{
|
|
@@ -83756,13 +83756,13 @@ void main() {
|
|
return Math.acos(MathLight.dot(e, t))
|
|
return Math.acos(MathLight.dot(e, t))
|
|
};
|
|
};
|
|
|
|
|
|
- var cameraLight$1 = {
|
|
|
|
|
|
+ var cameraLight = {
|
|
clampVFOV: function(currentFov, maxHFov, width, height) {//限制currentFov, 使之造成的横向fov不大于指定值maxHFov
|
|
clampVFOV: function(currentFov, maxHFov, width, height) {//限制currentFov, 使之造成的横向fov不大于指定值maxHFov
|
|
- var r = cameraLight$1.getHFOVFromVFOV(currentFov, width, height);
|
|
|
|
- return r > maxHFov ? cameraLight$1.getVFOVFromHFOV(maxHFov, width, height) : currentFov
|
|
|
|
|
|
+ var r = cameraLight.getHFOVFromVFOV(currentFov, width, height);
|
|
|
|
+ return r > maxHFov ? cameraLight.getVFOVFromHFOV(maxHFov, width, height) : currentFov
|
|
},
|
|
},
|
|
getHFOVForCamera: function(camera, getRad) {
|
|
getHFOVForCamera: function(camera, getRad) {
|
|
- return cameraLight$1.getHFOVByScreenPrecent(camera.fov, camera.aspect, getRad)
|
|
|
|
|
|
+ return cameraLight.getHFOVByScreenPrecent(camera.fov, camera.aspect, getRad)
|
|
},
|
|
},
|
|
//add
|
|
//add
|
|
getHFOVByScreenPrecent: function(fov, percent, getRad) { //当fov为占比百分百时,percent代表在屏幕上从中心到边缘的占比
|
|
getHFOVByScreenPrecent: function(fov, percent, getRad) { //当fov为占比百分百时,percent代表在屏幕上从中心到边缘的占比
|
|
@@ -84052,7 +84052,7 @@ void main() {
|
|
} */
|
|
} */
|
|
let lastIntersect = viewport.lastIntersect ? (viewport.lastIntersect.location || viewport.lastIntersect) : viewer.bound.center; //该viewport的最近一次鼠标和点云的交点
|
|
let lastIntersect = viewport.lastIntersect ? (viewport.lastIntersect.location || viewport.lastIntersect) : viewer.bound.center; //该viewport的最近一次鼠标和点云的交点
|
|
let speed = camera.position.distanceTo(lastIntersect);
|
|
let speed = camera.position.distanceTo(lastIntersect);
|
|
- let fov = cameraLight$1.getHFOVForCamera(camera, true);
|
|
|
|
|
|
+ let fov = cameraLight.getHFOVForCamera(camera, true);
|
|
let ratio = speed * Math.tan(fov/2);
|
|
let ratio = speed * Math.tan(fov/2);
|
|
this.translationDelta.x -= e.drag.pointerDelta.x * ratio;
|
|
this.translationDelta.x -= e.drag.pointerDelta.x * ratio;
|
|
this.translationDelta.z -= e.drag.pointerDelta.y * ratio;
|
|
this.translationDelta.z -= e.drag.pointerDelta.y * ratio;
|
|
@@ -85484,6 +85484,11 @@ void main() {
|
|
}
|
|
}
|
|
|
|
|
|
if(e.onlyGetIntersect){
|
|
if(e.onlyGetIntersect){
|
|
|
|
+ if(Potree.settings.intersectOnObjs){
|
|
|
|
+ this.hoveredElements = this.getHoveredElements(); //应该不用发送mouseover事件吧
|
|
|
|
+ return this.getWholeIntersect()
|
|
|
|
+ }
|
|
|
|
+
|
|
return intersectPoint
|
|
return intersectPoint
|
|
}
|
|
}
|
|
e.preventDefault();
|
|
e.preventDefault();
|
|
@@ -93027,7 +93032,7 @@ void main() {
|
|
if(ifNeighbour){//点云模式下未加载的点云会判断为true
|
|
if(ifNeighbour){//点云模式下未加载的点云会判断为true
|
|
let dir = new Vector3().subVectors(pano1.position,pano0.position).normalize();
|
|
let dir = new Vector3().subVectors(pano1.position,pano0.position).normalize();
|
|
let dis = pano1.position.distanceTo(pano0.position);
|
|
let dis = pano1.position.distanceTo(pano0.position);
|
|
- let hfov = cameraLight$1.getHFOVForCamera(viewer.mainViewport.camera , true );
|
|
|
|
|
|
+ let hfov = cameraLight.getHFOVForCamera(viewer.mainViewport.camera , true );
|
|
let max = Math.cos(MathUtils.degToRad(10));
|
|
let max = Math.cos(MathUtils.degToRad(10));
|
|
let min = Math.cos(MathUtils.degToRad(80));
|
|
let min = Math.cos(MathUtils.degToRad(80));
|
|
if(this.getDirection().dot(dir) < MathUtils.clamp(Math.cos(hfov/2/* THREE.Math.degToRad(40) */) * dis / 10, min, max )){//距离越远要求和视线角度越接近
|
|
if(this.getDirection().dot(dir) < MathUtils.clamp(Math.cos(hfov/2/* THREE.Math.degToRad(40) */) * dis / 10, min, max )){//距离越远要求和视线角度越接近
|
|
@@ -93273,7 +93278,7 @@ void main() {
|
|
if(camera.aspect > aspect){//视野更宽则用bound的纵向来决定
|
|
if(camera.aspect > aspect){//视野更宽则用bound的纵向来决定
|
|
dis = /* size.y */o.boundSphere.radius/* / 2 *// MathUtils.degToRad(camera.fov / 2);
|
|
dis = /* size.y */o.boundSphere.radius/* / 2 *// MathUtils.degToRad(camera.fov / 2);
|
|
}else {
|
|
}else {
|
|
- let hfov = cameraLight$1.getHFOVForCamera(camera , true );
|
|
|
|
|
|
+ let hfov = cameraLight.getHFOVForCamera(camera , true );
|
|
dis = /* size.x */ o.boundSphere.radius /* / 2 */ / (hfov / 2);
|
|
dis = /* size.x */ o.boundSphere.radius /* / 2 */ / (hfov / 2);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -105651,7 +105656,7 @@ ENDSEC
|
|
|
|
|
|
var GLTFLoader = ( function () {
|
|
var GLTFLoader = ( function () {
|
|
|
|
|
|
- function GLTFLoader( manager, renderer ) {
|
|
|
|
|
|
+ function GLTFLoader( manager, renderer, urlPrefix) {
|
|
|
|
|
|
Loader.call( this, manager );
|
|
Loader.call( this, manager );
|
|
|
|
|
|
@@ -105666,9 +105671,9 @@ ENDSEC
|
|
this.meshoptDecoder = MeshoptDecoder;
|
|
this.meshoptDecoder = MeshoptDecoder;
|
|
this.ddsLoader = new DDSLoader; //这个没测过
|
|
this.ddsLoader = new DDSLoader; //这个没测过
|
|
|
|
|
|
- //路径相对于index.html
|
|
|
|
- this.dracoLoader.setDecoderPath( '../libs/three.js/loaders/draco/' /* 'static/lib/three.js/loaders/draco/' */); //这两个路径可以自己改。在laser的环境也要放一份这个路径
|
|
|
|
- this.ktx2Loader.setTranscoderPath('../libs/three.js/loaders/ktx/' /* 'static/lib/three.js/loaders/ktx/' */ ).detectSupport( renderer );
|
|
|
|
|
|
+ //路径相对于index.html
|
|
|
|
+ this.dracoLoader.setDecoderPath( urlPrefix + 'three.js/loaders/draco/' /* '../libs/three.js/loaders/draco/' */ /* 'static/lib/three.js/loaders/draco/' */); //这两个路径可以自己改。在laser的环境也要放一份这个路径
|
|
|
|
+ this.ktx2Loader.setTranscoderPath(urlPrefix + 'three.js/loaders/ktx/' /* '../libs/three.js/loaders/ktx/' */ /* 'static/lib/three.js/loaders/ktx/' */ ).detectSupport( renderer );
|
|
|
|
|
|
//------------
|
|
//------------
|
|
|
|
|
|
@@ -114970,11 +114975,18 @@ ENDSEC
|
|
}
|
|
}
|
|
this.selected = model;
|
|
this.selected = model;
|
|
MergeEditor.focusOnSelect(model);
|
|
MergeEditor.focusOnSelect(model);
|
|
- viewer.outlinePass.selectedObjects = [pointcloud];
|
|
|
|
|
|
+ viewer.outlinePass.selectedObjects = [model];
|
|
}else {
|
|
}else {
|
|
viewer.outlinePass.selectedObjects = [];
|
|
viewer.outlinePass.selectedObjects = [];
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
|
|
+ if(model.isPointcloud){
|
|
|
|
+ viewer.outlinePass.edgeStrength = 4;
|
|
|
|
+ }else {
|
|
|
|
+ viewer.outlinePass.edgeStrength = 100;
|
|
|
|
+ }
|
|
|
|
+
|
|
if(by2d && model){
|
|
if(by2d && model){
|
|
model.dispatchEvent({type:'changeSelect', selected : state});
|
|
model.dispatchEvent({type:'changeSelect', selected : state});
|
|
}
|
|
}
|
|
@@ -122182,7 +122194,7 @@ ENDSEC
|
|
this.edgeGlow = 0.0;
|
|
this.edgeGlow = 0.0;
|
|
this.usePatternTexture = false;
|
|
this.usePatternTexture = false;
|
|
//this.edgeThickness = 1.0;
|
|
//this.edgeThickness = 1.0;
|
|
- this.edgeStrength = 3.0;
|
|
|
|
|
|
+ this.edgeStrength = 50;
|
|
this.downSampleRatio = 1;//2; // 抗锯齿 值越低renderTarget size越大,抗锯齿越强,线条可越细(或许可以把模糊化去掉?)
|
|
this.downSampleRatio = 1;//2; // 抗锯齿 值越低renderTarget size越大,抗锯齿越强,线条可越细(或许可以把模糊化去掉?)
|
|
this.pulsePeriod = 0;
|
|
this.pulsePeriod = 0;
|
|
|
|
|
|
@@ -122519,10 +122531,12 @@ ENDSEC
|
|
this.edgeDetectionMaterial.uniforms[ "maskTexture" ].value = this.renderTargetMaskBuffer.texture;//this.renderTargetMaskDownSampleBuffer.texture;
|
|
this.edgeDetectionMaterial.uniforms[ "maskTexture" ].value = this.renderTargetMaskBuffer.texture;//this.renderTargetMaskDownSampleBuffer.texture;
|
|
this.edgeDetectionMaterial.uniforms[ "texSize" ].value = new Vector2$1(this.resolution.x, this.resolution.y );//new THREE.Vector2( this.renderTargetMaskDownSampleBuffer.width, this.renderTargetMaskDownSampleBuffer.height );
|
|
this.edgeDetectionMaterial.uniforms[ "texSize" ].value = new Vector2$1(this.resolution.x, this.resolution.y );//new THREE.Vector2( this.renderTargetMaskDownSampleBuffer.width, this.renderTargetMaskDownSampleBuffer.height );
|
|
//this.edgeDetectionMaterial.uniforms[ "texSize" ].value = new THREE.Vector2(this.renderTargetMaskBuffer.width, this.renderTargetMaskBuffer.height)//new THREE.Vector2( this.renderTargetMaskDownSampleBuffer.width, this.renderTargetMaskDownSampleBuffer.height );
|
|
//this.edgeDetectionMaterial.uniforms[ "texSize" ].value = new THREE.Vector2(this.renderTargetMaskBuffer.width, this.renderTargetMaskBuffer.height)//new THREE.Vector2( this.renderTargetMaskDownSampleBuffer.width, this.renderTargetMaskDownSampleBuffer.height );
|
|
|
|
+ this.edgeDetectionMaterial.uniforms[ "thickness" ].value = this.edgeStrength;
|
|
|
|
+
|
|
this.edgeDetectionMaterial.uniforms[ "visibleEdgeColor" ].value = this.visibleEdgeColor;//this.tempPulseColor1;
|
|
this.edgeDetectionMaterial.uniforms[ "visibleEdgeColor" ].value = this.visibleEdgeColor;//this.tempPulseColor1;
|
|
this.edgeDetectionMaterial.uniforms[ "hiddenEdgeColor" ].value = this.hiddenEdgeColor; //this.tempPulseColor2;
|
|
this.edgeDetectionMaterial.uniforms[ "hiddenEdgeColor" ].value = this.hiddenEdgeColor; //this.tempPulseColor2;
|
|
-
|
|
|
|
- renderer.setRenderTarget(this.renderTargetEdgeBuffer1);
|
|
|
|
|
|
+ renderer.setClearColor( 0x000000, 0 );
|
|
|
|
+ renderer.setRenderTarget(readBuffer/* this.renderTargetEdgeBuffer1 */);
|
|
renderer.clear();
|
|
renderer.clear();
|
|
renderer.render( this.scene, this.camera/* , this.renderTargetEdgeBuffer1, true */);
|
|
renderer.render( this.scene, this.camera/* , this.renderTargetEdgeBuffer1, true */);
|
|
|
|
|
|
@@ -122547,8 +122561,8 @@ ENDSEC
|
|
renderer.render( this.scene, this.camera, this.renderTargetEdgeBuffer2, true );
|
|
renderer.render( this.scene, this.camera, this.renderTargetEdgeBuffer2, true );
|
|
*/
|
|
*/
|
|
|
|
|
|
-
|
|
|
|
- // Blend it additively over the input texture
|
|
|
|
|
|
+ //这次删掉
|
|
|
|
+ /* // Blend it additively over the input texture
|
|
this.quad.material = this.overlayMaterial;
|
|
this.quad.material = this.overlayMaterial;
|
|
//this.overlayMaterial.uniforms[ "maskTexture" ].value = this.renderTargetMaskBuffer.texture;
|
|
//this.overlayMaterial.uniforms[ "maskTexture" ].value = this.renderTargetMaskBuffer.texture;
|
|
this.overlayMaterial.uniforms[ "edgeTexture1" ].value = this.renderTargetEdgeBuffer1.texture;
|
|
this.overlayMaterial.uniforms[ "edgeTexture1" ].value = this.renderTargetEdgeBuffer1.texture;
|
|
@@ -122557,7 +122571,7 @@ ENDSEC
|
|
this.overlayMaterial.uniforms[ "edgeStrength" ].value = this.edgeStrength;
|
|
this.overlayMaterial.uniforms[ "edgeStrength" ].value = this.edgeStrength;
|
|
//this.overlayMaterial.uniforms[ "edgeGlow" ].value = this.edgeGlow;
|
|
//this.overlayMaterial.uniforms[ "edgeGlow" ].value = this.edgeGlow;
|
|
//this.overlayMaterial.uniforms[ "usePatternTexture" ].value = this.usePatternTexture;
|
|
//this.overlayMaterial.uniforms[ "usePatternTexture" ].value = this.usePatternTexture;
|
|
-
|
|
|
|
|
|
+
|
|
|
|
|
|
if ( maskActive ) renderer.context.enable( renderer.context.STENCIL_TEST );
|
|
if ( maskActive ) renderer.context.enable( renderer.context.STENCIL_TEST );
|
|
//renderer.render( this.scene, camera, readBuffer, false );
|
|
//renderer.render( this.scene, camera, readBuffer, false );
|
|
@@ -122565,10 +122579,10 @@ ENDSEC
|
|
//改:清空readBuffer, 仅绘制出outline的部分
|
|
//改:清空readBuffer, 仅绘制出outline的部分
|
|
|
|
|
|
renderer.setClearColor( 0x000000, 0 );
|
|
renderer.setClearColor( 0x000000, 0 );
|
|
- renderer.setRenderTarget(readBuffer);
|
|
|
|
- renderer.clear();
|
|
|
|
- renderer.render( this.scene, this.camera/* , readBuffer, true */);
|
|
|
|
-
|
|
|
|
|
|
+ renderer.setRenderTarget(readBuffer)
|
|
|
|
+ renderer.clear()
|
|
|
|
+ renderer.render( this.scene, this.camera );
|
|
|
|
+ */
|
|
|
|
|
|
renderer.setClearColor( this.oldClearColor, this.oldClearAlpha );
|
|
renderer.setClearColor( this.oldClearColor, this.oldClearAlpha );
|
|
renderer.autoClear = oldAutoClear;
|
|
renderer.autoClear = oldAutoClear;
|
|
@@ -123393,7 +123407,7 @@ ENDSEC
|
|
loaders = {
|
|
loaders = {
|
|
objLoader : new OBJLoader( manager ),
|
|
objLoader : new OBJLoader( manager ),
|
|
mtlLoader : new MTLLoader( manager ),
|
|
mtlLoader : new MTLLoader( manager ),
|
|
- glbLoader : new GLTFLoader(undefined, this.renderer)
|
|
|
|
|
|
+ glbLoader : new GLTFLoader(undefined, this.renderer, Potree.settings.libsUrl )
|
|
|
|
|
|
};
|
|
};
|
|
//add test
|
|
//add test
|
|
@@ -126296,7 +126310,7 @@ ENDSEC
|
|
if(camera.aspect > aspect){//视野更宽则用bound的纵向来决定
|
|
if(camera.aspect > aspect){//视野更宽则用bound的纵向来决定
|
|
dis = boundSize.y/2/ Math.tan(MathUtils.degToRad(camera.fov / 2)) + boundSize.z/2;
|
|
dis = boundSize.y/2/ Math.tan(MathUtils.degToRad(camera.fov / 2)) + boundSize.z/2;
|
|
}else {
|
|
}else {
|
|
- let hfov = cameraLight$1.getHFOVForCamera(camera, true);
|
|
|
|
|
|
+ let hfov = cameraLight.getHFOVForCamera(camera, true);
|
|
dis = boundSize.x/2 / Math.tan(hfov / 2) + boundSize.z/2;
|
|
dis = boundSize.x/2 / Math.tan(hfov / 2) + boundSize.z/2;
|
|
}
|
|
}
|
|
dis = Math.max(0.1,dis);
|
|
dis = Math.max(0.1,dis);
|
|
@@ -127091,17 +127105,19 @@ ENDSEC
|
|
this.objs.add(object);
|
|
this.objs.add(object);
|
|
object.boundingBox = boundingBox;
|
|
object.boundingBox = boundingBox;
|
|
|
|
|
|
- if(fileInfo.transform.rotation){
|
|
|
|
- object.rotation.fromArray(fileInfo.transform.rotation);
|
|
|
|
- }
|
|
|
|
- if(fileInfo.transform.position){
|
|
|
|
- object.position.fromArray(fileInfo.transform.position);
|
|
|
|
- }
|
|
|
|
- if(fileInfo.transform.scale){
|
|
|
|
- object.position.fromArray(fileInfo.transform.scale);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+ let setTransfrom = (name)=>{
|
|
|
|
+ let value = fileInfo.transform[name];
|
|
|
|
+ if(value instanceof Array){
|
|
|
|
+ object[name].fromArray(value);
|
|
|
|
+ }else {
|
|
|
|
+ object[name].copy(value);
|
|
|
|
+ }
|
|
|
|
+ };
|
|
|
|
+ setTransfrom('position');
|
|
|
|
+ setTransfrom('rotation');
|
|
|
|
+ setTransfrom('scale');
|
|
|
|
+
|
|
|
|
+
|
|
|
|
|
|
if(fileInfo.moveWithPointcloud){
|
|
if(fileInfo.moveWithPointcloud){
|
|
object.updateMatrix();
|
|
object.updateMatrix();
|