浏览代码

let every material have it's own reflection color

Currently every Material gets the same color object as reflection color. I consider this a bug since changing the value of one color changes the colors of all materials.
tauli 6 年之前
父节点
当前提交
84d297970f
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      Viewer/src/model/viewerModel.ts

+ 2 - 2
Viewer/src/model/viewerModel.ts

@@ -557,7 +557,7 @@ export class ViewerModel implements IDisposable {
                 material.disableLighting = !this._modelConfiguration.material.directEnabled;
             }
             if (this._configurationContainer && this._configurationContainer.reflectionColor) {
-                material.reflectionColor = this._configurationContainer.reflectionColor;
+                material.reflectionColor = this._configurationContainer.reflectionColor.clone();
             }
         }
         else if (material instanceof MultiMaterial) {
@@ -762,4 +762,4 @@ export class ViewerModel implements IDisposable {
         this._animations.length = 0;
         this.rootMesh.dispose(false, true);
     }
-}
+}