|
|
|
@ -29,7 +29,6 @@ |
|
|
|
|
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
|
|
|
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
package com.jme3.material; |
|
|
|
|
|
|
|
|
|
import com.jme3.asset.TextureKey; |
|
|
|
@ -122,6 +121,7 @@ public class MatParam implements Savable, Cloneable { |
|
|
|
|
*/ |
|
|
|
|
void setName(String name) { |
|
|
|
|
this.name = name; |
|
|
|
|
this.prefixedName = "m_" + name; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
@ -187,16 +187,16 @@ public class MatParam implements Savable, Cloneable { |
|
|
|
|
// can be either ColorRGBA, Vector4f or Quaternion
|
|
|
|
|
if (value instanceof Vector4f) { |
|
|
|
|
Vector4f v4 = (Vector4f) value; |
|
|
|
|
return v4.getX() + " " + v4.getY() + " " + |
|
|
|
|
v4.getZ() + " " + v4.getW(); |
|
|
|
|
return v4.getX() + " " + v4.getY() + " " |
|
|
|
|
+ v4.getZ() + " " + v4.getW(); |
|
|
|
|
} else if (value instanceof ColorRGBA) { |
|
|
|
|
ColorRGBA color = (ColorRGBA) value; |
|
|
|
|
return color.getRed() + " " + color.getGreen() + " " + |
|
|
|
|
color.getBlue() + " " + color.getAlpha(); |
|
|
|
|
return color.getRed() + " " + color.getGreen() + " " |
|
|
|
|
+ color.getBlue() + " " + color.getAlpha(); |
|
|
|
|
} else if (value instanceof Quaternion) { |
|
|
|
|
Quaternion quat = (Quaternion) value; |
|
|
|
|
return quat.getX() + " " + quat.getY() + " " + |
|
|
|
|
quat.getZ() + " " + quat.getW(); |
|
|
|
|
return quat.getX() + " " + quat.getY() + " " |
|
|
|
|
+ quat.getZ() + " " + quat.getW(); |
|
|
|
|
} else { |
|
|
|
|
throw new UnsupportedOperationException("Unexpected Vector4 type: " + value); |
|
|
|
|
} |
|
|
|
@ -208,10 +208,12 @@ public class MatParam implements Savable, Cloneable { |
|
|
|
|
Texture texVal = (Texture) value; |
|
|
|
|
TextureKey texKey = (TextureKey) texVal.getKey(); |
|
|
|
|
String ret = ""; |
|
|
|
|
if (texKey.isFlipY()) |
|
|
|
|
if (texKey.isFlipY()) { |
|
|
|
|
ret += "Flip "; |
|
|
|
|
if (texVal.getWrap(Texture.WrapAxis.S) == WrapMode.Repeat) |
|
|
|
|
} |
|
|
|
|
if (texVal.getWrap(Texture.WrapAxis.S) == WrapMode.Repeat) { |
|
|
|
|
ret += "Repeat "; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return ret + texKey.getName(); |
|
|
|
|
default: |
|
|
|
@ -272,12 +274,13 @@ public class MatParam implements Savable, Cloneable { |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public boolean equals(Object other) { |
|
|
|
|
if (!(other instanceof MatParam)) |
|
|
|
|
if (!(other instanceof MatParam)) { |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
MatParam otherParam = (MatParam) other; |
|
|
|
|
return otherParam.type == type && |
|
|
|
|
otherParam.name.equals(name); |
|
|
|
|
return otherParam.type == type |
|
|
|
|
&& otherParam.name.equals(name); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@ -293,4 +296,3 @@ public class MatParam implements Savable, Cloneable { |
|
|
|
|
return type.name() + " " + name + " : " + getValueAsString(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|