When porting some code from GLSL to java I ran into a method that does not exist in FastMath (Or java.util.Math…) : mod(x, y). It simply caclulates the modulus for two float variables similar to ‘x % y’ for integers.
GLSL also contains similar methods for vec2, vec3 and vec4.
It might be convenient to have these methods in FastMath (Or the respective VectorXf classes).
The reason I’m porting some (unfamiliar) GLSL code to java is because I have some issues with it and need to debug it. Java provides much better facilities for this and allows me to output intermediate results as well. The closer the Java code is to GLSL the easier it would be to do this.
If anyone is interested, I’d be happy to port all missing GLSL methods to FastMath. (Or a new GlslSim class). Some of these methods are already implemented in the respective vector classes. We’d might want to have those reference FastMath as well then.
[java]
/**
 Modulus, calculates the remainder of the division x/y, similar to x%y for
 integers.
*

@param x

@param y

@return The remainder of x/y.
*/
public static float mod(float x, float y) {
return x  y * floor(x / y);
}
[/java]