|
@@ -5425,6 +5425,7 @@ export class Viewer extends ViewerBase{
|
|
|
return console.warn('已设置过pointStatesBefore!')
|
|
|
}
|
|
|
this.pointStatesBefore = {
|
|
|
+ colorType: new Map(),
|
|
|
opacity : new Map(),
|
|
|
size: new Map(),
|
|
|
density:Potree.settings.pointDensity,
|
|
@@ -5434,7 +5435,7 @@ export class Viewer extends ViewerBase{
|
|
|
|
|
|
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) //这项不一定有用,因为会被后期覆盖
|
|
|
})
|
|
|
|
|
@@ -5442,7 +5443,7 @@ export class Viewer extends ViewerBase{
|
|
|
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)
|
|
@@ -5459,7 +5460,7 @@ export class Viewer extends ViewerBase{
|
|
|
|
|
|
|
|
|
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
|
|
|
|