소스 검색

* Fix colors reference issue in MTL loader

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7537 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
sha..rd 14 년 전
부모
커밋
c9a5e0953a
1개의 변경된 파일4개의 추가작업 그리고 4개의 파일을 삭제
  1. 4 4
      engine/src/core-plugins/com/jme3/scene/plugins/MTLLoader.java

+ 4 - 4
engine/src/core-plugins/com/jme3/scene/plugins/MTLLoader.java

@@ -111,15 +111,15 @@ public class MTLLoader implements AssetLoader {
         
         if (shadeless){
             material = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
-            material.setColor("Color", diffuse);
+            material.setColor("Color", diffuse.clone());
             material.setTexture("ColorMap", diffuseMap);
             // TODO: Add handling for alpha map?
         }else{
             material = new Material(assetManager, "Common/MatDefs/Light/Lighting.j3md");
             material.setBoolean("UseMaterialColors", true);
-            material.setColor("Ambient",  ambient);
-            material.setColor("Diffuse",  diffuse);
-            material.setColor("Specular", specular);
+            material.setColor("Ambient",  ambient.clone());
+            material.setColor("Diffuse",  diffuse.clone());
+            material.setColor("Specular", specular.clone());
             material.setFloat("Shininess", shininess); // prevents "premature culling" bug
             
             if (diffuseMap != null)  material.setTexture("DiffuseMap", diffuseMap);