|
@@ -6595,8 +6595,10 @@
|
|
|
}
|
|
|
return get(url);
|
|
|
},
|
|
|
- getBoundPoints(bound) {
|
|
|
- return [new Vector3(bound.min.x, bound.min.y, bound.min.z), new Vector3(bound.min.x, bound.min.y, bound.max.z), new Vector3(bound.min.x, bound.max.y, bound.min.z), new Vector3(bound.max.x, bound.min.y, bound.min.z), new Vector3(bound.max.x, bound.max.y, bound.min.z), new Vector3(bound.max.x, bound.min.y, bound.max.z), new Vector3(bound.min.x, bound.max.y, bound.max.z), new Vector3(bound.max.x, bound.max.y, bound.max.z)];
|
|
|
+ getBoundPoints(bound, matrixWorld) {
|
|
|
+ var points = [new Vector3(bound.min.x, bound.min.y, bound.min.z), new Vector3(bound.min.x, bound.min.y, bound.max.z), new Vector3(bound.min.x, bound.max.y, bound.min.z), new Vector3(bound.max.x, bound.min.y, bound.min.z), new Vector3(bound.max.x, bound.max.y, bound.min.z), new Vector3(bound.max.x, bound.min.y, bound.max.z), new Vector3(bound.min.x, bound.max.y, bound.max.z), new Vector3(bound.max.x, bound.max.y, bound.max.z)];
|
|
|
+ matrixWorld && points.forEach(e => e.applyMatrix4(matrixWorld));
|
|
|
+ return points;
|
|
|
},
|
|
|
//---------------------------
|
|
|
|
|
@@ -53457,7 +53459,7 @@
|
|
|
this._visible = true;
|
|
|
//this.showVolumeLabel = true;
|
|
|
this._modifiable = args.modifiable || true;
|
|
|
- {
|
|
|
+ if (!args.noPointerEvent) {
|
|
|
// event listeners
|
|
|
this.addEventListener('select', e => {
|
|
|
//console.log('select')
|
|
@@ -53566,7 +53568,8 @@
|
|
|
color: colors[this.clipTask],
|
|
|
opacity: LineOpacity.default,
|
|
|
lineWidth: 1,
|
|
|
- dontAlwaysSeen: true
|
|
|
+ dontAlwaysSeen: true,
|
|
|
+ autoDepthTest: true
|
|
|
});
|
|
|
|
|
|
// this.frame.mode = THREE.Lines;
|
|
@@ -71987,6 +71990,7 @@
|
|
|
|
|
|
// Detatch from object
|
|
|
this.detach = function () {
|
|
|
+ console.warn('detach');
|
|
|
this.object = undefined;
|
|
|
this.axis = null;
|
|
|
//Config.keyCon = true;//add
|
|
@@ -72307,6 +72311,7 @@
|
|
|
}
|
|
|
//add:
|
|
|
|
|
|
+ this.options.minScale && object.scale.max(this.options.minScale);
|
|
|
object.dispatchEvent({
|
|
|
type: "scale_changed",
|
|
|
byControl: true
|
|
@@ -75784,6 +75789,12 @@
|
|
|
this.boxHelper = new Box3Helper$1(new Box3(new Vector3(-0.5, -0.5, -0.5), new Vector3(0.5, 0.5, 0.5)));
|
|
|
viewer.scene.scene.add(this.boxHelper);
|
|
|
Potree.Utils.updateVisible(this.boxHelper, 'unselect', false);
|
|
|
+ this.boxHelper.material.opacity = 0.7;
|
|
|
+ var boxHelper2 = new Box3Helper$1(new Box3(new Vector3(-0.5, -0.5, -0.5), new Vector3(0.5, 0.5, 0.5)));
|
|
|
+ boxHelper2.material.opacity = 0.3;
|
|
|
+ boxHelper2.material.transparent = true, boxHelper2.material.depthTest = false;
|
|
|
+ this.boxHelper.add(boxHelper2); //透明一点的boxHelper */
|
|
|
+
|
|
|
this.lastMemoryState = {};
|
|
|
this.history = new History({
|
|
|
applyData: data => {
|
|
@@ -75837,7 +75848,8 @@
|
|
|
{
|
|
|
this.transformControls = new TransformControls(viewer.mainViewport.camera, viewer.renderArea, {
|
|
|
//dontHideWhenFaceCamera: true,
|
|
|
- showRotXYZE: true
|
|
|
+ showRotXYZE: true,
|
|
|
+ minScale: new Vector3(0.00001, 0.00001, 0.00001)
|
|
|
});
|
|
|
//this.transformControls.space = 'local'//为了在当前方向上平移
|
|
|
this.transformControls.setSize(1.5);
|
|
@@ -76311,20 +76323,24 @@
|
|
|
if (!(objects instanceof Array)) {
|
|
|
objects = [objects];
|
|
|
}
|
|
|
+ var points = []; //用points会更近一些准一点
|
|
|
var boundingBox = new Box3();
|
|
|
objects.forEach(object => {
|
|
|
- boundingBox.union(object.boundingBox.clone().applyMatrix4(object.matrixWorld));
|
|
|
+ points.push(...Common$1.getBoundPoints(object.boundingBox, object.matrixWorld));
|
|
|
+ boundingBox.union(object.bound /* object.boundingBox.clone().applyMatrix4(object.matrixWorld) */);
|
|
|
});
|
|
|
var len = boundingBox.getSize(new Vector3()).length();
|
|
|
Potree.settings.cameraFar = Math.max(Potree.settings.cameraFar, len * 3);
|
|
|
if (focus) {
|
|
|
viewer.focusOnObject({
|
|
|
- boundingBox
|
|
|
+ boundingBox,
|
|
|
+ points
|
|
|
}, 'boundingBox', duration, {
|
|
|
+ boundScale: 0.8,
|
|
|
dontLookUp,
|
|
|
dontChangeCamDir: dir ? false : true,
|
|
|
dir
|
|
|
- });
|
|
|
+ }); //boundScale小一点离近一点
|
|
|
} else {
|
|
|
/*
|
|
|
let position = viewer.inputHandler.intersect ? viewer.inputHandler.intersect.location : boundingBox.getCenter(new THREE.Vector3)
|
|
@@ -84854,7 +84870,8 @@
|
|
|
var distance = o.position.distanceTo(o.CamTarget);
|
|
|
//if(distance < minRadius) minRadius = distance * 0.5 //融合页面当focus一个很小的物体时,需要将minRadius也调小
|
|
|
this.minRadius = Math.min(standartMinRadius, distance * 0.5);
|
|
|
- //console.log('focus dis', distance)
|
|
|
+ this.maxRadius = Math.max(this.maxRadius, distance);
|
|
|
+ console.log('focusOnObject radius ', viewer.mainViewport.view.radius);
|
|
|
}
|
|
|
});
|
|
|
}
|
|
@@ -84921,7 +84938,7 @@
|
|
|
var distance = MathUtils.clamp(dis, 0.8 * object.scale.x, Math.max(len * 0.1, 3 * object.scale.x));
|
|
|
this.minRadius = Math.min(distance, standartMinRadius);
|
|
|
this.maxRadius = dis * 2;
|
|
|
- //console.log('maxRadius hasIntersect', this.maxRadius)
|
|
|
+ //console.log('maxRadius hasIntersect', this.maxRadius)
|
|
|
return distance;
|
|
|
}
|
|
|
updateRadius(type) {
|