Package com.ardor3d.math.functions
Class Functions
java.lang.Object
com.ardor3d.math.functions.Functions
Utility class containing a set of easy to use functions.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Function3Dabs(Function3D source) static Function3Dadd(Function3D sourceA, Function3D sourceB) static Function3Dclamp(Function3D source, double min, double max) static Function3Dconstant(double constant) static Function3Dinvert(Function3D source) static Function3Dlerp(Function3D sourceA, Function3D sourceB, double amount) (1-amount) * srcA.eval + (amount) * srcB.evalstatic Function3Dmax(Function3D sourceA, Function3D sourceB) static Function3Dmin(Function3D sourceA, Function3D sourceB) static Function3Dmultiply(Function3D sourceA, Function3D sourceB) static Function3Dremap(Function3D source, double oldLow, double oldHigh, double newLow, double newHigh) static Function3DrotateInput(Function3D source, ReadOnlyMatrix3 rotation) static Function3DscaleBias(Function3D source, double scale, double bias) static Function3DscaleInput(Function3D source, double scaleX, double scaleY, double scaleZ) static Function3Dstatic Function3DtranslateInput(Function3D source, double transX, double transY, double transZ)
-
Constructor Details
-
Functions
public Functions()
-
-
Method Details
-
constant
- Parameters:
constant- the constant- Returns:
- a function that will always return the given constant value regardless of input
-
scaleBias
- Parameters:
source- the source functionscale- the scale valuebias- the bias- Returns:
- a function that returns (src.eval * scale) + bias.
-
abs
- Parameters:
source- the source function- Returns:
- a function that returns |src.eval|
-
clamp
- Parameters:
source- the source functionmin- the minimummax- the maximum- Returns:
- a function that returns src.eval clamped to [min, max]
-
invert
- Parameters:
source- the source function- Returns:
- a function that returns -(src.eval)
-
add
- Parameters:
sourceA- the source function AsourceB- the source function B- Returns:
- a function the returns srcA.eval + srcB.eval
-
multiply
- Parameters:
sourceA- the source function AsourceB- the source function B- Returns:
- a function the returns srcA.eval * srcB.eval
-
min
- Parameters:
sourceA- the source function AsourceB- the source function B- Returns:
- a function the returns min(srcA.eval, srcB.eval)
-
max
- Parameters:
sourceA- the source function AsourceB- the source function B- Returns:
- a function the returns max(srcA.eval, srcB.eval)
-
lerp
(1-amount) * srcA.eval + (amount) * srcB.eval- Parameters:
sourceA- the source function AsourceB- the source function Bamount- the amount- Returns:
- a function the linear interpolation of srcA.eval and srcB.eval using the given amount.
-
rotateInput
- Parameters:
source- the source functionrotation- the rotation matrix- Returns:
- a function that rotates the 3 value tuple as a vector using the given matrix before feeding it to src.eval.
-
scaleInput
- Parameters:
source- the source functionscaleX- the x value of the scalescaleY- the y value of the scalescaleZ- the z value of the scale- Returns:
- a function that scales the 3 value tuple using the given values before feeding it to src.eval.
-
translateInput
public static Function3D translateInput(Function3D source, double transX, double transY, double transZ) - Parameters:
source- the source functiontransX- the x value of the translationtransY- the y value of the translationtransZ- the z value of the translation- Returns:
- a function that translates the 3 value tuple using the given values before feeding it to src.eval.
-
remap
public static Function3D remap(Function3D source, double oldLow, double oldHigh, double newLow, double newHigh) - Parameters:
source- the source functionoldLow- the old low valueoldHigh- the old high valuenewLow- the new low valuenewHigh- the new high value- Returns:
- a function that maps src.eval from a given range onto a new range.
-
simplexNoise
- Returns:
- a function that returns simplex noise.
-