Package com.ardor3d.math.functions
Class MapperFunction3D
java.lang.Object
com.ardor3d.math.functions.MapperFunction3D
- All Implemented Interfaces:
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 Summary
ConstructorDescriptionMapperFunction3D
(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. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addFunction
(Function3D source, double offsetStart, double easeIn, double easeOut) Add a new source function to the end of our set of ranged functions.void
double
eval
(double x, double y, double z) double
double
void
removeFunction
(int index) void
setDomainEnd
(double end) void
setDomainStart
(double start) void
setMapFunction
(Function3D mapFunction)
-
Constructor Details
-
MapperFunction3D
Construct a mapper function using the given map function and a start and end for the domain we'll use.- Parameters:
mapFunction
- the map functiondomainStart
- the start for the domaindomainEnd
- the end for the domain
-
-
Method Details
-
eval
public double eval(double x, double y, double z) - Specified by:
eval
in interfaceFunction3D
- Parameters:
x
- the 1st value in our tupley
- the 2nd value in our tuplez
- the 3rd value in our tuple- Returns:
- some value, generally (but not necessarily) in [-1, 1]
-
getMapFunction
-
setMapFunction
-
getDomainStart
public double getDomainStart() -
setDomainStart
public void setDomainStart(double start) -
getDomainEnd
public double getDomainEnd() -
setDomainEnd
public void setDomainEnd(double end) -
addFunction
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 addoffsetStart
- our offset from the previous entryeaseIn
- 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()
-