JOML-CI / JOML

A Java math library for OpenGL rendering calculations
MIT License
729 stars 104 forks source link

Missing table lookup option for joml.Math.sin(float)? #307

Closed BloCamLimb closed 2 years ago

BloCamLimb commented 2 years ago

From the source code, joml.Math.sin(float) will always use java Math.sin() without an optional table lookup method. But sin_theagentd_lookup uses floats, it's okay to apply the method to sin(float) as an option. Is this intentionally disabled? If so, should I replace Matrix4f with Matrix4d if I need fast math?

public static float sin(float rad) {
    return (float) java.lang.Math.sin(rad);
}
public static double sin(double rad) {
    if (Options.FASTMATH) {
        if (Options.SIN_LOOKUP)
            return sin_theagentd_lookup((float) rad);
        return sin_roquen_newk(rad);
    }
    return java.lang.Math.sin(rad);
}
httpdigest commented 2 years ago

Thanks for reporting. You're right, the FASTMATH path can of course also be used for the float-overload. Is in the 1.10.4-SNAPSHOT now, will come with the 1.10.4 release.