Class VariableMapping

java.lang.Object
com.jme3.shader.VariableMapping
All Implemented Interfaces:
Savable, Cloneable

public class VariableMapping extends Object implements Savable, Cloneable
Represents a mapping between 2 shader node variables or a left shader node variable and a value expression.
  • Constructor Details

    • VariableMapping

      public VariableMapping()
      Creates a VariableMapping.
    • VariableMapping

      public VariableMapping(ShaderNodeVariable leftVariable, String leftSwizzling, ShaderNodeVariable rightVariable, String rightSwizzling, String condition)
      Creates a VariableMapping.
      Parameters:
      leftVariable - the left hand side variable of the expression
      leftSwizzling - the swizzling of the left variable
      rightVariable - the right hand side variable of the expression
      rightSwizzling - the swizzling of the right variable
      condition - the condition for this mapping
  • Method Details

    • getLeftVariable

      public ShaderNodeVariable getLeftVariable()
      Gets the left variable.
      Returns:
      the left variable.
    • setLeftVariable

      public void setLeftVariable(ShaderNodeVariable leftVariable)
      Sets the left variable.
      Parameters:
      leftVariable - the left variable.
    • getRightVariable

      public ShaderNodeVariable getRightVariable()
      Gets the right variable.
      Returns:
      the right variable or null.
    • setRightVariable

      public void setRightVariable(ShaderNodeVariable rightVariable)
      Sets the right variable.
      Parameters:
      rightVariable - the right variable.
    • getRightExpression

      public String getRightExpression()
      Gets the right expression.
      Returns:
      the right expression or null.
    • setRightExpression

      public void setRightExpression(String rightExpression)
      Sets the right expression.
      Parameters:
      rightExpression - the right expression.
    • getCondition

      public String getCondition()
      Gets the condition.
      Returns:
      the condition
    • setCondition

      public void setCondition(String condition)
      Sets the condition.
      Parameters:
      condition - the condition or null.
    • getLeftSwizzling

      public String getLeftSwizzling()
      Gets the left swizzle.
      Returns:
      the left swizzle or empty string.
    • setLeftSwizzling

      public void setLeftSwizzling(String leftSwizzling)
      Sets the left swizzle.
      Parameters:
      leftSwizzling - the left swizzle.
    • getRightSwizzling

      public String getRightSwizzling()
      Gets the right swizzle.
      Returns:
      the right swizzle or empty string.
    • setRightSwizzling

      public void setRightSwizzling(String rightSwizzling)
      Sets the right swizzle.
      Parameters:
      rightSwizzling - the right swizzle.
    • write

      public void write(JmeExporter ex) throws IOException
      jme serialization (not used)
      Specified by:
      write in interface Savable
      Parameters:
      ex - the exporter
      Throws:
      IOException - from the exporter
    • read

      public void read(JmeImporter im) throws IOException
      jme serialization (not used)
      Specified by:
      read in interface Savable
      Parameters:
      im - the importer
      Throws:
      IOException - from the importer
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • clone

      protected VariableMapping clone() throws CloneNotSupportedException
      Overrides:
      clone in class Object
      Throws:
      CloneNotSupportedException