|
@@ -8253,6 +8253,9 @@
|
|
|
getKelvinFromCelsius(c) {
|
|
|
//摄氏度->开尔文
|
|
|
return c + 273.1; //273.15 算法的值是整数然后除以10所以只保留一位小数
|
|
|
+ },
|
|
|
+ getCelsiusFromKelvin(c) {
|
|
|
+ return c - 273.1;
|
|
|
}
|
|
|
};
|
|
|
|
|
@@ -20207,9 +20210,17 @@
|
|
|
position: this.root.getWorldPosition(new Vector3()),
|
|
|
resolution: e.viewport.resolution //2
|
|
|
}));
|
|
|
+ if (this.root.parent) {
|
|
|
+ var scale_ = this.root.parent.getWorldScale(new Vector3());
|
|
|
+ scale = new Vector3(scale / scale_.x, scale / scale_.y, scale / scale_.z);
|
|
|
+ }
|
|
|
}
|
|
|
- if (!isNaN(scale)) {
|
|
|
- this.root.scale.set(scale, scale, scale);
|
|
|
+ if (typeof scale == 'number') {
|
|
|
+ if (!isNaN(scale)) {
|
|
|
+ this.root.scale.set(scale, scale, scale);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.root.scale.copy(scale);
|
|
|
}
|
|
|
}
|
|
|
this.updateMatrix();
|
|
@@ -24207,8 +24218,9 @@
|
|
|
};
|
|
|
if (dataset.has_ir) {
|
|
|
//红外热成像漫游点数据
|
|
|
- var panoIrUrl = "".concat(Potree.settings.urls.prefix1, "/testdata/").concat(Potree.settings.number, "/data/").concat(pointcloud.sceneCode, "/imagemap/types.json");
|
|
|
- Potree.loadFile(panoIrUrl, null, e => {
|
|
|
+ pointcloud.typesUrl = "".concat(Potree.settings.urls.prefix1, "/").concat(Potree.settings.webSite2 || Potree.settings.webSite, "/").concat(pointcloud.sceneCode, "/data/").concat(pointcloud.sceneCode, "/imagemap/");
|
|
|
+ var typesUrl = pointcloud.typesUrl + 'types.json';
|
|
|
+ Potree.loadFile(typesUrl, null, e => {
|
|
|
e.imagemap_types.forEach(o => {
|
|
|
o.uuids.forEach(uuid => {
|
|
|
//if(o.property == 'temp')return //只要ir
|
|
@@ -25620,7 +25632,7 @@
|
|
|
},
|
|
|
opacity: {
|
|
|
type: 'f',
|
|
|
- value: 1
|
|
|
+ value: o.opacity == void 0 ? 1 : o.opacity
|
|
|
}
|
|
|
},
|
|
|
vertexShader: Shaders['basicTextured.vs'],
|
|
@@ -25629,7 +25641,7 @@
|
|
|
HasColor: ''
|
|
|
}
|
|
|
}, o));
|
|
|
- this.opacity = o.opacity == void 0 ? 1 : o.opacity;
|
|
|
+ //this.opacity = o.opacity == void 0 ? 1 : o.opacity
|
|
|
}
|
|
|
copy(source) {
|
|
|
super.copy(source);
|
|
@@ -25640,7 +25652,7 @@
|
|
|
}
|
|
|
set opacity(o) {
|
|
|
this.uniforms && (this.uniforms.opacity.value = o);
|
|
|
- this.transparent = o < 1;
|
|
|
+ //this.transparent = o<1
|
|
|
}
|
|
|
get opacity() {
|
|
|
return this.uniforms.opacity.value;
|
|
@@ -29895,8 +29907,8 @@
|
|
|
} */
|
|
|
loadTypeImg(type) {
|
|
|
if (!this['has_' + type] || this[type + 'Tex'] || this[type + 'Loading']) return;
|
|
|
- var url = "".concat(Potree.settings.urls.prefix1, "/testdata/").concat(Potree.settings.number, "/data/").concat(this.pointcloud.sceneCode, "/imagemap/").concat(this.originID, "_").concat(type, ".png");
|
|
|
- //let url = `${Potree.settings.urls.prefix1}/testdata/${Potree.settings.number}/data/${this.pointcloud.sceneCode}/imagemap/${this.originID}_temp.png`
|
|
|
+ var url = this.pointcloud.typesUrl + "".concat(this.originID, "_").concat(type, ".png");
|
|
|
+ //let url = `${Potree.settings.urls.prefix1}/testdata/${this.pointcloud.sceneCode}/data/${this.pointcloud.sceneCode}/imagemap/${this.originID}_temp.png`
|
|
|
|
|
|
var range = {
|
|
|
min: Infinity,
|
|
@@ -29923,13 +29935,16 @@
|
|
|
this[type + 'Tex'] = texture;
|
|
|
if (getRangeFun) {
|
|
|
if (type == 'ir') {
|
|
|
- /* let p = [range.minPixel_, range.maxPixel_].map(index=>{
|
|
|
- let row = Math.floor(index / texture.image.width)
|
|
|
- let col = index % texture.image.width
|
|
|
- return {x:col,y:row}
|
|
|
- })
|
|
|
- range.minPixel = p[0]
|
|
|
- range.maxPixel = p[1] */
|
|
|
+ var p = [range.minPixel_, range.maxPixel_].map(index => {
|
|
|
+ var row = Math.floor(index / texture.image.width);
|
|
|
+ var col = index % texture.image.width;
|
|
|
+ return {
|
|
|
+ x: col,
|
|
|
+ y: row
|
|
|
+ };
|
|
|
+ });
|
|
|
+ range.minPixel = p[0];
|
|
|
+ range.maxPixel = p[1];
|
|
|
var pixelCount = texture.image.width * texture.image.height;
|
|
|
var stopMemberCount = 50;
|
|
|
['min', 'max'].forEach(name => {
|
|
@@ -29940,7 +29955,7 @@
|
|
|
return (Math.abs(A.x - B.x) <= 1 || Math.abs(A.x - B.x) == texture.image.width - 1) && Math.abs(A.y - B.y) <= 1;
|
|
|
};
|
|
|
for (var i = 0; i < pixelCount; i++) {
|
|
|
- if (Math.abs(value - pixels[i]) < 2) {
|
|
|
+ if (Math.abs(value - pixels[i]) == 0) {
|
|
|
var row = Math.floor(i / texture.image.width);
|
|
|
var col = i % texture.image.width;
|
|
|
var data = {
|
|
@@ -29948,14 +29963,14 @@
|
|
|
y: row,
|
|
|
value: pixels[i]
|
|
|
};
|
|
|
- Potree.Common.pushToGroupAuto([data], groups, isNeigh /* , recognizeGroup */);
|
|
|
+ Potree.Common.pushToGroupAuto([data], groups, isNeigh);
|
|
|
if (groups.some(e => e.length > stopMemberCount && e.some(e => e == range[name]))) {
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
var groups2 = groups.filter(e => e.length > 1);
|
|
|
- if (groups2.length == 0) groups2 = groups;
|
|
|
+ if (groups2.length < 3) groups2 = groups;
|
|
|
groups2.forEach(group => {
|
|
|
//x的因边界不好写,就只判断y尽量接近中间且范围不大不小即可
|
|
|
group.sort((a, b) => {
|
|
@@ -29965,14 +29980,16 @@
|
|
|
var maxY = group[group.length - 1].y;
|
|
|
var centerY = (minY + maxY) / 2;
|
|
|
var rectRatio = (maxY - minY) * 1; //除非竖的一列,否则一般y范围越大越好 Math.abs(2 - Potree.math.getBaseLog(maxY - minY, group.length)) //范围圆润度, 最好个数是y范围的平方
|
|
|
- group.score = group.length * 0.4 + rectRatio - Math.abs(texture.image.height / 2 - centerY) * 0.02; //y尽量接近中间
|
|
|
+ group.score = group.length * 0.2 + rectRatio - Math.abs(texture.image.height / 2 - centerY) * 0.5; //y尽量接近中间
|
|
|
+
|
|
|
group.center = group[Math.floor(group.length / 2)]; //忽略是否横向的中间
|
|
|
});
|
|
|
groups2.sort((b, a) => {
|
|
|
return a.score - b.score;
|
|
|
});
|
|
|
range[name + 'Pixel'] = (_groups2$ = groups2[0]) === null || _groups2$ === void 0 ? void 0 : _groups2$.center;
|
|
|
- //console.log('groups2', this.id, name,groups2)
|
|
|
+ //range[name+'PixelGroup'] = groups2
|
|
|
+ console.log('groups2', this.id, name, groups2);
|
|
|
});
|
|
|
}
|
|
|
range.min /= 10, range.max /= 10;
|
|
@@ -33596,7 +33613,7 @@
|
|
|
btnHot.on('click', () => {
|
|
|
onHot = !onHot;
|
|
|
Potree.settings.showHotIr = onHot;
|
|
|
- btnHot.text((btnHot ? '关闭' : '打开') + '热成像');
|
|
|
+ btnHot.text((onHot ? '关闭' : '打开') + '热成像');
|
|
|
});
|
|
|
}
|
|
|
if (attrs.temp) {
|
|
@@ -33621,6 +33638,8 @@
|
|
|
}
|
|
|
clearInterval(interval);
|
|
|
}, 100);
|
|
|
+ }, {
|
|
|
+ once: true
|
|
|
});
|
|
|
}
|
|
|
var elDisplayModel = $("<input type='button' value='>>全景'></input>");
|
|
@@ -37928,7 +37947,9 @@
|
|
|
// RENDER
|
|
|
|
|
|
var mat = params.material || traversalResult.octrees[0].material;
|
|
|
- if (Potree.settings.cloudSameMat && viewer.scene.volumes.length == 0 && mat.pointSizeType != PointSizeType.ADAPTIVE && mat.activeAttributeName != "level of detail") {
|
|
|
+ var cloudSameMat = Potree.settings.cloudSameMat && !traversalResult.octrees.some(e => e.material.activeAttributeName != mat.activeAttributeName); //activeAttributeName都一样才行
|
|
|
+
|
|
|
+ if (cloudSameMat && viewer.scene.volumes.length == 0 && mat.pointSizeType != PointSizeType.ADAPTIVE && mat.activeAttributeName != "level of detail") {
|
|
|
this.renderOctree(traversalResult.octrees, null, camera, target, params); //所有点云除了个别属性需要在shader中更新,其他都使用第一个点云的材质
|
|
|
} else for (var octree of traversalResult.octrees) {
|
|
|
for (var _octree of traversalResult.octrees) {
|
|
@@ -48769,7 +48790,7 @@
|
|
|
multiColors[this.color] = colorObject;
|
|
|
{
|
|
|
//清理不用的colorObject
|
|
|
- var measures = viewer.scene.measurements.slice();
|
|
|
+ var measures = viewer.scene.measurements.filter(e => e instanceof Measure$1);
|
|
|
measures.includes(this) || measures.push(this);
|
|
|
for (var co in multiColors) {
|
|
|
multiColors[co].useCount = 0;
|
|
@@ -49147,14 +49168,7 @@
|
|
|
var CursorDeal = {
|
|
|
priorityEvent: [
|
|
|
//在前面的优先级高
|
|
|
-
|
|
|
{
|
|
|
- pen_delPoint: "url({Potree.resourcePath}/images/polygon_mark/pic_pen_sub.png),auto"
|
|
|
- }, {
|
|
|
- pen_addPoint: "url({Potree.resourcePath}/images/polygon_mark/pic_pen_add.png),auto"
|
|
|
- }, {
|
|
|
- pen: "url({Potree.resourcePath}/images/polygon_mark/pic_pen.png),auto"
|
|
|
- }, {
|
|
|
'grabbing': 'grabbing'
|
|
|
},
|
|
|
//通用
|
|
@@ -49163,6 +49177,12 @@
|
|
|
},
|
|
|
//通用
|
|
|
{
|
|
|
+ pen_delPoint: "url({Potree.resourcePath}/images/polygon_mark/pic_pen_sub.png),auto"
|
|
|
+ }, {
|
|
|
+ pen_addPoint: "url({Potree.resourcePath}/images/polygon_mark/pic_pen_add.png),auto"
|
|
|
+ }, {
|
|
|
+ pen: "url({Potree.resourcePath}/images/polygon_mark/pic_pen.png),auto"
|
|
|
+ }, {
|
|
|
'pointer': 'pointer'
|
|
|
},
|
|
|
//通用
|
|
@@ -49287,10 +49307,10 @@
|
|
|
var depthProps = {
|
|
|
useDepth: true,
|
|
|
//startClipDis : 0.5,
|
|
|
- clipDistance: 2,
|
|
|
+ clipDistance: 1.2,
|
|
|
//消失距离
|
|
|
//startOcclusDis: 0.5,
|
|
|
- occlusionDistance: 0.7,
|
|
|
+ occlusionDistance: 0.5,
|
|
|
//变为backColor距离
|
|
|
maxOcclusionFactor: 0.9,
|
|
|
maxClipFactor: 1
|
|
@@ -62310,7 +62330,8 @@
|
|
|
viewer.addEventListener('viewerResize', this.events.setSize);
|
|
|
viewer.addEventListener('update', this.events.update);
|
|
|
window.monitor = this;
|
|
|
- Potree.Utils.setObjectLayers(this, 'monitor');
|
|
|
+ Potree.Utils.setObjectLayers(this, 'model');
|
|
|
+ Potree.Utils.setObjectLayers(this.cylinder.bottom, 'monitor');
|
|
|
}
|
|
|
modelLoaded() {
|
|
|
this.cameraModel.addEventListener('mouseover', () => {
|
|
@@ -62920,6 +62941,11 @@
|
|
|
viewer.objs.traverse(e => {
|
|
|
if (e.material) e._OlddepthWrite = e.material.depthWrite, e.material.depthWrite = true;
|
|
|
}); //否则半透明的mesh无法遮住测量线
|
|
|
+ viewer.dispatchEvent({
|
|
|
+ type: "render.begin2",
|
|
|
+ viewer,
|
|
|
+ viewport: params.viewport
|
|
|
+ });
|
|
|
renderer.render(viewer.scene.scene, camera);
|
|
|
viewer.objs.traverse(e => {
|
|
|
if (e.material) e.material.depthWrite = e._OlddepthWrite;
|
|
@@ -63872,10 +63898,10 @@
|
|
|
percent = easing.easeOutSine(originPercent-(1-easePercent), 1-easePercent, easePercent, easePercent)
|
|
|
} */
|
|
|
|
|
|
- var position = this.posCurve.getPointAt(percent); // 需要this.posCurve.points.length>1 否则报错
|
|
|
- var quaternion;
|
|
|
+ var quaternion, position;
|
|
|
if (this.quaFromCurveTan) {
|
|
|
//沿着curve行走,目视curve前方
|
|
|
+ position = this.posCurve.getPointAt(percent);
|
|
|
var percent2 = percent + (this.tangentDt || 0.001);
|
|
|
if (percent2 <= 1) {
|
|
|
var position2 = this.posCurve.getPointAt(percent2);
|
|
@@ -63893,21 +63919,22 @@
|
|
|
var nextIndexPercent = this.newPointsPercents[this.currentIndex + 1];
|
|
|
var progress = (percent - curIndexPercent) / (nextIndexPercent - curIndexPercent); //在这两个节点间的百分比
|
|
|
|
|
|
- //投影到原本的 posCurve.pointsPercent上:
|
|
|
- var curIndexOriPercent = this.posCurve.pointsPercent[this.currentIndex];
|
|
|
- var nextIndexOriPercent = this.posCurve.pointsPercent[this.currentIndex + 1];
|
|
|
- percent = curIndexOriPercent + (nextIndexOriPercent - curIndexOriPercent) * progress;
|
|
|
var endQuaternion = this.quaternions[this.currentIndex + 1];
|
|
|
var startQuaternion = this.quaternions[this.currentIndex];
|
|
|
quaternion = new Quaternion().copy(startQuaternion);
|
|
|
lerp.quaternion(quaternion, endQuaternion)(progress);
|
|
|
|
|
|
+ //投影到原本的 posCurve.pointsPercent上:
|
|
|
+ var curIndexOriPercent = this.posCurve.pointsPercent[this.currentIndex];
|
|
|
+ var nextIndexOriPercent = this.posCurve.pointsPercent[this.currentIndex + 1];
|
|
|
+ percent = curIndexOriPercent + (nextIndexOriPercent - curIndexOriPercent) * progress;
|
|
|
/* if(this.posInterpolate){
|
|
|
let endPos = this.posCurve.points[this.currentIndex+1]
|
|
|
let startPos = this.posCurve.points[this.currentIndex]
|
|
|
position = (new THREE.Vector3()).copy(startPos)
|
|
|
lerp.vector(position, endPos)(progress)
|
|
|
} */
|
|
|
+ position = this.posCurve.getPointAt(percent); // 需要this.posCurve.points.length>1 否则报错
|
|
|
} else {
|
|
|
this.currentIndex = this.posCurve.points.length - 1;
|
|
|
quaternion = this.quaternions[this.currentIndex];
|
|
@@ -64017,7 +64044,7 @@
|
|
|
var frame = this.at(percent, e.delta, transitionRatio);
|
|
|
if (currentIndex != this.currentIndex) {
|
|
|
currentIndex = this.currentIndex;
|
|
|
- //console.log('updateCurrentIndex', currentIndex)
|
|
|
+ console.log('updateCurrentIndex', currentIndex);
|
|
|
this.dispatchEvent({
|
|
|
type: 'updateCurrentIndex',
|
|
|
currentIndex
|
|
@@ -69449,11 +69476,11 @@
|
|
|
if (!state || state == 'stop') {
|
|
|
if (!video.paused) {
|
|
|
video.pause();
|
|
|
- console.log('videoControl paused ');
|
|
|
+ //console.log('videoControl paused ')
|
|
|
}
|
|
|
} else if (state) {
|
|
|
if (video.paused) {
|
|
|
- console.log('videoControl play ');
|
|
|
+ //console.log('videoControl play ')
|
|
|
//video = this.loadVideo()
|
|
|
video.play();
|
|
|
}
|
|
@@ -69472,7 +69499,7 @@
|
|
|
//side为0
|
|
|
var dir = overlay.plane.getWorldDirection(new Vector3());
|
|
|
if (dir.dot(camDir) > 0) {
|
|
|
- console.log('dir.dot(camDir)', dir.dot(camDir));
|
|
|
+ //console.log('dir.dot(camDir)',dir.dot(camDir))
|
|
|
return false;
|
|
|
}
|
|
|
//可能看到背面。若能看到正面,视线方向和plane朝向必定为钝角
|
|
@@ -75517,6 +75544,7 @@
|
|
|
data.object.dispatchEvent('changeByHistory');
|
|
|
data.object.dispatchEvent('transformChanged');
|
|
|
viewer.dispatchEvent('content_changed');
|
|
|
+ //回退到上一次编辑的全局位置
|
|
|
return true;
|
|
|
}
|
|
|
},
|
|
@@ -75968,19 +75996,6 @@
|
|
|
this.bus.dispatchEvent('changeSelect');
|
|
|
},
|
|
|
updateBoxHelper(model) {
|
|
|
- /* let size = new THREE.Vector3
|
|
|
- model.boundingBox.getSize(size)
|
|
|
- size.multiply(model.scale)
|
|
|
- this.boxHelper.scale.copy(size)
|
|
|
-
|
|
|
- let center = new THREE.Vector3
|
|
|
- model.boundingBox.getCenter(center)
|
|
|
- center.applyMatrix4(model.matrixWorld)
|
|
|
- //center.add(model.position)
|
|
|
- this.boxHelper.position.copy(center)
|
|
|
-
|
|
|
- this.boxHelper.quaternion.copy(model.quaternion) */
|
|
|
-
|
|
|
var size = new Vector3();
|
|
|
model.boundingBox.getSize(size);
|
|
|
size.multiply(model.getWorldScale(new Vector3()));
|
|
@@ -75990,10 +76005,6 @@
|
|
|
center.applyMatrix4(model.matrixWorld);
|
|
|
this.boxHelper.position.copy(center);
|
|
|
model.getWorldQuaternion(this.boxHelper.quaternion);
|
|
|
-
|
|
|
- /* this.boxHelper.scale.copy(model.getWorldScale(new THREE.Vector3))
|
|
|
- this.boxHelper.quaternion.copy(model.getWorldQuaternion(new THREE.Quaternion))
|
|
|
- this.boxHelper.position.copy(model.getWorldPosition(new THREE.Vector3)) */
|
|
|
viewer.dispatchEvent('content_changed');
|
|
|
},
|
|
|
showModelOutline(model, state) {
|
|
@@ -82289,43 +82300,60 @@
|
|
|
var _keys4, _keys5;
|
|
|
//计算每个动作权重(幅度)。
|
|
|
|
|
|
- if (delta == void 0) {
|
|
|
- //无缓动
|
|
|
- return time >= key.time && time <= key.time + key.dur ? 1 : 0;
|
|
|
- }
|
|
|
+ /* if(delta == void 0){//无缓动 但会造成和缓动时动作time不同
|
|
|
+ return time >= key.time && time <= key.time + key.dur ? 1 : 0
|
|
|
+ } */
|
|
|
+
|
|
|
var fadeTimeStart = Math.min(maxClipFadeTime, key.dur, ((_keys4 = _keys3[i - 1]) === null || _keys4 === void 0 ? void 0 : _keys4.dur) || maxClipFadeTime) / 2; //过渡时间不超过当前和前一个的 half of dur
|
|
|
var fadeTimeEnd = Math.min(maxClipFadeTime, key.dur, ((_keys5 = _keys3[i + 1]) === null || _keys5 === void 0 ? void 0 : _keys5.dur) || maxClipFadeTime) / 2; //过渡时间不超过当前和后一个的 half of dur
|
|
|
|
|
|
- var startTime2 = key.time + fadeTimeStart;
|
|
|
- var endTime2 = key.time + key.dur - fadeTimeEnd;
|
|
|
- if (time >= startTime2 && time <= endTime2) return 1;
|
|
|
var startTime1 = key.time - fadeTimeStart;
|
|
|
var endTime1 = key.time + key.dur + fadeTimeEnd;
|
|
|
if (time < startTime1 || time > endTime1) return 0; //out bound
|
|
|
|
|
|
+ key.tempTime_ = time - startTime1; //当前动作时间
|
|
|
+
|
|
|
+ var startTime2 = key.time + fadeTimeStart;
|
|
|
+ var endTime2 = key.time + key.dur - fadeTimeEnd;
|
|
|
+ if (time >= startTime2 && time <= endTime2) return 1;
|
|
|
if (time < startTime2) {
|
|
|
return Potree.math.linearClamp(time, [startTime1, startTime2], [0, 1]);
|
|
|
} else {
|
|
|
return Potree.math.linearClamp(time, [endTime2, endTime1], [1, 0]);
|
|
|
}
|
|
|
- }); //最多有两个>0的,在过渡, 且能保证两个是不同的action
|
|
|
+ }); //最多有两个>0的,在过渡
|
|
|
|
|
|
var animateActions = []; //在播的动作
|
|
|
_keys3.forEach((key, i) => {
|
|
|
- weights[i] > 0 && !animateActions.includes(key.action) && animateActions.push(key.action);
|
|
|
+ weights[i] > 0 && !animateActions.includes(key.action) && (animateActions.push(key.action), key.action.tempSW_ = {
|
|
|
+ scale: 0,
|
|
|
+ weight: 0,
|
|
|
+ time: null
|
|
|
+ });
|
|
|
});
|
|
|
+ //万一前后是一个动作…… 所以用tempSW_计算总值
|
|
|
+
|
|
|
_keys3.forEach((key, i) => {
|
|
|
if (animateActions.includes(key.action)) {
|
|
|
var weight = weights[i] * key.weight; //权重乘以自身幅度
|
|
|
if (weight > 0) {
|
|
|
key.action.play();
|
|
|
- key.action.setEffectiveTimeScale(weights[i] * key.speed); //乘以一个weight缓动
|
|
|
- key.action.setEffectiveWeight(weight);
|
|
|
+ key.action.paused = time != key.time || delta != void 0; //停在某帧 //如果没有点击该动作块的话 不停
|
|
|
+
|
|
|
+ key.action.tempSW_.time == null && (key.action.tempSW_.time = key.tempTime_); //相同动作优先用前一个的时间
|
|
|
+ key.action.tempSW_.scale += weights[i] * key.speed; //乘以一个weight缓动
|
|
|
+ key.action.tempSW_.weight += weight;
|
|
|
}
|
|
|
} else {
|
|
|
- key.action.stop();
|
|
|
+ key.action.stop(); //不启动动画
|
|
|
}
|
|
|
});
|
|
|
+ animateActions.forEach(action => {
|
|
|
+ action.setEffectiveTimeScale(action.tempSW_.scale);
|
|
|
+ action.setEffectiveWeight(action.tempSW_.weight);
|
|
|
+ action.time = action.tempSW_.time % action._clip.duration;
|
|
|
+ });
|
|
|
+
|
|
|
//model.mixer.timeScale = 1 ;
|
|
|
};
|
|
|
for (var [_model3, _keys3] of this.clipKeys) {
|
|
@@ -82685,7 +82713,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
+
|
|
|
+ 如果人的bone attach 物品,物品就被add到人身上,需要click出物品
|
|
|
+ //测试:为人加物体, 需要先选中物品
|
|
|
+ let obj = viewer.modules.MergeEditor.selected
|
|
|
+ viewer.objs.children.find(e=>e.name == 'Man.glb').skeletonHelper.bones[34].attach(obj); //左手骨和物品绑定
|
|
|
+ //viewer.objs.children.find(e=>e.name == 'Soldier.glb').skeletonHelper.bones[9].attach(obj); //右手骨和物品绑定
|
|
|
+ obj.updateMatrixWorld()
|
|
|
+ obj.dispatchEvent({type:'position_changed',byControl:true })
|
|
|
+ obj.dispatchEvent({type:'rotation_changed',byControl:true })
|
|
|
+
|
|
|
+
|
|
|
+ 物体带动骨骼自动做动作 setAniIK
|
|
|
*/
|
|
|
|
|
|
var texLoader$g = new TextureLoader();
|
|
@@ -82722,7 +82761,7 @@
|
|
|
{
|
|
|
var density;
|
|
|
var sizeType;
|
|
|
- var colorType;
|
|
|
+ var colorType = new Map();
|
|
|
var opacityBefore = new Map();
|
|
|
var sizeBefore = new Map();
|
|
|
var visiMap = new Map();
|
|
@@ -82731,7 +82770,7 @@
|
|
|
//因为更改pointDensity时会自动变opacity,所以这项最先获取
|
|
|
visiMap.set(e, e.visible);
|
|
|
e.visible = Potree.Utils.getObjVisiByReason(e, 'datasetSelection'); //先将隐藏的点云显示
|
|
|
-
|
|
|
+ colorType.set(e, e.material.activeAttributeName);
|
|
|
opacityBefore.set(e, e.temp.pointOpacity);
|
|
|
sizeBefore.set(e, e.temp.pointSize);
|
|
|
});
|
|
@@ -82744,8 +82783,7 @@
|
|
|
sizeType = e.material.pointSizeType;
|
|
|
e.material.pointSizeType = Potree.config.material.pointSizeType;
|
|
|
|
|
|
- //材质
|
|
|
- colorType = e.material.activeAttributeName;
|
|
|
+ //材质
|
|
|
e.material.activeAttributeName = 'rgba';
|
|
|
e.changePointOpacity(1);
|
|
|
//e.changePointSize(Potree.config.material.realPointSize, true)
|
|
@@ -82756,7 +82794,7 @@
|
|
|
viewer.scene.pointclouds.forEach(e => {
|
|
|
e.visible = visiMap.get(e);
|
|
|
e.material.pointSizeType = sizeType;
|
|
|
- e.material.activeAttributeName = colorType;
|
|
|
+ e.material.activeAttributeName = colorType.get(e);
|
|
|
e.changePointOpacity(opacityBefore.get(e));
|
|
|
//e.changePointSize(sizeBefore.get(e))
|
|
|
});
|
|
@@ -91860,6 +91898,7 @@
|
|
|
return console.warn('已设置过pointStatesBefore!');
|
|
|
}
|
|
|
this.pointStatesBefore = {
|
|
|
+ colorType: new Map(),
|
|
|
opacity: new Map(),
|
|
|
size: new Map(),
|
|
|
density: Potree.settings.pointDensity,
|
|
@@ -91868,13 +91907,13 @@
|
|
|
};
|
|
|
viewer.scene.pointclouds.forEach(e => {
|
|
|
this.pointStatesBefore.opacity.set(e, e.temp.pointOpacity); //因为更改pointDensity时会自动变opacity,所以这项最先获取
|
|
|
- this.pointStatesBefore.colorType = e.material.activeAttributeName;
|
|
|
+ this.pointStatesBefore.colorType.set(e, e.material.activeAttributeName);
|
|
|
fitPointsize && this.pointStatesBefore.size.set(e, e.temp.pointSize); //这项不一定有用,因为会被后期覆盖
|
|
|
});
|
|
|
if (pointDensity) Potree.settings.pointDensity = pointDensity; //万一之后切换到全景模式怎么办
|
|
|
if (fitPointsize) Potree.settings.sizeFitToLevel = true;
|
|
|
viewer.scene.pointclouds.forEach(e => {
|
|
|
- e.material.activeAttributeName = 'rgba';
|
|
|
+ e.material.activeAttributeName = this.pointStatesBefore.colorType.get(e) == 'ir' ? 'ir' : 'rgba';
|
|
|
e.material.shape = Potree.PointShape['SQUARE'];
|
|
|
fitPointsize && e.changePointSize(Potree.config.material.realPointSize, true);
|
|
|
e.changePointOpacity(1);
|
|
@@ -91887,7 +91926,7 @@
|
|
|
Potree.settings.sizeFitToLevel = false;
|
|
|
if (pointDensity) Potree.settings.pointDensity = this.pointStatesBefore.pointDensity;
|
|
|
viewer.scene.pointclouds.forEach(e => {
|
|
|
- e.material.activeAttributeName = this.pointStatesBefore.colorType;
|
|
|
+ e.material.activeAttributeName = this.pointStatesBefore.colorType.get(e);
|
|
|
e.changePointOpacity(this.pointStatesBefore.opacity.get(e));
|
|
|
e.material.shape = this.pointStatesBefore.shape;
|
|
|
var size = this.pointStatesBefore.size.get(e);
|
|
@@ -92260,7 +92299,21 @@
|
|
|
var label = new Potree.TextSprite({
|
|
|
text: "".concat(i, " : ").concat(bone.name),
|
|
|
sizeInfo: {
|
|
|
- width2d: 16000
|
|
|
+ width2d: 130
|
|
|
+ },
|
|
|
+ fontWeight: '',
|
|
|
+ fontsize: 20,
|
|
|
+ backgroundColor: {
|
|
|
+ r: 255,
|
|
|
+ g: 255,
|
|
|
+ b: 255,
|
|
|
+ a: 0
|
|
|
+ },
|
|
|
+ textColor: {
|
|
|
+ r: 255,
|
|
|
+ g: 255,
|
|
|
+ b: 255,
|
|
|
+ a: 1
|
|
|
}
|
|
|
});
|
|
|
label.sprite.material.depthTest = false;
|