summaryrefslogtreecommitdiff
path: root/src/lib/evas/include/evas_3d_utils.h
diff options
context:
space:
mode:
authorCedric Bail <cedric.bail@free.fr>2014-04-25 16:16:46 +0200
committerCedric Bail <cedric.bail@free.fr>2014-04-25 16:17:27 +0200
commitec4c2de04432a7e04bbdfea7ceae18126cc5885b (patch)
tree1519a97c05f7d6a7fedd19496a07cee4d0e32128 /src/lib/evas/include/evas_3d_utils.h
parent822cbf97590585b3b2de8e2dff52496f921834ad (diff)
evas: rename near and far as it seems protected on Windows.
Diffstat (limited to 'src/lib/evas/include/evas_3d_utils.h')
-rw-r--r--src/lib/evas/include/evas_3d_utils.h58
1 files changed, 29 insertions, 29 deletions
diff --git a/src/lib/evas/include/evas_3d_utils.h b/src/lib/evas/include/evas_3d_utils.h
index a5f4214c1b..ee4aab2249 100644
--- a/src/lib/evas/include/evas_3d_utils.h
+++ b/src/lib/evas/include/evas_3d_utils.h
@@ -734,12 +734,12 @@ evas_mat4_look_at_set(Evas_Mat4 *m,
734static inline void 734static inline void
735evas_mat4_frustum_set(Evas_Mat4 *m, 735evas_mat4_frustum_set(Evas_Mat4 *m,
736 Evas_Real left, Evas_Real right, Evas_Real bottom, Evas_Real top, 736 Evas_Real left, Evas_Real right, Evas_Real bottom, Evas_Real top,
737 Evas_Real near, Evas_Real far) 737 Evas_Real dnear, Evas_Real dfar)
738{ 738{
739 Evas_Real w = right - left; 739 Evas_Real w = right - left;
740 Evas_Real h = top - bottom; 740 Evas_Real h = top - bottom;
741 Evas_Real depth = near - far; 741 Evas_Real depth = dnear - dfar;
742 Evas_Real near_2 = 2.0f * near; 742 Evas_Real near_2 = 2.0f * dnear;
743 743
744 m->m[ 0] = near_2 / w; 744 m->m[ 0] = near_2 / w;
745 m->m[ 1] = 0.0f; 745 m->m[ 1] = 0.0f;
@@ -753,12 +753,12 @@ evas_mat4_frustum_set(Evas_Mat4 *m,
753 753
754 m->m[ 8] = (right + left) / w; 754 m->m[ 8] = (right + left) / w;
755 m->m[ 9] = (top + bottom) / h; 755 m->m[ 9] = (top + bottom) / h;
756 m->m[10] = (far + near) / depth; 756 m->m[10] = (dfar + dnear) / depth;
757 m->m[11] = -1.0f; 757 m->m[11] = -1.0f;
758 758
759 m->m[12] = 0.0f; 759 m->m[12] = 0.0f;
760 m->m[13] = 0.0f; 760 m->m[13] = 0.0f;
761 m->m[14] = near_2 * far / depth; 761 m->m[14] = near_2 * dfar / depth;
762 m->m[15] = 0.0f; 762 m->m[15] = 0.0f;
763 763
764 m->flags = 0; 764 m->flags = 0;
@@ -767,11 +767,11 @@ evas_mat4_frustum_set(Evas_Mat4 *m,
767static inline void 767static inline void
768evas_mat4_ortho_set(Evas_Mat4 *m, 768evas_mat4_ortho_set(Evas_Mat4 *m,
769 Evas_Real left, Evas_Real right, Evas_Real bottom, Evas_Real top, 769 Evas_Real left, Evas_Real right, Evas_Real bottom, Evas_Real top,
770 Evas_Real near, Evas_Real far) 770 Evas_Real dnear, Evas_Real dfar)
771{ 771{
772 Evas_Real w = right - left; 772 Evas_Real w = right - left;
773 Evas_Real h = top - bottom; 773 Evas_Real h = top - bottom;
774 Evas_Real depth = near - far; 774 Evas_Real depth = dnear - dfar;
775 775
776 m->m[ 0] = 2.0f / w; 776 m->m[ 0] = 2.0f / w;
777 m->m[ 1] = 0.0f; 777 m->m[ 1] = 0.0f;
@@ -790,7 +790,7 @@ evas_mat4_ortho_set(Evas_Mat4 *m,
790 790
791 m->m[12] = -(right + left) / w; 791 m->m[12] = -(right + left) / w;
792 m->m[13] = -(top + bottom) / h; 792 m->m[13] = -(top + bottom) / h;
793 m->m[14] = (far + near) / depth; 793 m->m[14] = (dfar + dnear) / depth;
794 m->m[15] = 1.0f; 794 m->m[15] = 1.0f;
795 795
796 m->flags = 0; 796 m->flags = 0;
@@ -1497,7 +1497,7 @@ static inline void
1497evas_ray3_init(Evas_Ray3 *ray, Evas_Real x, Evas_Real y, const Evas_Mat4 *mvp) 1497evas_ray3_init(Evas_Ray3 *ray, Evas_Real x, Evas_Real y, const Evas_Mat4 *mvp)
1498{ 1498{
1499 Evas_Mat4 mat; 1499 Evas_Mat4 mat;
1500 Evas_Vec4 near, far; 1500 Evas_Vec4 dnear, dfar;
1501 1501
1502 memset(&mat, 0, sizeof (mat)); 1502 memset(&mat, 0, sizeof (mat));
1503 1503
@@ -1506,34 +1506,34 @@ evas_ray3_init(Evas_Ray3 *ray, Evas_Real x, Evas_Real y, const Evas_Mat4 *mvp)
1506 evas_mat4_inverse(&mat, mvp); 1506 evas_mat4_inverse(&mat, mvp);
1507 1507
1508 /* Transform near point. */ 1508 /* Transform near point. */
1509 near.x = x; 1509 dnear.x = x;
1510 near.y = y; 1510 dnear.y = y;
1511 near.z = -1.0; 1511 dnear.z = -1.0;
1512 near.w = 1.0; 1512 dnear.w = 1.0;
1513 1513
1514 evas_vec4_transform(&near, &near, &mat); 1514 evas_vec4_transform(&dnear, &dnear, &mat);
1515 1515
1516 near.w = 1.0 / near.w; 1516 dnear.w = 1.0 / dnear.w;
1517 near.x *= near.w; 1517 dnear.x *= dnear.w;
1518 near.y *= near.w; 1518 dnear.y *= dnear.w;
1519 near.z *= near.w; 1519 dnear.z *= dnear.w;
1520 1520
1521 evas_vec3_set(&ray->org, near.x, near.y, near.z); 1521 evas_vec3_set(&ray->org, dnear.x, dnear.y, dnear.z);
1522 1522
1523 /* Transform far point. */ 1523 /* Transform far point. */
1524 far.x = x; 1524 dfar.x = x;
1525 far.y = y; 1525 dfar.y = y;
1526 far.z = 1.0; 1526 dfar.z = 1.0;
1527 far.w = 1.0; 1527 dfar.w = 1.0;
1528 1528
1529 evas_vec4_transform(&far, &far, &mat); 1529 evas_vec4_transform(&dfar, &dfar, &mat);
1530 1530
1531 far.w = 1.0 / far.w; 1531 dfar.w = 1.0 / dfar.w;
1532 far.x *= far.w; 1532 dfar.x *= dfar.w;
1533 far.y *= far.w; 1533 dfar.y *= dfar.w;
1534 far.z *= far.w; 1534 dfar.z *= dfar.w;
1535 1535
1536 evas_vec3_set(&ray->dir, far.x - near.x, far.y - near.y, far.z - near.z); 1536 evas_vec3_set(&ray->dir, dfar.x - dnear.x, dfar.y - dnear.y, dfar.z - dnear.z);
1537} 1537}
1538 1538
1539static inline Eina_Bool 1539static inline Eina_Bool