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