evas: rename near and far as it seems protected on Windows.

This commit is contained in:
Cedric Bail 2014-04-25 16:16:46 +02:00
parent 822cbf9759
commit ec4c2de044
3 changed files with 44 additions and 44 deletions

View File

@ -111,15 +111,15 @@ _eo_evas_3d_camera_projection_matrix_get(Eo *obj EINA_UNUSED,
EOLIAN static void
_eo_evas_3d_camera_projection_perspective_set(Eo *obj, Evas_3D_Camera_Data *pd,
Evas_Real fovy, Evas_Real aspect,
Evas_Real near, Evas_Real far)
Evas_Real dnear, Evas_Real dfar)
{
Evas_Real xmax;
Evas_Real ymax;
ymax = near * (Evas_Real)tan((double)fovy * M_PI / 360.0);
ymax = dnear * (Evas_Real)tan((double)fovy * M_PI / 360.0);
xmax = ymax * aspect;
evas_mat4_frustum_set(&pd->projection, -xmax, xmax, -ymax, ymax, near, far);
evas_mat4_frustum_set(&pd->projection, -xmax, xmax, -ymax, ymax, dnear, dfar);
evas_3d_object_change(obj, EVAS_3D_STATE_CAMERA_PROJECTION, NULL);
}
@ -127,9 +127,9 @@ EOLIAN static void
_eo_evas_3d_camera_projection_frustum_set(Eo *obj, Evas_3D_Camera_Data *pd,
Evas_Real left, Evas_Real right,
Evas_Real bottom, Evas_Real top,
Evas_Real near, Evas_Real far)
Evas_Real dnear, Evas_Real dfar)
{
evas_mat4_frustum_set(&pd->projection, left, right, bottom, top, near, far);
evas_mat4_frustum_set(&pd->projection, left, right, bottom, top, dnear, dfar);
evas_3d_object_change(obj, EVAS_3D_STATE_CAMERA_PROJECTION, NULL);
}
@ -137,9 +137,9 @@ EOLIAN static void
_eo_evas_3d_camera_projection_ortho_set(Eo *obj, Evas_3D_Camera_Data *pd,
Evas_Real left, Evas_Real right,
Evas_Real bottom, Evas_Real top,
Evas_Real near, Evas_Real far)
Evas_Real dnear, Evas_Real dfar)
{
evas_mat4_ortho_set(&pd->projection, left, right, bottom, top, near, far);
evas_mat4_ortho_set(&pd->projection, left, right, bottom, top, dnear, dfar);
evas_3d_object_change(obj, EVAS_3D_STATE_CAMERA_PROJECTION, NULL);
}

View File

@ -47,8 +47,8 @@ class EO_Evas_3D_Camera (EO_Evas_3D_Object, Evas_Common_Interface)
@param camera The given camera.
@param fovy Field of view angle in Y direction.
@param aspect Aspect ratio.
@param near Distance to near clipping plane.
@param far Distance to far clipping plane.
@param dnear Distance to near clipping plane.
@param dfar Distance to far clipping plane.
@see evas_3d_camera_projection_matrix_set()
@ -58,8 +58,8 @@ class EO_Evas_3D_Camera (EO_Evas_3D_Object, Evas_Common_Interface)
params {
Evas_Real fovy; /*@ Field of view angle in Y direction. */
Evas_Real aspect; /*@ Aspect ratio.*/
Evas_Real near; /*@ Distance to near clipping plane. */
Evas_Real far; /*@ Distance to far clipping plane. */
Evas_Real dnear; /*@ Distance to near clipping plane. */
Evas_Real dfar; /*@ Distance to far clipping plane. */
}
}
@ -76,8 +76,8 @@ class EO_Evas_3D_Camera (EO_Evas_3D_Object, Evas_Common_Interface)
Evas_Real right; /*@ Right X coordinate of the near clipping plane..*/
Evas_Real bottom; /*@ Bottom Y coordinate of the near clipping plane. */
Evas_Real top; /*@ Top Y coordinate of the near clipping plane */
Evas_Real near; /*@ Distance to near clipping plane. */
Evas_Real far; /*@ Distance to far clipping plane. */
Evas_Real dnear; /*@ Distance to near clipping plane. */
Evas_Real dfar; /*@ Distance to far clipping plane. */
}
}
projection_ortho_set {
@ -93,8 +93,8 @@ class EO_Evas_3D_Camera (EO_Evas_3D_Object, Evas_Common_Interface)
Evas_Real right; /*@ Right X coordinate of the near clipping plane..*/
Evas_Real bottom; /*@ Bottom Y coordinate of the near clipping plane. */
Evas_Real top; /*@ Top Y coordinate of the near clipping plane */
Evas_Real near; /*@ Distance to near clipping plane. */
Evas_Real far; /*@ Distance to far clipping plane. */
Evas_Real dnear; /*@ Distance to near clipping plane. */
Evas_Real dfar; /*@ Distance to far clipping plane. */
}
}
}

View File

@ -734,12 +734,12 @@ evas_mat4_look_at_set(Evas_Mat4 *m,
static inline void
evas_mat4_frustum_set(Evas_Mat4 *m,
Evas_Real left, Evas_Real right, Evas_Real bottom, Evas_Real top,
Evas_Real near, Evas_Real far)
Evas_Real dnear, Evas_Real dfar)
{
Evas_Real w = right - left;
Evas_Real h = top - bottom;
Evas_Real depth = near - far;
Evas_Real near_2 = 2.0f * near;
Evas_Real depth = dnear - dfar;
Evas_Real near_2 = 2.0f * dnear;
m->m[ 0] = near_2 / w;
m->m[ 1] = 0.0f;
@ -753,12 +753,12 @@ evas_mat4_frustum_set(Evas_Mat4 *m,
m->m[ 8] = (right + left) / w;
m->m[ 9] = (top + bottom) / h;
m->m[10] = (far + near) / depth;
m->m[10] = (dfar + dnear) / depth;
m->m[11] = -1.0f;
m->m[12] = 0.0f;
m->m[13] = 0.0f;
m->m[14] = near_2 * far / depth;
m->m[14] = near_2 * dfar / depth;
m->m[15] = 0.0f;
m->flags = 0;
@ -767,11 +767,11 @@ evas_mat4_frustum_set(Evas_Mat4 *m,
static inline void
evas_mat4_ortho_set(Evas_Mat4 *m,
Evas_Real left, Evas_Real right, Evas_Real bottom, Evas_Real top,
Evas_Real near, Evas_Real far)
Evas_Real dnear, Evas_Real dfar)
{
Evas_Real w = right - left;
Evas_Real h = top - bottom;
Evas_Real depth = near - far;
Evas_Real depth = dnear - dfar;
m->m[ 0] = 2.0f / w;
m->m[ 1] = 0.0f;
@ -790,7 +790,7 @@ evas_mat4_ortho_set(Evas_Mat4 *m,
m->m[12] = -(right + left) / w;
m->m[13] = -(top + bottom) / h;
m->m[14] = (far + near) / depth;
m->m[14] = (dfar + dnear) / depth;
m->m[15] = 1.0f;
m->flags = 0;
@ -1497,7 +1497,7 @@ static inline void
evas_ray3_init(Evas_Ray3 *ray, Evas_Real x, Evas_Real y, const Evas_Mat4 *mvp)
{
Evas_Mat4 mat;
Evas_Vec4 near, far;
Evas_Vec4 dnear, dfar;
memset(&mat, 0, sizeof (mat));
@ -1506,34 +1506,34 @@ evas_ray3_init(Evas_Ray3 *ray, Evas_Real x, Evas_Real y, const Evas_Mat4 *mvp)
evas_mat4_inverse(&mat, mvp);
/* Transform near point. */
near.x = x;
near.y = y;
near.z = -1.0;
near.w = 1.0;
dnear.x = x;
dnear.y = y;
dnear.z = -1.0;
dnear.w = 1.0;
evas_vec4_transform(&near, &near, &mat);
evas_vec4_transform(&dnear, &dnear, &mat);
near.w = 1.0 / near.w;
near.x *= near.w;
near.y *= near.w;
near.z *= near.w;
dnear.w = 1.0 / dnear.w;
dnear.x *= dnear.w;
dnear.y *= dnear.w;
dnear.z *= dnear.w;
evas_vec3_set(&ray->org, near.x, near.y, near.z);
evas_vec3_set(&ray->org, dnear.x, dnear.y, dnear.z);
/* Transform far point. */
far.x = x;
far.y = y;
far.z = 1.0;
far.w = 1.0;
dfar.x = x;
dfar.y = y;
dfar.z = 1.0;
dfar.w = 1.0;
evas_vec4_transform(&far, &far, &mat);
evas_vec4_transform(&dfar, &dfar, &mat);
far.w = 1.0 / far.w;
far.x *= far.w;
far.y *= far.w;
far.z *= far.w;
dfar.w = 1.0 / dfar.w;
dfar.x *= dfar.w;
dfar.y *= dfar.w;
dfar.z *= dfar.w;
evas_vec3_set(&ray->dir, far.x - near.x, far.y - near.y, far.z - near.z);
evas_vec3_set(&ray->dir, dfar.x - dnear.x, dfar.y - dnear.y, dfar.z - dnear.z);
}
static inline Eina_Bool