Most functions using epsilon values are defining an internal epsilon like this:
const DATA_TYPE epsilon = (DATA_TYPE)0.00001;
While this seems to be OK for most of the functions I've encountered a special case where this (float precision) epsilon doesn't give me the required results:
generate.h: inline DEST_TYPE& setRot( DEST_TYPE& result, const Vec<DATA_TYPE, 3>& from, const Vec<DATA_TYPE, 3>& to )
Here the epsilon is used to determine if the vectors are close enough not be taken into account.
In my case I use a Quatd and the function fails to interpolate between two vectors that differ in only a fraction of a degree.
One my argue that this sufficient precission. For my use case (rotating an eyepoint towards an object and zooming in) this fails for a distance of 400m and a difference of 2 meters on the horizontal axis. Changing the epsilon to smaller value (0.0000001) is sufficient for my scale and still is a valid double differerence value.
My suggestion would be to replace the general epsilon by specialized template functions to retrieve a more type related epsilon like this:
template <typename DATA_TYPE>
DATA_TYPE epsilon()
{
return (DATA_TYPE)(0.00001);
}
template <>
float epsilon<float>()
{
return 0.00001;
};
template <>
double epsilon<double>()
{
return 0.00000001;
};
This more general epsilon could be used in most of the functions, except those which rely on very special epsilons.