瀏覽代碼

J3MLoader can now read the LightSpace attribute

Nehon 10 年之前
父節點
當前提交
7ab9798ad7
共有 1 個文件被更改,包括 14 次插入1 次删除
  1. 14 1
      jme3-core/src/plugins/java/com/jme3/material/plugins/J3MLoader.java

+ 14 - 1
jme3-core/src/plugins/java/com/jme3/material/plugins/J3MLoader.java

@@ -112,9 +112,20 @@ public class J3MLoader implements AssetLoader {
         if (split.length != 2){
             throw new IOException("LightMode statement syntax incorrect");
         }
-        LightMode lm = LightMode.valueOf(split[1]);
+        LightMode lm = LightMode.valueOf(split[1]);        
         technique.setLightMode(lm);
     }
+    
+    
+    // LightMode <SPACE>
+    private void readLightSpace(String statement) throws IOException{
+        String[] split = statement.split(whitespacePattern);
+        if (split.length != 2){
+            throw new IOException("LightSpace statement syntax incorrect");
+        }
+        TechniqueDef.LightSpace ls = TechniqueDef.LightSpace.valueOf(split[1]);        
+        technique.setLightSpace(ls);
+    }
 
     // ShadowMode <MODE>
     private void readShadowMode(String statement) throws IOException{
@@ -415,6 +426,8 @@ public class J3MLoader implements AssetLoader {
             readShaderStatement(statement.getLine());
         }else if (split[0].equals("LightMode")){
             readLightMode(statement.getLine());
+        }else if (split[0].equals("LightSpace")){
+            readLightSpace(statement.getLine());
         }else if (split[0].equals("ShadowMode")){
             readShadowMode(statement.getLine());
         }else if (split[0].equals("WorldParameters")){