Class MapperFunction3D

java.lang.Object
com.ardor3d.math.functions.MapperFunction3D
All Implemented Interfaces:
Function3D

public class MapperFunction3D extends Object implements Function3D
This function takes a "map" function and uses the value it returns at a certain point to look up and evaluate another function from a set of ranged functions.
  • Constructor Details

    • MapperFunction3D

      public MapperFunction3D(Function3D mapFunction, double domainStart, double domainEnd)
      Construct a mapper function using the given map function and a start and end for the domain we'll use.
      Parameters:
      mapFunction - the map function
      domainStart - the start for the domain
      domainEnd - the end for the domain
  • Method Details

    • eval

      public double eval(double x, double y, double z)
      Specified by:
      eval in interface Function3D
      Parameters:
      x - the 1st value in our tuple
      y - the 2nd value in our tuple
      z - the 3rd value in our tuple
      Returns:
      some value, generally (but not necessarily) in [-1, 1]
    • getMapFunction

      public Function3D getMapFunction()
    • setMapFunction

      public void setMapFunction(Function3D mapFunction)
    • getDomainStart

      public double getDomainStart()
    • setDomainStart

      public void setDomainStart(double start)
    • getDomainEnd

      public double getDomainEnd()
    • setDomainEnd

      public void setDomainEnd(double end)
    • addFunction

      public void addFunction(Function3D source, double offsetStart, double easeIn, double easeOut)
      Add a new source function to the end of our set of ranged functions. Our place in the range is based on the place of the previous source function and the offsetStart provided.
      Parameters:
      source - the new function to add
      offsetStart - our offset from the previous entry
      easeIn - a "fade in" range between the previous function and this function, starting at offsetState. Over this range we'll lerp between the two functions.
      easeOut - a "fade out" range between this function and the next function, starting at the next function's offsetStart - easeOut. Over this range we'll lerp between the two functions.
    • removeFunction

      public void removeFunction(int index)
    • clearFunctions

      public void clearFunctions()