public void setVector4InArray(float x, float y, float z, float w, int index){ if (location == -1) { return; } if (varType != null && varType != VarType.Vector4Array) { throw new IllegalArgumentException("Expected a " + varType.name() + " value!"); } multiData.position(index * 4); multiData.put(x).put(y).put(z).put(w); multiData.rewind(); updateNeeded = true; setByCurrentMaterial = true; }
public void write(MatParam param, OutputStreamWriter out) throws IOException { out.write(" "); out.write(param.getVarType().name()); out.write(" "); out.write(param.getName()); if (param instanceof MatParamTexture) { MatParamTexture paramTex = (MatParamTexture) param; String space = paramTex.getColorSpace() == ColorSpace.Linear ? "-LINEAR" : null; if (space != null) { out.write(" "); out.write(space); } } String value = formatValue(param); if (value != null) { out.write(" : "); out.write(value); } out.write("\n"); }
/** * Check if setting the parameter given the type and name is allowed. * @param type The type that the "set" function is designed to set * @param name The name of the parameter */ private void checkSetParam(VarType type, String name) { MatParam paramDef = def.getMaterialParam(name); if (paramDef == null) { throw new IllegalArgumentException("Material parameter is not defined: " + name); } if (type != null && paramDef.getVarType() != type) { logger.log(Level.WARNING, "Material parameter being set: {0} with " + "type {1} doesn''t match definition types {2}", new Object[]{name, type.name(), paramDef.getVarType()}); } }
if (!param.getVarType().name().endsWith("Array")) { throw new MatParseException(param.getName() + " is not of Array type", statement);
throw new IllegalArgumentException("Expected a " + varType.name() + " value!");
@Override public String toString() { return type.name() + " " + name + " : " + getValueAsString(); } }
public void setVector4InArray(float x, float y, float z, float w, int index){ if (location == -1) return; if (varType != null && varType != VarType.Vector4Array) throw new IllegalArgumentException("Expected a "+varType.name()+" value!"); FloatBuffer fb = (FloatBuffer) value; fb.position(index * 4); fb.put(x).put(y).put(z).put(w); fb.rewind(); updateNeeded = true; setByCurrentMaterial = true; }
public void setVector4InArray(float x, float y, float z, float w, int index){ if (location == -1) { return; } if (varType != null && varType != VarType.Vector4Array) { throw new IllegalArgumentException("Expected a " + varType.name() + " value!"); } multiData.position(index * 4); multiData.put(x).put(y).put(z).put(w); multiData.rewind(); updateNeeded = true; setByCurrentMaterial = true; }
/** * Check if setting the parameter given the type and name is allowed. * @param type The type that the "set" function is designed to set * @param name The name of the parameter */ private void checkSetParam(VarType type, String name) { MatParam paramDef = def.getMaterialParam(name); if (paramDef == null) { throw new IllegalArgumentException("Material parameter is not defined: " + name); } if (type != null && paramDef.getVarType() != type) { logger.log(Level.WARNING, "Material parameter being set: {0} with " + "type {1} doesn''t match definition types {2}", new Object[]{name, type.name(), paramDef.getVarType()}); } }
public void write(MatParam param, OutputStreamWriter out) throws IOException { out.write(" "); out.write(param.getVarType().name()); out.write(" "); out.write(param.getName()); if (param instanceof MatParamTexture) { MatParamTexture paramTex = (MatParamTexture) param; String space = paramTex.getColorSpace() == ColorSpace.Linear ? "-LINEAR" : null; if (space != null) { out.write(" "); out.write(space); } } String value = formatValue(param); if (value != null) { out.write(" : "); out.write(value); } out.write("\n"); }
private String checkSetParam(VarType type, String name) { MatParam paramDef = def.getMaterialParam(name); String newName = name; if (paramDef == null && name.startsWith("m_")) { newName = name.substring(2); paramDef = def.getMaterialParam(newName); if (paramDef == null) { throw new IllegalArgumentException("Material parameter is not defined: " + name); } else { logger.log(Level.WARNING, "Material parameter {0} uses a deprecated naming convention use {1} instead ", new Object[]{name, newName}); } } else if (paramDef == null) { throw new IllegalArgumentException("Material parameter is not defined: " + name); } if (type != null && paramDef.getVarType() != type) { logger.log(Level.WARNING, "Material parameter being set: {0} with " + "type {1} doesn''t match definition types {2}", new Object[]{name, type.name(), paramDef.getVarType()} ); } return newName; } public int getParamIndex(String name) {
throw new IllegalArgumentException("Expected a " + varType.name() + " value!");
right.setPrefix("m_"); if(mapping.getLeftVariable().getMultiplicity() != null){ if(!param.getVarType().name().endsWith("Array")){ throw new MatParseException(param.getName() + " is not of Array type", statement);
throw new IllegalArgumentException("Expected a "+varType.name()+" value!");