|
@@ -4594,10 +4594,11 @@
|
|
|
replaceAll: function replaceAll(str, f, e) {
|
|
|
//f全部替换成e
|
|
|
|
|
|
- if (str.replaceAll) return str.replaceAll(f, e);else {
|
|
|
- var reg = new RegExp(f, "g"); //创建正则RegExp对象
|
|
|
- return str.replace(reg, e); //str.split(f).join(e);
|
|
|
- }
|
|
|
+ /* if(str.replaceAll ) return str.replaceAll(f, e)
|
|
|
+ else{ */
|
|
|
+ var reg = new RegExp(f, "g"); //创建正则RegExp对象
|
|
|
+ return str.replace(reg, e); //str.split(f).join(e);
|
|
|
+ //}
|
|
|
},
|
|
|
dealURL(url) {
|
|
|
var urlNew = this.replaceAll(url, "\\+", "%2B"); // 浏览器似乎不支持访问带+的地址
|
|
@@ -19680,8 +19681,8 @@
|
|
|
};
|
|
|
Utils.datasetRotTransform = function () {
|
|
|
var o = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
|
- var pointcloud = o.pointcloud || viewer.scene.pointclouds.find(e => e.dataset_id == o.datasetId);
|
|
|
- if (pointcloud) {
|
|
|
+ var object = o.pointcloud || viewer.scene.pointclouds.find(e => e.dataset_id == o.datasetId) || o.object || viewer.objs.children.find(e => e.dataset_id == o.datasetId);
|
|
|
+ if (object) {
|
|
|
var matrix, newMatrix, result;
|
|
|
if (o.rotation) {
|
|
|
matrix = new Matrix4().makeRotationFromEuler(o.rotation);
|
|
@@ -19692,7 +19693,13 @@
|
|
|
} else {
|
|
|
return;
|
|
|
}
|
|
|
- var rotateMatrix = o.fromDataset ? pointcloud.rotateMatrix : pointcloud.rotateInvMatrix;
|
|
|
+ var rotateMatrix = o.fromDataset ? object.rotateMatrix : object.rotateInvMatrix;
|
|
|
+ if (!rotateMatrix) {
|
|
|
+ rotateMatrix = new Matrix4().makeRotationFromEuler(object.rotation); //如果是没有漫游点的模型,在此临时获取一个,但和有漫游点的比会有所不同,因为没有初始旋转(如转90度)
|
|
|
+ if (o.toDataset) {
|
|
|
+ rotateMatrix.invert();
|
|
|
+ }
|
|
|
+ }
|
|
|
newMatrix = new Matrix4().multiplyMatrices(rotateMatrix, matrix);
|
|
|
if (o.getRotation) {
|
|
|
result = new Euler().setFromRotationMatrix(newMatrix);
|
|
@@ -77280,7 +77287,6 @@
|
|
|
//反向求transformMatrix 参考Alignment.js 移动漫游点
|
|
|
if (model.isPointcloud && model.transformMatrix) {
|
|
|
model.transformMatrix.multiplyMatrices(model.matrix, model.pos1MatrixInvert);
|
|
|
- model.transformInvMatrix.copy(model.transformMatrix).invert();
|
|
|
model.rotateMatrix = new Matrix4().makeRotationFromEuler(model.rotation);
|
|
|
model.panos.forEach(e => e.transformByPointcloud());
|
|
|
} else if (model.panos) {
|
|
@@ -77289,6 +77295,10 @@
|
|
|
model.panos.forEach(e => e.transformByPointcloud());
|
|
|
model.bound = model.boundingBox.clone().applyMatrix4(model.matrixWorld);
|
|
|
}
|
|
|
+ if (model.panos) {
|
|
|
+ model.transformInvMatrix.copy(model.transformMatrix).invert();
|
|
|
+ model.rotateInvMatrix.copy(model.rotateMatrix).invert();
|
|
|
+ }
|
|
|
model.lastMatrixWorld = model.matrixWorld.clone();
|
|
|
viewer.dispatchEvent('content_changed');
|
|
|
viewer.mapViewer && Potree.settings.showObjectsOnMap && viewer.mapViewer.dispatchEvent('content_changed');
|
|
@@ -77439,8 +77449,10 @@
|
|
|
|
|
|
要注意getHoveredElements只在getIntersect时才使interactables包含加载的model, 也就是model上不能有使之成为interactables的事件,否则在鼠标hover到模型上开始转动的一瞬间很卡。
|
|
|
|
|
|
-
|
|
|
-
|
|
|
+ 控制台断开完全重合的漫游点的方法
|
|
|
+ window.pano1 = viewer.modules.PanoEditor.selectedPano //选中第一个点后输入这行,得到第一个漫游点
|
|
|
+ window.pano2 = viewer.modules.PanoEditor.selectedPano //选中第二个点后输入这行,得到第二个漫游点
|
|
|
+ viewer.modules.PanoEditor.linkChange(window.pano1, window.pano2, 'remove') //断开链接
|
|
|
|
|
|
|
|
|
*/
|
|
@@ -79924,7 +79936,7 @@
|
|
|
fromDataset: true,
|
|
|
quaternion: e.rotInModel,
|
|
|
getQuaternion: true,
|
|
|
- model: e.model
|
|
|
+ object: e.model
|
|
|
});
|
|
|
sections.push(e);
|
|
|
}
|
|
@@ -92802,6 +92814,8 @@
|
|
|
model.rot1MatrixInvert = rot1M.clone().invert();
|
|
|
model.transformMatrix = new THREE.Matrix4();
|
|
|
model.rotateMatrix = new THREE.Matrix4();
|
|
|
+ model.transformInvMatrix = new THREE.Matrix4();
|
|
|
+ model.rotateInvMatrix = new THREE.Matrix4();
|
|
|
model.datasetData = {
|
|
|
sceneVersion: 'V4'
|
|
|
};
|