summaryrefslogtreecommitdiff
path: root/src/lib/evas/common3d
diff options
context:
space:
mode:
authorse.osadchy <se.osadchy@samsung.com>2016-02-17 14:26:40 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2016-02-17 16:12:35 +0900
commit780ec5d0297c3645033b64f4e0723c579e12e491 (patch)
tree7130e1e95436eddf0c8b319c832bc1f4fa9afbee /src/lib/evas/common3d
parenta1584c8a5db0bdacd8f14669f77d2c4f4de4d1c3 (diff)
evas: Update evas_3d_utils, replace Evas_Vec.
Summary: Change Evas_Vec2(3) to Eina_Vector2(3). Reviewers: cedric, Hermet, jpeg Subscribers: jpeg Differential Revision: https://phab.enlightenment.org/D3686
Diffstat (limited to 'src/lib/evas/common3d')
-rw-r--r--src/lib/evas/common3d/primitives/primitive_common.c16
-rw-r--r--src/lib/evas/common3d/primitives/primitive_common.h20
-rw-r--r--src/lib/evas/common3d/primitives/solids_of_revolution/cone.c6
-rw-r--r--src/lib/evas/common3d/primitives/solids_of_revolution/cylinder.c6
-rw-r--r--src/lib/evas/common3d/primitives/solids_of_revolution/sphere.c10
-rw-r--r--src/lib/evas/common3d/primitives/solids_of_revolution/torus.c2
-rw-r--r--src/lib/evas/common3d/primitives/surfaces/surface.c10
-rw-r--r--src/lib/evas/common3d/primitives/surfaces/terrain.c2
8 files changed, 36 insertions, 36 deletions
diff --git a/src/lib/evas/common3d/primitives/primitive_common.c b/src/lib/evas/common3d/primitives/primitive_common.c
index 882e95216e..b80d1dc29b 100644
--- a/src/lib/evas/common3d/primitives/primitive_common.c
+++ b/src/lib/evas/common3d/primitives/primitive_common.c
@@ -30,7 +30,7 @@ void
30_set_vec3_vertex_data(Evas_Canvas3D_Mesh *mesh, 30_set_vec3_vertex_data(Evas_Canvas3D_Mesh *mesh,
31 int frame, 31 int frame,
32 int vcount, 32 int vcount,
33 Evas_Vec3 *data, 33 Eina_Vector3 *data,
34 Evas_Canvas3D_Vertex_Attrib attr) 34 Evas_Canvas3D_Vertex_Attrib attr)
35{ 35{
36 float *address, *out; 36 float *address, *out;
@@ -56,7 +56,7 @@ void
56_set_vec2_vertex_data(Evas_Canvas3D_Mesh *mesh, 56_set_vec2_vertex_data(Evas_Canvas3D_Mesh *mesh,
57 int frame, 57 int frame,
58 int vcount, 58 int vcount,
59 Evas_Vec2 *data, 59 Eina_Vector2 *data,
60 Evas_Canvas3D_Vertex_Attrib attr) 60 Evas_Canvas3D_Vertex_Attrib attr)
61{ 61{
62 float *address, *out; 62 float *address, *out;
@@ -99,7 +99,7 @@ _generate_indices(unsigned short *indices, int a, int b)
99} 99}
100 100
101void 101void
102_primitives_vec3_copy(Evas_Vec3 *dst, const Evas_Vec3 *src) 102_primitives_vec3_copy(Eina_Vector3 *dst, const Eina_Vector3 *src)
103{ 103{
104 dst->x = src->x; 104 dst->x = src->x;
105 dst->y = src->y; 105 dst->y = src->y;
@@ -107,7 +107,7 @@ _primitives_vec3_copy(Evas_Vec3 *dst, const Evas_Vec3 *src)
107} 107}
108 108
109void 109void
110_primitives_vec3_subtract(Evas_Vec3 *out, const Evas_Vec3 *a, const Evas_Vec3 *b) 110_primitives_vec3_subtract(Eina_Vector3 *out, const Eina_Vector3 *a, const Eina_Vector3 *b)
111{ 111{
112 out->x = a->x - b->x; 112 out->x = a->x - b->x;
113 out->y = a->y - b->y; 113 out->y = a->y - b->y;
@@ -115,9 +115,9 @@ _primitives_vec3_subtract(Evas_Vec3 *out, const Evas_Vec3 *a, const Evas_Vec3 *b
115} 115}
116 116
117void 117void
118_primitives_vec3_cross_product(Evas_Vec3 *out, const Evas_Vec3 *a, const Evas_Vec3 *b) 118_primitives_vec3_cross_product(Eina_Vector3 *out, const Eina_Vector3 *a, const Eina_Vector3 *b)
119{ 119{
120 Evas_Vec3 tmp; 120 Eina_Vector3 tmp;
121 121
122 tmp.x = a->y * b->z - a->z * b->y; 122 tmp.x = a->y * b->z - a->z * b->y;
123 tmp.y = a->z * b->x - a->x * b->z; 123 tmp.y = a->z * b->x - a->x * b->z;
@@ -127,7 +127,7 @@ _primitives_vec3_cross_product(Evas_Vec3 *out, const Evas_Vec3 *a, const Evas_Ve
127} 127}
128 128
129void 129void
130_primitives_vec3_normalize(Evas_Vec3 *out) 130_primitives_vec3_normalize(Eina_Vector3 *out)
131{ 131{
132 Evas_Real size = out->x * out->x + out->y *out->y + out->z * out->z; 132 Evas_Real size = out->x * out->x + out->y *out->y + out->z * out->z;
133 size = sqrt(size); 133 size = sqrt(size);
@@ -144,7 +144,7 @@ evas_common_set_model_from_primitive(Evas_Canvas3D_Mesh *model,
144 Evas_Real ratio = primitive->ratio; 144 Evas_Real ratio = primitive->ratio;
145 int precision = primitive->precision; 145 int precision = primitive->precision;
146 Evas_Canvas3D_Surface_Func *surface = primitive->surface; 146 Evas_Canvas3D_Surface_Func *surface = primitive->surface;
147 Evas_Vec2 tex_scale = primitive->tex_scale; 147 Eina_Vector2 tex_scale = primitive->tex_scale;
148 Evas_Canvas3D_Primitive_Mode mode = primitive->mode; 148 Evas_Canvas3D_Primitive_Mode mode = primitive->mode;
149 149
150 switch (primitive->form) 150 switch (primitive->form)
diff --git a/src/lib/evas/common3d/primitives/primitive_common.h b/src/lib/evas/common3d/primitives/primitive_common.h
index 50092d711f..6c0dcf23f4 100644
--- a/src/lib/evas/common3d/primitives/primitive_common.h
+++ b/src/lib/evas/common3d/primitives/primitive_common.h
@@ -10,10 +10,10 @@
10#include "evas_private.h" 10#include "evas_private.h"
11 11
12#define ALLOCATE_VERTEX_DATA \ 12#define ALLOCATE_VERTEX_DATA \
13 Evas_Vec3 *vertices = malloc(sizeof(Evas_Vec3) * vcount); \ 13 Eina_Vector3 *vertices = malloc(sizeof(Eina_Vector3) * vcount); \
14 Evas_Vec3 *normals = malloc(sizeof(Evas_Vec3) * vcount); \ 14 Eina_Vector3 *normals = malloc(sizeof(Eina_Vector3) * vcount); \
15 Evas_Vec2 *tex_coord = malloc(sizeof(Evas_Vec2) * vcount); \ 15 Eina_Vector2 *tex_coord = malloc(sizeof(Eina_Vector2) * vcount); \
16 Evas_Vec3 *tangents = malloc(sizeof(Evas_Vec3) * vcount); \ 16 Eina_Vector3 *tangents = malloc(sizeof(Eina_Vector3) * vcount); \
17 unsigned short *indices = malloc(sizeof(short) * icount); 17 unsigned short *indices = malloc(sizeof(short) * icount);
18 18
19#define SET_VERTEX_DATA(frame) \ 19#define SET_VERTEX_DATA(frame) \
@@ -56,13 +56,13 @@
56 12, 3, 15, vcount); 56 12, 3, 15, vcount);
57 57
58void _generate_indices(unsigned short *indices, int count, int width); 58void _generate_indices(unsigned short *indices, int count, int width);
59void _set_vec3_vertex_data(Evas_Canvas3D_Mesh *mesh, int frame, int vcount, Evas_Vec3 *data, Evas_Canvas3D_Vertex_Attrib attr); 59void _set_vec3_vertex_data(Evas_Canvas3D_Mesh *mesh, int frame, int vcount, Eina_Vector3 *data, Evas_Canvas3D_Vertex_Attrib attr);
60void _set_vec2_vertex_data(Evas_Canvas3D_Mesh *mesh, int frame, int vcount, Evas_Vec2 *data, Evas_Canvas3D_Vertex_Attrib attr); 60void _set_vec2_vertex_data(Evas_Canvas3D_Mesh *mesh, int frame, int vcount, Eina_Vector2 *data, Evas_Canvas3D_Vertex_Attrib attr);
61void _set_vertex_data_from_array(Evas_Canvas3D_Mesh *mesh, int frame, const float *data, Evas_Canvas3D_Vertex_Attrib attr, int start, int attr_count, int line, int vcount); 61void _set_vertex_data_from_array(Evas_Canvas3D_Mesh *mesh, int frame, const float *data, Evas_Canvas3D_Vertex_Attrib attr, int start, int attr_count, int line, int vcount);
62 62
63void _primitives_vec3_copy(Evas_Vec3 *dst, const Evas_Vec3 *src); 63void _primitives_vec3_copy(Eina_Vector3 *dst, const Eina_Vector3 *src);
64void _primitives_vec3_subtract(Evas_Vec3 *out, const Evas_Vec3 *a, const Evas_Vec3 *b); 64void _primitives_vec3_subtract(Eina_Vector3 *out, const Eina_Vector3 *a, const Eina_Vector3 *b);
65void _primitives_vec3_cross_product(Evas_Vec3 *out, const Evas_Vec3 *a, const Evas_Vec3 *b); 65void _primitives_vec3_cross_product(Eina_Vector3 *out, const Eina_Vector3 *a, const Eina_Vector3 *b);
66void _primitives_vec3_normalize(Evas_Vec3 *out); 66void _primitives_vec3_normalize(Eina_Vector3 *out);
67 67
68#endif //PRIMITIVE_COMMON 68#endif //PRIMITIVE_COMMON
diff --git a/src/lib/evas/common3d/primitives/solids_of_revolution/cone.c b/src/lib/evas/common3d/primitives/solids_of_revolution/cone.c
index 9a48c2a8df..1a27630c21 100644
--- a/src/lib/evas/common3d/primitives/solids_of_revolution/cone.c
+++ b/src/lib/evas/common3d/primitives/solids_of_revolution/cone.c
@@ -4,7 +4,7 @@ void
4_set_default_cone(Evas_Canvas3D_Mesh *mesh, 4_set_default_cone(Evas_Canvas3D_Mesh *mesh,
5 int frame, 5 int frame,
6 int p, 6 int p,
7 Evas_Vec2 tex_scale) 7 Eina_Vector2 tex_scale)
8{ 8{
9 int vcount, icount, vccount, i, j, num; 9 int vcount, icount, vccount, i, j, num;
10 double dfi, fi, sinfi, cosfi, nplane, nz; 10 double dfi, fi, sinfi, cosfi, nplane, nz;
@@ -66,7 +66,7 @@ void
66_set_cone_without_base(Evas_Canvas3D_Mesh *mesh, 66_set_cone_without_base(Evas_Canvas3D_Mesh *mesh,
67 int frame, 67 int frame,
68 int p, 68 int p,
69 Evas_Vec2 tex_scale) 69 Eina_Vector2 tex_scale)
70{ 70{
71 int vcount, icount, vccount, i; 71 int vcount, icount, vccount, i;
72 double dfi, fi, sinfi, cosfi, nplane, nz; 72 double dfi, fi, sinfi, cosfi, nplane, nz;
@@ -117,7 +117,7 @@ evas_model_set_from_cone_primitive(Evas_Canvas3D_Mesh *mesh,
117 int frame, 117 int frame,
118 Evas_Canvas3D_Primitive_Mode mode, 118 Evas_Canvas3D_Primitive_Mode mode,
119 int p, 119 int p,
120 Evas_Vec2 tex_scale) 120 Eina_Vector2 tex_scale)
121{ 121{
122 switch (mode) 122 switch (mode)
123 { 123 {
diff --git a/src/lib/evas/common3d/primitives/solids_of_revolution/cylinder.c b/src/lib/evas/common3d/primitives/solids_of_revolution/cylinder.c
index d990a057d2..5b6e593783 100644
--- a/src/lib/evas/common3d/primitives/solids_of_revolution/cylinder.c
+++ b/src/lib/evas/common3d/primitives/solids_of_revolution/cylinder.c
@@ -4,7 +4,7 @@ void
4_set_default_cylinder(Evas_Canvas3D_Mesh *mesh, 4_set_default_cylinder(Evas_Canvas3D_Mesh *mesh,
5 int frame, 5 int frame,
6 int p, 6 int p,
7 Evas_Vec2 tex_scale) 7 Eina_Vector2 tex_scale)
8{ 8{
9 int vcount, icount, vccount, i, j, num; 9 int vcount, icount, vccount, i, j, num;
10 icount = p * 30; 10 icount = p * 30;
@@ -67,7 +67,7 @@ void
67_set_cylinder_without_bases(Evas_Canvas3D_Mesh *mesh, 67_set_cylinder_without_bases(Evas_Canvas3D_Mesh *mesh,
68 int frame, 68 int frame,
69 int p, 69 int p,
70 Evas_Vec2 tex_scale) 70 Eina_Vector2 tex_scale)
71{ 71{
72 int vcount, icount, vccount, i; 72 int vcount, icount, vccount, i;
73 icount = p * 6; 73 icount = p * 6;
@@ -113,7 +113,7 @@ evas_model_set_from_cylinder_primitive(Evas_Canvas3D_Mesh *mesh,
113 int frame, 113 int frame,
114 Evas_Canvas3D_Primitive_Mode mode, 114 Evas_Canvas3D_Primitive_Mode mode,
115 int p, 115 int p,
116 Evas_Vec2 tex_scale) 116 Eina_Vector2 tex_scale)
117{ 117{
118 switch (mode) 118 switch (mode)
119 { 119 {
diff --git a/src/lib/evas/common3d/primitives/solids_of_revolution/sphere.c b/src/lib/evas/common3d/primitives/solids_of_revolution/sphere.c
index adbd22aa79..f2e81b0bf5 100644
--- a/src/lib/evas/common3d/primitives/solids_of_revolution/sphere.c
+++ b/src/lib/evas/common3d/primitives/solids_of_revolution/sphere.c
@@ -4,7 +4,7 @@ void
4_set_default_sphere(Evas_Canvas3D_Mesh *mesh, 4_set_default_sphere(Evas_Canvas3D_Mesh *mesh,
5 int frame, 5 int frame,
6 int p, 6 int p,
7 Evas_Vec2 tex_scale) 7 Eina_Vector2 tex_scale)
8{ 8{
9 int vcount, icount, vccount, i, j; 9 int vcount, icount, vccount, i, j;
10 icount = p * p * 6; 10 icount = p * p * 6;
@@ -55,7 +55,7 @@ void
55_set_sphere_with_alternative_uv(Evas_Canvas3D_Mesh *mesh, 55_set_sphere_with_alternative_uv(Evas_Canvas3D_Mesh *mesh,
56 int frame, 56 int frame,
57 int p, 57 int p,
58 Evas_Vec2 tex_scale) 58 Eina_Vector2 tex_scale)
59{ 59{
60 int vcount, icount, vccount, i, j; 60 int vcount, icount, vccount, i, j;
61 61
@@ -115,9 +115,9 @@ _set_sphere_with_alternative_uv(Evas_Canvas3D_Mesh *mesh,
115 /* Triangulation of sphere mesh in appliance with buffer of indices. */ 115 /* Triangulation of sphere mesh in appliance with buffer of indices. */
116 for (i = 0; i < icount; i += 3) 116 for (i = 0; i < icount; i += 3)
117 { 117 {
118 Evas_Vec3 e1, e2; 118 Eina_Vector3 e1, e2;
119 float du1, du2, dv1, dv2, f; 119 float du1, du2, dv1, dv2, f;
120 Evas_Vec3 tangent; 120 Eina_Vector3 tangent;
121 int num0, num1, num2; 121 int num0, num1, num2;
122 122
123 num0 = indices[i + 0]; 123 num0 = indices[i + 0];
@@ -166,7 +166,7 @@ evas_model_set_from_sphere_primitive(Evas_Canvas3D_Mesh *mesh,
166 int frame, 166 int frame,
167 Evas_Canvas3D_Primitive_Mode mode, 167 Evas_Canvas3D_Primitive_Mode mode,
168 int p, 168 int p,
169 Evas_Vec2 tex_scale) 169 Eina_Vector2 tex_scale)
170{ 170{
171 switch (mode) 171 switch (mode)
172 { 172 {
diff --git a/src/lib/evas/common3d/primitives/solids_of_revolution/torus.c b/src/lib/evas/common3d/primitives/solids_of_revolution/torus.c
index 91101229fa..99016c620a 100644
--- a/src/lib/evas/common3d/primitives/solids_of_revolution/torus.c
+++ b/src/lib/evas/common3d/primitives/solids_of_revolution/torus.c
@@ -5,7 +5,7 @@ evas_model_set_from_torus_primitive(Evas_Canvas3D_Mesh *mesh,
5 int frame, 5 int frame,
6 Evas_Real ratio, 6 Evas_Real ratio,
7 int p, 7 int p,
8 Evas_Vec2 tex_scale) 8 Eina_Vector2 tex_scale)
9{ 9{
10 int vcount, icount, vccount, i, j; 10 int vcount, icount, vccount, i, j;
11 icount = p * p * 6; 11 icount = p * p * 6;
diff --git a/src/lib/evas/common3d/primitives/surfaces/surface.c b/src/lib/evas/common3d/primitives/surfaces/surface.c
index 8d0bd3fc46..7698ba5fb6 100644
--- a/src/lib/evas/common3d/primitives/surfaces/surface.c
+++ b/src/lib/evas/common3d/primitives/surfaces/surface.c
@@ -1,8 +1,8 @@
1#include "../primitive_common.h" 1#include "../primitive_common.h"
2 2
3Evas_Vec3 _get_func_normal(Evas_Canvas3D_Surface_Func *func, Evas_Real x, Evas_Real y) 3Eina_Vector3 _get_func_normal(Evas_Canvas3D_Surface_Func *func, Evas_Real x, Evas_Real y)
4{ 4{
5 Evas_Vec3 v00, v01, v10, d1, d2, normal; 5 Eina_Vector3 v00, v01, v10, d1, d2, normal;
6 6
7 func(&v00.x, &v00.y, &v00.z, x, y); 7 func(&v00.x, &v00.y, &v00.z, x, y);
8 func(&v01.x, &v01.y, &v01.z, x, y + 0.01); 8 func(&v01.x, &v01.y, &v01.z, x, y + 0.01);
@@ -18,10 +18,10 @@ Evas_Vec3 _get_func_normal(Evas_Canvas3D_Surface_Func *func, Evas_Real x, Evas_R
18} 18}
19 19
20void 20void
21_normalize(Evas_Vec3 *vertices, Evas_Vec3 *normals, int vcount) 21_normalize(Eina_Vector3 *vertices, Eina_Vector3 *normals, int vcount)
22{ 22{
23 int i; 23 int i;
24 Evas_Vec3 min, max; 24 Eina_Vector3 min, max;
25 min = max = vertices[0]; 25 min = max = vertices[0];
26 26
27#define CHECK_MIN_AND_MAX(coord) \ 27#define CHECK_MIN_AND_MAX(coord) \
@@ -54,7 +54,7 @@ evas_model_set_from_surface_primitive(Evas_Canvas3D_Mesh *mesh,
54 int frame, 54 int frame,
55 Evas_Canvas3D_Surface_Func func, 55 Evas_Canvas3D_Surface_Func func,
56 int p, 56 int p,
57 Evas_Vec2 tex_scale) 57 Eina_Vector2 tex_scale)
58{ 58{
59 int vcount, icount, vccount, i, j, num; 59 int vcount, icount, vccount, i, j, num;
60 icount = p * p * 6; 60 icount = p * p * 6;
diff --git a/src/lib/evas/common3d/primitives/surfaces/terrain.c b/src/lib/evas/common3d/primitives/surfaces/terrain.c
index a71f94fa22..1f83c089ef 100644
--- a/src/lib/evas/common3d/primitives/surfaces/terrain.c
+++ b/src/lib/evas/common3d/primitives/surfaces/terrain.c
@@ -79,7 +79,7 @@ void
79evas_model_set_from_terrain_primitive(Evas_Canvas3D_Mesh *mesh, 79evas_model_set_from_terrain_primitive(Evas_Canvas3D_Mesh *mesh,
80 int frame, 80 int frame,
81 int p, 81 int p,
82 Evas_Vec2 tex_scale) 82 Eina_Vector2 tex_scale)
83{ 83{
84 evas_model_set_from_surface_primitive(mesh, frame, _perlin_terrain, p, tex_scale); 84 evas_model_set_from_surface_primitive(mesh, frame, _perlin_terrain, p, tex_scale);
85} 85}