瀏覽代碼

Adding uncommited methods (sorry for breaking the build).

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9417 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
Kae..pl 13 年之前
父節點
當前提交
7ff1261d79
共有 1 個文件被更改,包括 32 次插入0 次删除
  1. 32 0
      engine/src/blender/com/jme3/scene/plugins/blender/textures/TexturePixel.java

+ 32 - 0
engine/src/blender/com/jme3/scene/plugins/blender/textures/TexturePixel.java

@@ -87,6 +87,38 @@ public class TexturePixel implements Cloneable {
 		this.intensity = intensity >= 0 ? intensity / 255.0f : 1.0f - ~intensity / 255.0f;
 	}
 	
+	/**
+	 * Copies the intensity from the given value.
+	 * 
+	 * @param intensity
+	 *            the intensity value
+	 */
+	public void fromIntensity(short intensity) {
+		this.intensity = intensity >= 0 ? intensity / 65535.0f : 1.0f - ~intensity / 65535.0f;
+	}
+	
+	/**
+	 * This method sets the alpha value (converts it to float number from range
+	 * <0, 1>).
+	 * 
+	 * @param alpha
+	 *            the alpha value
+	 */
+	public void setAlpha(byte alpha) {
+		this.alpha = alpha >= 0 ? alpha / 255.0f : 1.0f - ~alpha / 255.0f;
+	}
+
+	/**
+	 * This method sets the alpha value (converts it to float number from range
+	 * <0, 1>).
+	 * 
+	 * @param alpha
+	 *            the alpha value
+	 */
+	public void setAlpha(short alpha) {
+		this.alpha = alpha >= 0 ? alpha / 65535.0f : 1.0f - ~alpha / 65535.0f;
+	}
+	
 	/**
 	 * Copies the values from the given integer that stores the ARGB8 data.
 	 *