const f32 ROUNDING_ERROR_f32 = 0.000001f;
instead of e.g.
const f32 ROUNDING_ERROR_f32 = std::numeric_limits<f32>::epsilon()
Will it get to instable with a too precise rounding error?
The reason is the following:
I have a animated character mesh. For some reasons (like: "I don't own Studio Max") I need to take what is at hand and scale this mesh by a uniform factor of 0.01. For some time now I wondered why it is not possible to select this character based on a triangle selector. Now I now, that this is due to the above given indifferences. The reason: the inverse matrix of the character cannot be constructed, as the calculation of the determinant (variable "d") in matrix4x4::getInverse is treated as zero, although it needn't to, in this case.
Some numbers:
Absolute transformation:
Code: Select all
0.0099999998 0.00000000 0.00000000 3.9448023
0.00000000 0.0099999998 0.00000000 -0.056485906
0.00000000 0.00000000 0.0099999998 -0.045391038
0.00000000 0.00000000 0.00000000 1.0000000
Treated as
zero, with ROUNDING_ERROR_f32=1.0e-6F
non-zero, with std::numeric_limits<float>::epsilon()= 1.192092896e-7F(on my machine, but x86 is pretty standard)
Inverse:
Code: Select all
100.00001 0.0000000 0.0000000 -394.48026
0.0000000 100.00001 0.0000000 5.6485910
0.0000000 0.0000000 100.00001 4.5391040
0.0000000 0.0000000 0.0000000 1.0000000