#include "eina_fp.h"
#include "eina_matrix.h"
#include "eina_quaternion.h"
+#include "eina_util.h"
EAPI void
eina_quaternion_f16p16_set(Eina_Quaternion *out,
const Eina_Quaternion *b,
double pos)
{
- if (pos == 0)
+ if (EINA_DBL_CMP(pos, 0.0))
{
*out = *a;
return ;
}
- else if (pos == 1.0)
+ else if (EINA_DBL_CMP(pos, 1.0))
{
*out = *b;
return ;
double dot;
double pos1, pos2;
- if (pos == 0)
+ if (EINA_DBL_CMP(pos, 0.0))
{
*out = *a;
return ;
}
- else if (pos == 1.0)
+ else if (EINA_DBL_CMP(pos, 1.0))
{
*out = *b;
return ;
Eina_Quaternion not_normalize;
double dot;
- if (pos == 0)
+ if (EINA_DBL_CMP(pos, 0.0))
{
*out = *a;
return ;
}
- else if (pos == 1.0)
+ else if (EINA_DBL_CMP(pos, 1.0))
{
*out = *b;
return ;
Eina_Matrix4 n, pm;
double det, factor;
- if (m->ww == 0) return EINA_FALSE;
+ if (EINA_DBL_CMP(m->ww, 0.0)) return EINA_FALSE;
// Normalize the matrix.
factor = 1 / m->ww;
// apply skew
// rm is a identity 4x4 matrix initially
- if (skew->z)
+ if (!EINA_DBL_CMP(skew->z, 0.0))
{
Eina_Matrix4 cp;
tmp = cp;
}
- if (skew->y)
+ if (!EINA_DBL_CMP(skew->y, 0.0))
{
Eina_Matrix4 cp;
tmp = cp;
}
- if (skew->x)
+ if (!EINA_DBL_CMP(skew->x, 0.0))
{
Eina_Matrix4 cp;
EAPI void
eina_quaternion_homogeneous_regulate(Eina_Quaternion *out, const Eina_Quaternion *v)
{
- if (v->w != 0.0)
+ if (!EINA_DBL_CMP(v->w, 0.0))
{
double scale = 1.0 / v->w;