Commit Graph

21 Commits

Author SHA1 Message Date
Wonki Kim 4a4525cb4b eina_matrix: replace cosf by cos to gain more accuracy
Summary:
cos function is much much more accurate than cosf.
this patch replaces cosf by cos to gain more accuracy.

Reviewers: cedric, jsuya, vtorri

Subscribers: vtorri, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10695
2019-11-21 17:50:33 +09:00
junsu choi 3493a37db8 Eina_Matrix : Use math header for cosf and sinf of rotate function.
The local cos and sin functions differ from
the math header cos and sin functions by result values
The 4th decimal place is different.
Computing large numbers can cause errors.

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D10467
2019-11-15 11:52:01 -08:00
Bryce Harrington 572ffe7271 eina: use matrix compose in place of equivalent code in matrix multiply
Summary:
The eina_matrix3_compose and eina_matrix3_multiply API's are
mathematically identical (even though the implementations are
reversed... weird), except that the latter also includes a fastpath for
identity matrices.

Having two functionally equivalent APIs is redundant, so ideally one or
the other would be dropped.  But in order avoid API breakage, just have
one routine wrapper the other and eliminate the internal redundancy.

(Note that the parameter signatures of the two routines are different -
eina_matrix3_compose() takes the two input matrices first, and the
output matrix last, while eina_matrix3_multiply() takes the parameters
in the reverse order.  This inconsistency in the API style could result
in accidentally erroneous usage and would be an argument for deprecation
of one of the two APIs.)

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>

Reviewers: cedric

Reviewed By: cedric

Differential Revision: https://phab.enlightenment.org/D5806

Signed-off-by: Cedric Bail <cedric@osg.samsung.com>
2018-02-14 12:47:40 -08:00
Bryce Harrington 1f6d3b40e4 eina: spellfix comment in matrix code
Reviewers: cedric

Reviewed By: cedric

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D5280

Signed-off-by: Cedric Bail <cedric@osg.samsung.com>
2017-10-13 11:51:56 -07:00
Cedric BAIL 8f1c071d6a eina: rename EINA_{FLT,DBL}_CMP to EINA_{FLT,DBL}_EQ. 2017-01-06 15:58:46 -08:00
Cedric BAIL d94a186584 eina: fix double comparison in eina matrix. 2016-12-19 16:33:46 -08:00
Oleksandr Shcherbina 93df8720f9 eina: Fix possible wrong value due to null in determinant of matrix
Reviewers: cedric, Hermet

Subscribers: jpeg

Differential Revision: https://phab.enlightenment.org/D3563
2016-01-13 14:04:35 +01:00
se.osadchy ce4146ec63 evas: fix bug with logic with eina_matrix in evas_3d_utils
Summary: Also need to fix logically dead code in coverity.

Reviewers: raster, Hermet, cedric

Subscribers: jpeg

Maniphest Tasks: T2832

Differential Revision: https://phab.enlightenment.org/D3346

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-12-02 14:15:01 -08:00
Stefan Schmidt a486671bce eina_matrix: optimize multiply and inverse calls by actually using the shortcut
We had this nice shortcuts for multiply and inverse with the identity matrix.
Pity we never used it! The EINA_MATRIX_TYPE_IDENTITY is coming from an enum
without and direct assignments to its internals. Being the first item in the
enum it is most likely will be 0 which makes the whole bitwise AND zero and thus
the optimized path will never get called. If our compiler now decides hew wants
to handle enums differently and does not assign the 0 to the first item this
bitwise operation will be even more screwed. What we really want is to check is
if the type we get for the matrix matches EINA_MATRIX_TYPE_IDENTITY. So better
do this. Made me look into matrix multply and inverse. Fun!

Thanks to smatch for poiting this out.
2015-11-27 00:13:04 +01:00
Carsten Haitzler 43ef6152ed efl - fix eina after misnaming of piblic api
this fixes 3d77f55f91 which added
eina_normal3_matrix_get in the headers as the api, but the actual func
was eina_normal_matrix3_get.
2015-11-10 11:56:01 +09:00
se.osadchy 3d77f55f91 evas: refactor duplicated data structure with eina_matrix.
Summary: Move data structure and functionality to eina_matrix from evas_mat.

Reviewers: raster, Hermet, cedric

Subscribers: Oleksander, cedric

Differential Revision: https://phab.enlightenment.org/D3020

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-11-09 15:27:26 -08:00
Cedric BAIL abfe65e05d eina: add eina_matrix4_multiply and eina_matrix4_identity function. 2015-08-21 16:40:31 +02:00
Cedric BAIL 26f33dc6bd eina: add eina_matrix4_transpose. 2015-08-21 16:40:31 +02:00
Cedric BAIL bb926e2dc7 eina: add eina_matrix4_inverse. 2015-08-21 16:40:31 +02:00
Cedric BAIL 694149c773 eina: add eina_matrix4_normalized. 2015-08-21 16:40:31 +02:00
Cedric BAIL 4f0f81bb30 eina: add eina_matrix4_determinant. 2015-08-21 16:40:31 +02:00
Cedric BAIL c82015d062 eina: our 3x3 matrix are 2D matrix, not 3D rotation matrix. 2015-08-21 16:40:31 +02:00
Cedric BAIL 9a83100a4a eina: add the beginning of an Eina_Matrix4 API. 2015-05-29 17:20:28 +02:00
Jean-Philippe Andre 12b562482e Eina: Fix clang warnings
Use fabs for double values
2015-04-21 20:11:01 +09:00
Subhransu Mohanty ee99232b36 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>
2015-04-17 10:52:16 +02:00
Cedric BAIL 659d3c4fd7 eina: add eina_matrix.
This code come from Enesim and was done by Jorge. I did just take care
of changing the namespace and coding style.
2015-04-03 16:12:48 +02:00