forked from enlightenment/efl
eina: updated matrix_translate, matrix_scale and matrix_rotate implementation to do compose of the matrix in not identity matrix.
This is a late change that has been discussing on the ML as we don't want to release an API, we can't make faster. Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
This commit is contained in:
parent
c9232109f0
commit
ee99232b36
|
@ -419,29 +419,33 @@ eina_matrix3_f16p16_compose(const Eina_Matrix3_F16p16 *m1,
|
||||||
EAPI void
|
EAPI void
|
||||||
eina_matrix3_translate(Eina_Matrix3 *m, double tx, double ty)
|
eina_matrix3_translate(Eina_Matrix3 *m, double tx, double ty)
|
||||||
{
|
{
|
||||||
MATRIX_XX(m) = 1;
|
Eina_Matrix3 tmp;
|
||||||
MATRIX_XY(m) = 0;
|
MATRIX_XX(&tmp) = 1;
|
||||||
MATRIX_XZ(m) = tx;
|
MATRIX_XY(&tmp) = 0;
|
||||||
MATRIX_YX(m) = 0;
|
MATRIX_XZ(&tmp) = tx;
|
||||||
MATRIX_YY(m) = 1;
|
MATRIX_YX(&tmp) = 0;
|
||||||
MATRIX_YZ(m) = ty;
|
MATRIX_YY(&tmp) = 1;
|
||||||
MATRIX_ZX(m) = 0;
|
MATRIX_YZ(&tmp) = ty;
|
||||||
MATRIX_ZY(m) = 0;
|
MATRIX_ZX(&tmp) = 0;
|
||||||
MATRIX_ZZ(m) = 1;
|
MATRIX_ZY(&tmp) = 0;
|
||||||
|
MATRIX_ZZ(&tmp) = 1;
|
||||||
|
eina_matrix3_compose(m, &tmp, m);
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI void
|
EAPI void
|
||||||
eina_matrix3_scale(Eina_Matrix3 *m, double sx, double sy)
|
eina_matrix3_scale(Eina_Matrix3 *m, double sx, double sy)
|
||||||
{
|
{
|
||||||
MATRIX_XX(m) = sx;
|
Eina_Matrix3 tmp;
|
||||||
MATRIX_XY(m) = 0;
|
MATRIX_XX(&tmp) = sx;
|
||||||
MATRIX_XZ(m) = 0;
|
MATRIX_XY(&tmp) = 0;
|
||||||
MATRIX_YX(m) = 0;
|
MATRIX_XZ(&tmp) = 0;
|
||||||
MATRIX_YY(m) = sy;
|
MATRIX_YX(&tmp) = 0;
|
||||||
MATRIX_YZ(m) = 0;
|
MATRIX_YY(&tmp) = sy;
|
||||||
MATRIX_ZX(m) = 0;
|
MATRIX_YZ(&tmp) = 0;
|
||||||
MATRIX_ZY(m) = 0;
|
MATRIX_ZX(&tmp) = 0;
|
||||||
MATRIX_ZZ(m) = 1;
|
MATRIX_ZY(&tmp) = 0;
|
||||||
|
MATRIX_ZZ(&tmp) = 1;
|
||||||
|
eina_matrix3_compose(m, &tmp, m);
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI void
|
EAPI void
|
||||||
|
@ -458,15 +462,17 @@ eina_matrix3_rotate(Eina_Matrix3 *m, double rad)
|
||||||
s = _sin(rad);
|
s = _sin(rad);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
MATRIX_XX(m) = c;
|
Eina_Matrix3 tmp;
|
||||||
MATRIX_XY(m) = -s;
|
MATRIX_XX(&tmp) = c;
|
||||||
MATRIX_XZ(m) = 0;
|
MATRIX_XY(&tmp) = -s;
|
||||||
MATRIX_YX(m) = s;
|
MATRIX_XZ(&tmp) = 0;
|
||||||
MATRIX_YY(m) = c;
|
MATRIX_YX(&tmp) = s;
|
||||||
MATRIX_YZ(m) = 0;
|
MATRIX_YY(&tmp) = c;
|
||||||
MATRIX_ZX(m) = 0;
|
MATRIX_YZ(&tmp) = 0;
|
||||||
MATRIX_ZY(m) = 0;
|
MATRIX_ZX(&tmp) = 0;
|
||||||
MATRIX_ZZ(m) = 1;
|
MATRIX_ZY(&tmp) = 0;
|
||||||
|
MATRIX_ZZ(&tmp) = 1;
|
||||||
|
eina_matrix3_compose(m, &tmp, m);
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI void
|
EAPI void
|
||||||
|
|
Loading…
Reference in New Issue