Forráskód Böngészése

Added a setFloat() that takes a Float to avoid
auto-boxing in the case where a Float is already
at hand.

pspeed42 11 éve
szülő
commit
3cf0e35a17
1 módosított fájl, 11 hozzáadás és 0 törlés
  1. 11 0
      jme3-core/src/main/java/com/jme3/material/Material.java

+ 11 - 0
jme3-core/src/main/java/com/jme3/material/Material.java

@@ -635,6 +635,17 @@ public class Material implements CloneableSmartAsset, Cloneable, Savable {
         setParam(name, VarType.Float, value);
     }
 
+    /**
+     * Pass a float to the material shader.  This version avoids auto-boxing
+     * if the value is already a Float.
+     *
+     * @param name the name of the float defined in the material definition (j3md)
+     * @param value the float value
+     */
+    public void setFloat(String name, Float value) {
+        setParam(name, VarType.Float, value);
+    }
+
     /**
      * Pass an int to the material shader.
      *