[EGIT] [core/efl] master 04/04: Edje: add of some new features and fixes for Canvas3d types in edje_calc.
cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=ef767580a5f9f16a6e866db1883dec97ae5becfb commit ef767580a5f9f16a6e866db1883dec97ae5becfb Author: perepelits.m <perepelit...@samsung.com> Date: Wed Feb 17 14:48:33 2016 -0800 Edje: add of some new features and fixes for Canvas3d types in edje_calc. Summary: Adding of new properties for light in edje-3d. Recalculation of main properties in Canvas3D parts to provide animation (only those which I used in widgets). Checking of frame existing when setting material. Reviewers: cedric, raster, Hermet Subscribers: jpeg, artem.popov Differential Revision: https://phab.enlightenment.org/D3694 Signed-off-by: Cedric BAIL <ced...@osg.samsung.com> --- src/bin/edje/edje_cc_handlers.c | 11 +++ src/lib/edje/edje_calc.c| 164 +--- src/lib/edje/edje_data.c| 4 + src/lib/edje/edje_private.h | 7 ++ 4 files changed, 141 insertions(+), 45 deletions(-) diff --git a/src/bin/edje/edje_cc_handlers.c b/src/bin/edje/edje_cc_handlers.c index 3a8bbe7..4ce5a86 100644 --- a/src/bin/edje/edje_cc_handlers.c +++ b/src/bin/edje/edje_cc_handlers.c @@ -10628,6 +10628,17 @@ st_collections_group_parts_part_description_camera_properties(void) ed->camera.camera.frustum_near = FROM_DOUBLE(parse_float(2)); ed->camera.camera.frustum_far = FROM_DOUBLE(parse_float(3)); } + else if (current_part->type == EDJE_PART_TYPE_LIGHT) + { +Edje_Part_Description_Light *ed; + +ed = (Edje_Part_Description_Light*) current_desc; + +ed->light.light.fovy = FROM_DOUBLE(parse_float(0)); +ed->light.light.aspect = FROM_DOUBLE(parse_float(1)); +ed->light.light.frustum_near = FROM_DOUBLE(parse_float(2)); +ed->light.light.frustum_far = FROM_DOUBLE(parse_float(3)); + } else { ERR("parse error %s:%i. camera attributes in non-CAMERA and non-LIGHT part.", diff --git a/src/lib/edje/edje_calc.c b/src/lib/edje/edje_calc.c index ce2652b..a36a80e 100644 --- a/src/lib/edje/edje_calc.c +++ b/src/lib/edje/edje_calc.c @@ -2863,12 +2863,49 @@ _edje_part_recalc_single(Edje *ed, case EDJE_PART_TYPE_SWALLOW: case EDJE_PART_TYPE_GROUP: case EDJE_PART_TYPE_PROXY: - case EDJE_PART_TYPE_MESH_NODE: - case EDJE_PART_TYPE_LIGHT: - case EDJE_PART_TYPE_CAMERA: case EDJE_PART_TYPE_SNAPSHOT: break; + case EDJE_PART_TYPE_LIGHT: + { + Edje_Part_Description_Light *light_desc = (Edje_Part_Description_Light *)desc; + + params->type.node.data[0] = light_desc->light.orientation.data[0]; + params->type.node.point.x = light_desc->light.position.point.x; + params->type.node.point.y = light_desc->light.position.point.y; + params->type.node.point.z = light_desc->light.position.point.z; + + break; + } + + case EDJE_PART_TYPE_CAMERA: + { + Edje_Part_Description_Camera *camera_desc = (Edje_Part_Description_Camera *)desc; + + params->type.node.data[0] = camera_desc->camera.orientation.data[0]; + params->type.node.point.x = camera_desc->camera.position.point.x; + params->type.node.point.y = camera_desc->camera.position.point.y; + params->type.node.point.z = camera_desc->camera.position.point.z; + + break; + } + + case EDJE_PART_TYPE_MESH_NODE: + { + Edje_Part_Description_Mesh_Node *mesh_desc = (Edje_Part_Description_Mesh_Node *)desc; + + params->type.node.frame = mesh_desc->mesh_node.mesh.frame; + params->type.node.data[0] = mesh_desc->mesh_node.orientation.data[0]; + params->type.node.point.x = mesh_desc->mesh_node.position.point.x; + params->type.node.point.y = mesh_desc->mesh_node.position.point.y; + params->type.node.point.z = mesh_desc->mesh_node.position.point.z; + params->type.node.scale_3d.x = mesh_desc->mesh_node.scale_3d.x; + params->type.node.scale_3d.y = mesh_desc->mesh_node.scale_3d.y; + params->type.node.scale_3d.z = mesh_desc->mesh_node.scale_3d.z; + + break; + } + case EDJE_PART_TYPE_GRADIENT: /* FIXME: THIS ONE SHOULD NEVER BE TRIGGERED. */ break; @@ -4328,6 +4365,32 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags, Edje_Calc_Params *sta p3->type.text.align.y = FFP(p1->type.text.align.y, p2->type.text.align.y, pos); p3->type.text.ellipsis = TO_DOUBLE(FINTP(p1->type.text.ellipsis, p2->type.text.ellipsis, pos2)); break; + case EDJE_PART_TYPE_MESH_NODE: + p3->type.node.frame = INTP(p1->type.node.frame, p2->type.node.frame, pos); + p3-&g
[EGIT] [core/efl] master 07/08: edje: add new part types to edje_cache
cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=9589bb07625bbe0ca8adb8bffc12512f3ea8bffc commit 9589bb07625bbe0ca8adb8bffc12512f3ea8bffc Author: perepelits.m <perepelit...@samsung.com> Date: Fri Feb 5 08:19:40 2016 +0100 edje: add new part types to edje_cache Summary: Add new part types (Mesh_Node, Camera, Light) to edje_cache Reviewers: cedric, raster, Hermet Subscribers: jpeg, artem.popov Differential Revision: https://phab.enlightenment.org/D3533 Signed-off-by: Cedric BAIL <ced...@osg.samsung.com> --- src/lib/edje/edje_cache.c | 9 + 1 file changed, 9 insertions(+) diff --git a/src/lib/edje/edje_cache.c b/src/lib/edje/edje_cache.c index e6e99b4..4c232b9 100644 --- a/src/lib/edje/edje_cache.c +++ b/src/lib/edje/edje_cache.c @@ -34,6 +34,9 @@ edje_cache_emp_alloc(Edje_Part_Collection_Directory_Entry *ce) INIT_EMP_BOTH(EXTERNAL, Edje_Part_Description_External, ce); INIT_EMP_BOTH(SPACER, Edje_Part_Description_Common, ce); INIT_EMP_BOTH(SNAPSHOT, Edje_Part_Description_Snapshot, ce); + INIT_EMP_BOTH(MESH_NODE, Edje_Part_Description_Mesh_Node, ce); + INIT_EMP_BOTH(LIGHT, Edje_Part_Description_Light, ce); + INIT_EMP_BOTH(CAMERA, Edje_Part_Description_Camera, ce); INIT_EMP(part, Edje_Part, ce); } @@ -53,6 +56,9 @@ edje_cache_emp_free(Edje_Part_Collection_Directory_Entry *ce) eina_mempool_del(ce->mp.EXTERNAL); eina_mempool_del(ce->mp.SPACER); eina_mempool_del(ce->mp.SNAPSHOT); + eina_mempool_del(ce->mp.MESH_NODE); + eina_mempool_del(ce->mp.LIGHT); + eina_mempool_del(ce->mp.CAMERA); eina_mempool_del(ce->mp.part); memset(>mp, 0, sizeof (ce->mp)); @@ -68,6 +74,9 @@ edje_cache_emp_free(Edje_Part_Collection_Directory_Entry *ce) eina_mempool_del(ce->mp_rtl.EXTERNAL); eina_mempool_del(ce->mp_rtl.SPACER); eina_mempool_del(ce->mp_rtl.SNAPSHOT); + eina_mempool_del(ce->mp_rtl.MESH_NODE); + eina_mempool_del(ce->mp_rtl.LIGHT); + eina_mempool_del(ce->mp_rtl.CAMERA); memset(>mp_rtl, 0, sizeof (ce->mp_rtl)); ce->ref = NULL; } --
[EGIT] [core/efl] master 04/04: Evas: remove extra if from evas_3d_utils.h
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=ba31dc71944d209c107f63b383368d0676a783d1 commit ba31dc71944d209c107f63b383368d0676a783d1 Author: perepelits.m <perepelit...@samsung.com> Date: Wed Jan 13 13:48:32 2016 +0900 Evas: remove extra if from evas_3d_utils.h Summary: remove extra if from evas_3d_utils.h according to Coverity (CID1339788) Reviewers: raster, Hermet, cedric Subscribers: jpeg, artem.popov Differential Revision: https://phab.enlightenment.org/D3558 --- src/lib/evas/include/evas_3d_utils.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/lib/evas/include/evas_3d_utils.h b/src/lib/evas/include/evas_3d_utils.h index 9b901b4..b2eb08e 100644 --- a/src/lib/evas/include/evas_3d_utils.h +++ b/src/lib/evas/include/evas_3d_utils.h @@ -1746,8 +1746,6 @@ evas_convex_hull_get(float *data, int count, int stride, Eina_Inarray *vertex, { if ((!equivalent_triangle) && (!second_exist_twice) && (!triangle_chain) && (if_two < 2)) { - if (new_elem2) -free (new_elem2); new_elem2 = malloc(sizeof(Evas_Triangle3)); evas_triangle3_set(new_elem2, best, , ); eina_array_push(_elems, new_elem2); --
[EGIT] [core/efl] master 03/03: evas: fix optimization of vertex count in convex hull
cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=687df102d67d118b92e43504be48f88fd1e96ea8 commit 687df102d67d118b92e43504be48f88fd1e96ea8 Author: perepelits.m <perepelit...@samsung.com> Date: Sat Jan 9 00:32:47 2016 +0100 evas: fix optimization of vertex count in convex hull Summary: FLT_COMPARISON should be used everywhere in evas_3d_utils.h Reviewers: cedric, raster, Hermet Subscribers: jpeg, artem.popov Differential Revision: https://phab.enlightenment.org/D3551 Signed-off-by: Cedric BAIL <ced...@osg.samsung.com> --- src/lib/evas/include/evas_3d_utils.h | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/lib/evas/include/evas_3d_utils.h b/src/lib/evas/include/evas_3d_utils.h index cc557c6..9b901b4 100644 --- a/src/lib/evas/include/evas_3d_utils.h +++ b/src/lib/evas/include/evas_3d_utils.h @@ -1339,6 +1339,7 @@ convex_hull_vertex_set(Evas_Triangle3 *el, unsigned short int *vertex_count, flo vect = el->p2; break; } + (*vertex_count)++; *vertex = (float*) realloc(*vertex, (10 * (*vertex_count)) * sizeof(float)); @@ -1805,11 +1806,11 @@ evas_convex_hull_get(float *data, int count, int stride, Eina_Inarray *vertex, #define CHECK_AND_SET_VERTEX(coord) \ exist1 = EINA_FALSE; \ - for (i = 0, new_stride = 0; (i < vertex_count) && !exist1; i++, new_stride += 10) \ + for (i = 0, new_stride = 0; (i < vertex_count) && !exist1; i++, new_stride += 10) \ { \ -if ((k > 0) && (el->p##coord.x == found_vertex[new_stride]) && \ -(el->p##coord.y == found_vertex[new_stride + 1]) && \ -(el->p##coord.z == found_vertex[new_stride + 2])) \ +if ((k > 0) && !FLT_COMPARISON(el->p##coord.x, found_vertex[new_stride]) && \ +!FLT_COMPARISON(el->p##coord.y, found_vertex[new_stride + 1]) && \ +!FLT_COMPARISON(el->p##coord.z, found_vertex[new_stride + 2])) \ { \ exist1 = EINA_TRUE; \ found_index[3 * k + coord] = i; \ --
[EGIT] [core/efl] master 02/13: evas: fix ply example after adding of new savers and loaders.
cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=2c9131ac66b8a62be7a7a5c6cd6bc70f8b4d8939 commit 2c9131ac66b8a62be7a7a5c6cd6bc70f8b4d8939 Author: perepelits.m <perepelit...@samsung.com> Date: Mon Jan 4 12:31:20 2016 -0800 evas: fix ply example after adding of new savers and loaders. Summary: Before adding of new saver and loader for ply format we had a chance to set EVAS_CANVAS3D_SHADE_MODE_VERTEX_COLOR for every mesh, now we save only existing atributes and there are a lot of meshes we have to set EVAS_CANVAS3D_SHADE_MODE_VERTEX_COLOR. [FIX] Reviewers: cedric, raster, Hermet Subscribers: jpeg, artem.popov Differential Revision: https://phab.enlightenment.org/D3412 Signed-off-by: Cedric BAIL <ced...@osg.samsung.com> --- src/examples/evas/evas-3d-ply.c | 13 ++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/examples/evas/evas-3d-ply.c b/src/examples/evas/evas-3d-ply.c index 10881aa..25e3288 100644 --- a/src/examples/evas/evas-3d-ply.c +++ b/src/examples/evas/evas-3d-ply.c @@ -43,7 +43,14 @@ static const char *file_name[8] = {"Normal_UVs_Colors.ply", "NoNormal_NoUVs_Colors.ply", "NoNormal_NoUVs_NoColors.ply"}; -int draw_mode[2] = {EVAS_CANVAS3D_SHADE_MODE_PHONG, EVAS_CANVAS3D_SHADE_MODE_VERTEX_COLOR}; +int draw_mode[8] = {EVAS_CANVAS3D_SHADE_MODE_PHONG, +EVAS_CANVAS3D_SHADE_MODE_PHONG, +EVAS_CANVAS3D_SHADE_MODE_VERTEX_COLOR, +EVAS_CANVAS3D_SHADE_MODE_SHADOW_MAP_RENDER, +EVAS_CANVAS3D_SHADE_MODE_VERTEX_COLOR, +EVAS_CANVAS3D_SHADE_MODE_SHADOW_MAP_RENDER, +EVAS_CANVAS3D_SHADE_MODE_VERTEX_COLOR, +EVAS_CANVAS3D_SHADE_MODE_SHADOW_MAP_RENDER}; Ecore_Evas *ecore_evas = NULL; Evas *evas = NULL; @@ -197,7 +204,7 @@ main(void) eo_do(mesh[i], efl_file_set(buffer, NULL), evas_canvas3d_mesh_frame_material_set(0, material), - evas_canvas3d_mesh_shade_mode_set(draw_mode[(i % 16) / 8])); + evas_canvas3d_mesh_shade_mode_set(draw_mode[(i % 8)])); snprintf(buffer, PATH_MAX, "%s%s", output_template, file_name[i % 8]); eo_do(mesh[i], efl_file_save(buffer, NULL, NULL)); @@ -207,7 +214,7 @@ main(void) eo_do(mesh[i], efl_file_set(buffer, NULL), evas_canvas3d_mesh_frame_material_set(0, material), - evas_canvas3d_mesh_shade_mode_set(draw_mode[(i % 16) / 8])); + evas_canvas3d_mesh_shade_mode_set(draw_mode[(i % 8)])); } mesh_node[i] = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, --
[EGIT] [core/efl] master 02/04: Evas: Refactor model's savers and loaders.
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=01a32f64c0ffbe2ce048f8eb016d685913558cf5 commit 01a32f64c0ffbe2ce048f8eb016d685913558cf5 Author: perepelits.m <perepelit...@samsung.com> Date: Thu Dec 10 16:37:30 2015 +0900 Evas: Refactor model's savers and loaders. Summary: Move common part to a separated document. Make code more readable using smaller functions. (from Task T2713) I did it again because somehow test is passing now. It seems like this test suite is unstable. Please, let me know if there are any errors after running distcheck. Reviewers: cedric, raster, Hermet, stefan_schmidt Subscribers: jpeg, artem.popov Differential Revision: https://phab.enlightenment.org/D3420 --- src/Makefile_Evas.am | 4 +- ...odel_common.c => evas_model_load_save_common.c} | 2 +- ...odel_common.h => evas_model_load_save_common.h} | 0 .../evas/model_loaders/eet/evas_model_load_eet.c | 2 - .../evas/model_loaders/ply/evas_model_load_ply.c | 319 + .../evas/model_savers/eet/evas_model_save_eet.c| 20 +- .../evas/model_savers/obj/evas_model_save_obj.c| 239 +-- .../evas/model_savers/ply/evas_model_save_ply.c| 121 +--- 8 files changed, 317 insertions(+), 390 deletions(-) diff --git a/src/Makefile_Evas.am b/src/Makefile_Evas.am index 3f7dd39..d76356d 100644 --- a/src/Makefile_Evas.am +++ b/src/Makefile_Evas.am @@ -224,8 +224,8 @@ lib/evas/canvas/evas_canvas3d_node_callback.h lib_evas_libevas_la_SOURCES += \ lib/evas/common3d/save_load/evas_model_load.c \ lib/evas/common3d/save_load/evas_model_save.c \ -lib/evas/common3d/save_load/evas_model_common.c \ -lib/evas/common3d/save_load/evas_model_common.h \ +lib/evas/common3d/save_load/evas_model_load_save_common.c \ +lib/evas/common3d/save_load/evas_model_load_save_common.h \ modules/evas/model_loaders/eet/evas_model_load_eet.c \ modules/evas/model_loaders/md2/evas_model_load_md2.c \ modules/evas/model_loaders/obj/evas_model_load_obj.c \ diff --git a/src/lib/evas/common3d/save_load/evas_model_common.c b/src/lib/evas/common3d/save_load/evas_model_load_save_common.c similarity index 99% rename from src/lib/evas/common3d/save_load/evas_model_common.c rename to src/lib/evas/common3d/save_load/evas_model_load_save_common.c index 612bccd..190ba59 100644 --- a/src/lib/evas/common3d/save_load/evas_model_common.c +++ b/src/lib/evas/common3d/save_load/evas_model_load_save_common.c @@ -1,4 +1,4 @@ -#include "evas_model_common.h" +#include "evas_model_load_save_common.h" # define SAVE_MESH_INDICES_COPY \ if (header.indices_count) \ diff --git a/src/lib/evas/common3d/save_load/evas_model_common.h b/src/lib/evas/common3d/save_load/evas_model_load_save_common.h similarity index 100% rename from src/lib/evas/common3d/save_load/evas_model_common.h rename to src/lib/evas/common3d/save_load/evas_model_load_save_common.h diff --git a/src/modules/evas/model_loaders/eet/evas_model_load_eet.c b/src/modules/evas/model_loaders/eet/evas_model_load_eet.c index f5b1b6b..e049e2c 100644 --- a/src/modules/evas/model_loaders/eet/evas_model_load_eet.c +++ b/src/modules/evas/model_loaders/eet/evas_model_load_eet.c @@ -127,5 +127,3 @@ evas_model_load_file_eet(Evas_Canvas3D_Mesh *mesh, Eina_File *file) _evas_canvas3d_eet_file_free(eet_file); } - - diff --git a/src/modules/evas/model_loaders/ply/evas_model_load_ply.c b/src/modules/evas/model_loaders/ply/evas_model_load_ply.c index 1beef18..971e951 100644 --- a/src/modules/evas/model_loaders/ply/evas_model_load_ply.c +++ b/src/modules/evas/model_loaders/ply/evas_model_load_ply.c @@ -1,44 +1,4 @@ -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif - -#include -#include "stdio.h" -#include "evas_common_private.h" -#include "evas_private.h" -#include - -/* set value to position [x][y] to array name which have. */ -#define ARRAY_2D(name, x, y, count_y) (*(name + x * count_y + y)) - -/* Structures for reading data from file. */ -typedef struct _PLY_HeaderPLY_Header; - -struct _PLY_Header -{ - int vertices_count; - int triangles_count; - Eina_Bool existence_of_geometries; - Eina_Bool existence_of_normals; - Eina_Bool existence_of_texcoords; - Eina_Bool existence_of_colors; -}; - -/* create new header */ -static inline PLY_Header -_new_ply_header() -{ - PLY_Header header; - - header.vertices_count = 0; - header.triangles_count = 0; - header.existence_of_geometries = EINA_FALSE; - header.existence_of_normals = EINA_FALSE; - header.existence_of_texcoords = EINA_FALSE; - header.existence_of_colors = EINA_FALSE; - - return header; -} +#include "evas_model_load_save_common.h" static inline char * _to_next_line(char *current) @@ -81,8 +41
[EGIT] [core/efl] master 01/05: edje: Remove redondant array in Evas 3D edd (part2)
cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=a19786649f0eba0bafc842c861934647d22074c7 commit a19786649f0eba0bafc842c861934647d22074c7 Author: perepelits.m <perepelit...@samsung.com> Date: Wed Dec 2 14:09:33 2015 -0800 edje: Remove redondant array in Evas 3D edd (part2) Summary: There are more redundant arrays to be deleted. In fact I don't think string name of descriptor shouldn't never change, I was testing some 2D examples and this is not true. Reviewers: raster, jpeg, cedric Subscribers: artem.popov, cedric Differential Revision: https://phab.enlightenment.org/D3361 Signed-off-by: Cedric BAIL <ced...@osg.samsung.com> --- src/lib/edje/edje_data.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/src/lib/edje/edje_data.c b/src/lib/edje/edje_data.c index 8406878..6bebd15 100644 --- a/src/lib/edje/edje_data.c +++ b/src/lib/edje/edje_data.c @@ -926,8 +926,6 @@ _edje_edd_init(void) EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_mesh_node, Edje_Part_Description_Mesh_Node, "mesh_node.aabb2.rel_to", mesh_node.aabb2.rel_to, EET_T_INT); EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_mesh_node, Edje_Part_Description_Mesh_Node, "mesh_node.orientation.type", mesh_node.orientation.type, EET_T_INT); EET_DATA_DESCRIPTOR_ADD_SUB_NESTED_LOOK(_edje_edd_edje_part_description_mesh_node, Edje_Part_Description_Mesh_Node, mesh_node); - EET_DATA_DESCRIPTOR_ADD_BASIC_ARRAY(_edje_edd_edje_part_description_mesh_node, Edje_Part_Description_Mesh_Node, "mesh_node.orientation.angle_axis", mesh_node.orientation.data, EDJE_T_FLOAT); - EET_DATA_DESCRIPTOR_ADD_BASIC_ARRAY(_edje_edd_edje_part_description_mesh_node, Edje_Part_Description_Mesh_Node, "mesh_node.orientation.quaternion", mesh_node.orientation.data, EDJE_T_FLOAT); EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_mesh_node, Edje_Part_Description_Mesh_Node, "mesh_node.texture.id", mesh_node.texture.id, EET_T_INT); EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_mesh_node, Edje_Part_Description_Mesh_Node, "mesh_node.texture.set", mesh_node.texture.set, EET_T_UCHAR); EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_mesh_node, Edje_Part_Description_Mesh_Node, "mesh_node.texture.wrap1", mesh_node.texture.wrap1, EET_T_UCHAR); @@ -951,8 +949,6 @@ _edje_edd_init(void) EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_light, Edje_Part_Description_Light, "light.position.space", light.position.space, EET_T_CHAR); EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_light, Edje_Part_Description_Light, "light.orientation.type", light.orientation.type, EET_T_INT); EET_DATA_DESCRIPTOR_ADD_SUB_NESTED_LOOK(_edje_edd_edje_part_description_light, Edje_Part_Description_Light, light); - EET_DATA_DESCRIPTOR_ADD_BASIC_ARRAY(_edje_edd_edje_part_description_light, Edje_Part_Description_Light, "light.orientation.angle_axis", light.orientation.data, EDJE_T_FLOAT); - EET_DATA_DESCRIPTOR_ADD_BASIC_ARRAY(_edje_edd_edje_part_description_light, Edje_Part_Description_Light, "light.orientation.quaternion", light.orientation.data, EDJE_T_FLOAT); EET_DATA_DESCRIPTOR_ADD_SUB_NESTED(_edje_edd_edje_part_description_light, Edje_Part_Description_Light, "light.properties.ambient", light.properties.ambient, _edje_edd_edje_part_description_3d_color); EET_DATA_DESCRIPTOR_ADD_SUB_NESTED(_edje_edd_edje_part_description_light, Edje_Part_Description_Light, "light.properties.diffuse", light.properties.diffuse, _edje_edd_edje_part_description_3d_color); EET_DATA_DESCRIPTOR_ADD_SUB_NESTED(_edje_edd_edje_part_description_light, Edje_Part_Description_Light, "light.properties.specular", light.properties.specular, _edje_edd_edje_part_description_3d_color); @@ -967,8 +963,6 @@ _edje_edd_init(void) EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_camera, Edje_Part_Description_Camera, "camera.position.space", camera.position.space, EET_T_CHAR); EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_camera, Edje_Part_Description_Camera, "camera.orientation.type", camera.orientation.type, EET_T_INT); EET_DATA_DESCRIPTOR_ADD_SUB_NESTED_LOOK(_edje_edd_edje_part_description_camera, Edje_Part_Description_Camera, camera); - EET_DATA_DESCRIPTOR_ADD_BASIC_ARRAY(_edje_edd_edje_part_description_camera, Edje_Part_Description_Camera, "camera.orientation.angle_axis", camera.orientation.data, EDJE_T_FLOAT); - EET_DATA_DESCRIPTOR_ADD_BASIC_ARRAY(_edje_edd_edje_part_description_camera, Edje_Part_Description_Camera, "camera.orientation.quaternion", camera.orientation.data, EDJE_T_FLOAT); EET_DATA_DES
[EGIT] [core/efl] master 01/01: evas: refactor model's savers and loaders.
cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=32c33ed64dda542c7cfc952fc656bb711260441b commit 32c33ed64dda542c7cfc952fc656bb711260441b Author: perepelits.m <perepelit...@samsung.com> Date: Tue Dec 1 16:38:48 2015 -0800 evas: refactor model's savers and loaders. Summary: Move common part to a separated document. Make code more readable using smaller functions. (from Task T2713) Reviewers: cedric, raster, Hermet Subscribers: artem.popov Differential Revision: https://phab.enlightenment.org/D3373 --- src/Makefile_Evas.am | 3 +- ...odel_common.c => evas_model_load_save_common.c} | 2 +- ...odel_common.h => evas_model_load_save_common.h} | 0 .../evas/model_loaders/eet/evas_model_load_eet.c | 2 - .../evas/model_loaders/ply/evas_model_load_ply.c | 319 + .../evas/model_savers/eet/evas_model_save_eet.c| 1 - .../evas/model_savers/obj/evas_model_save_obj.c| 239 +-- .../evas/model_savers/ply/evas_model_save_ply.c| 121 +--- 8 files changed, 307 insertions(+), 380 deletions(-) diff --git a/src/Makefile_Evas.am b/src/Makefile_Evas.am index 9cc57a5..f768e2d 100644 --- a/src/Makefile_Evas.am +++ b/src/Makefile_Evas.am @@ -224,8 +224,7 @@ lib/evas/canvas/evas_canvas3d_node_callback.h lib_evas_libevas_la_SOURCES += \ lib/evas/common3d/save_load/evas_model_load.c \ lib/evas/common3d/save_load/evas_model_save.c \ -lib/evas/common3d/save_load/evas_model_common.c \ -lib/evas/common3d/save_load/evas_model_common.h \ +lib/evas/common3d/save_load/evas_model_load_save_common.c \ modules/evas/model_loaders/eet/evas_model_load_eet.c \ modules/evas/model_loaders/md2/evas_model_load_md2.c \ modules/evas/model_loaders/obj/evas_model_load_obj.c \ diff --git a/src/lib/evas/common3d/save_load/evas_model_common.c b/src/lib/evas/common3d/save_load/evas_model_load_save_common.c similarity index 99% rename from src/lib/evas/common3d/save_load/evas_model_common.c rename to src/lib/evas/common3d/save_load/evas_model_load_save_common.c index 612bccd..190ba59 100644 --- a/src/lib/evas/common3d/save_load/evas_model_common.c +++ b/src/lib/evas/common3d/save_load/evas_model_load_save_common.c @@ -1,4 +1,4 @@ -#include "evas_model_common.h" +#include "evas_model_load_save_common.h" # define SAVE_MESH_INDICES_COPY \ if (header.indices_count) \ diff --git a/src/lib/evas/common3d/save_load/evas_model_common.h b/src/lib/evas/common3d/save_load/evas_model_load_save_common.h similarity index 100% rename from src/lib/evas/common3d/save_load/evas_model_common.h rename to src/lib/evas/common3d/save_load/evas_model_load_save_common.h diff --git a/src/modules/evas/model_loaders/eet/evas_model_load_eet.c b/src/modules/evas/model_loaders/eet/evas_model_load_eet.c index a36dff4..ea74208 100644 --- a/src/modules/evas/model_loaders/eet/evas_model_load_eet.c +++ b/src/modules/evas/model_loaders/eet/evas_model_load_eet.c @@ -128,5 +128,3 @@ evas_model_load_file_eet(Evas_Canvas3D_Mesh *mesh, Eina_File *file) _evas_canvas3d_eet_file_free(); } - - diff --git a/src/modules/evas/model_loaders/ply/evas_model_load_ply.c b/src/modules/evas/model_loaders/ply/evas_model_load_ply.c index 1beef18..971e951 100644 --- a/src/modules/evas/model_loaders/ply/evas_model_load_ply.c +++ b/src/modules/evas/model_loaders/ply/evas_model_load_ply.c @@ -1,44 +1,4 @@ -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif - -#include -#include "stdio.h" -#include "evas_common_private.h" -#include "evas_private.h" -#include - -/* set value to position [x][y] to array name which have. */ -#define ARRAY_2D(name, x, y, count_y) (*(name + x * count_y + y)) - -/* Structures for reading data from file. */ -typedef struct _PLY_HeaderPLY_Header; - -struct _PLY_Header -{ - int vertices_count; - int triangles_count; - Eina_Bool existence_of_geometries; - Eina_Bool existence_of_normals; - Eina_Bool existence_of_texcoords; - Eina_Bool existence_of_colors; -}; - -/* create new header */ -static inline PLY_Header -_new_ply_header() -{ - PLY_Header header; - - header.vertices_count = 0; - header.triangles_count = 0; - header.existence_of_geometries = EINA_FALSE; - header.existence_of_normals = EINA_FALSE; - header.existence_of_texcoords = EINA_FALSE; - header.existence_of_colors = EINA_FALSE; - - return header; -} +#include "evas_model_load_save_common.h" static inline char * _to_next_line(char *current) @@ -81,8 +41,8 @@ _read_data(float *array, int place, int count, char *current, float divider) return current; } -static inline PLY_Header -_read_header(char *map)//Check properties of mesh in .ply file. +static inline Eina_Bool +_read_ply_header(char *map, Evas_Model_Load_Sav
[EGIT] [core/efl] master 10/10: evas: fix PLY loader and saver.
cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=bcf38c58174406299b02d94e49c29e05f1bc58b1 commit bcf38c58174406299b02d94e49c29e05f1bc58b1 Author: perepelits.m <perepelit...@samsung.com> Date: Mon Nov 23 08:28:24 2015 +0100 evas: fix PLY loader and saver. Summary: Use less memory by indexation vertices and not keeping more than one copy of it (from task T2713). [Fix] Reviewers: cedric, raster, Hermet Subscribers: artem.popov Differential Revision: https://phab.enlightenment.org/D3355 Signed-off-by: Cedric BAIL <ced...@osg.samsung.com> --- .../evas/model_loaders/ply/evas_model_load_ply.c | 125 +++-- .../evas/model_savers/ply/evas_model_save_ply.c| 9 +- 2 files changed, 70 insertions(+), 64 deletions(-) diff --git a/src/modules/evas/model_loaders/ply/evas_model_load_ply.c b/src/modules/evas/model_loaders/ply/evas_model_load_ply.c index ad56abc..78b2918 100644 --- a/src/modules/evas/model_loaders/ply/evas_model_load_ply.c +++ b/src/modules/evas/model_loaders/ply/evas_model_load_ply.c @@ -103,6 +103,7 @@ _read_header(char *map)//Check properties of mesh in .ply file. sscanf(helping_pointer[1], "%d", _count); +ERR("\n HEADER %d", header.vertices_count); free(helping_pointer); helping_pointer = eina_str_split(map, "end_header\n", 0); @@ -181,7 +182,7 @@ void evas_model_load_file_ply(Evas_Canvas3D_Mesh *mesh, Eina_File *file) { Evas_Canvas3D_Mesh_Data *pd; - int i = 0, j = 0, k = 0, count_of_triangles_in_line = 0; + int i = 0, j = 0, count_of_triangles_in_line = 0; float *pos, *nor, *tex, *col; int stride_pos, stride_nor, stride_tex, stride_col; char *current, *map; @@ -223,20 +224,20 @@ evas_model_load_file_ply(Evas_Canvas3D_Mesh *mesh, Eina_File *file) _tex_coords_ply = malloc(header.vertices_count * 2 * sizeof(float)); if (header.existence_of_colors) _colors_ply = malloc(header.vertices_count * 3 * sizeof(float)); - int *_triangles = malloc(header.triangles_count * 3 * sizeof(int)); + unsigned short *_indices = malloc(header.triangles_count * 3 * sizeof(unsigned short)); if ((header.existence_of_geometries && (_vertices_ply == NULL)) || (header.existence_of_normals && (_normals_ply == NULL)) || (header.existence_of_texcoords && (_tex_coords_ply == NULL)) || (header.existence_of_colors && (_colors_ply == NULL)) || - (_triangles == NULL)) + (_indices == NULL)) { ERR("Allocate memory is failed."); free(_vertices_ply); free(_normals_ply); free(_tex_coords_ply); free(_colors_ply); -free(_triangles); +free(_indices); return; } @@ -252,30 +253,30 @@ evas_model_load_file_ply(Evas_Canvas3D_Mesh *mesh, Eina_File *file) current = _to_begin_of_line(current); } - for (i = 0; i < header.triangles_count;) + for (i = 0; i < header.triangles_count * 3;) { sscanf (current,"%d", _of_triangles_in_line); count_of_triangles_in_line -= 2; current = _to_next_number(current, 1); -sscanf (current,"%i", _2D(_triangles, i, 0, 3)); +sscanf (current,"%hu", _indices + i); for (j = 0; j < count_of_triangles_in_line; j++) { if (j > 0) - ARRAY_2D(_triangles, i, 0, 3) = ARRAY_2D(_triangles, (i - 1), 0, 3); + _indices[i] = _indices[i - 3]; current = _to_next_number(current, 1); - sscanf (current,"%i %i", - _2D(_triangles, i, 1, 3), - _2D(_triangles, i, 2, 3)); - i++; + sscanf (current,"%hu %hu", + _indices + i + 1, + _indices + i + 2); + i+=3; } current = _to_next_line(current); } /* prepare of mesh and take pointers to data which must be read */ eo_do(mesh, - evas_canvas3d_mesh_vertex_count_set(header.triangles_count * 3), + evas_canvas3d_mesh_vertex_count_set(header.vertices_count), evas_canvas3d_mesh_vertex_assembly_set(EVAS_CANVAS3D_VERTEX_ASSEMBLY_TRIANGLES), evas_canvas3d_mesh_frame_add(0), evas_canvas3d_mesh_frame_vertex_data_copy_set(0, EVAS_CANVAS3D_VERTEX_ATTRIB_POSITION, 0, NULL), @@ -298,62 +299,66 @@ evas_model_load_file_ply(Evas_Canvas3D_Mesh *mesh, Eina_File *file) if (stride_tex == 0) stride_tex = sizeof(float) * 2; if (stride_col == 0) stride_col = sizeof(float) * 4; - for (j = 0; j < header.triangles_count; j++) + + for (j = 0; j < header.vertices_count; j++) { -for (k = 0; k < 3; k++) - { - float *p, *n, *t, *c; +float *p, *n, *t, *c;
[EGIT] [core/efl] master 01/01: evas-3d: fix primitives
cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=0dd60ced443f087a142a8fd0f5664af732a9b029 commit 0dd60ced443f087a142a8fd0f5664af732a9b029 Author: perepelits.m <perepelit...@samsung.com> Date: Sun Oct 4 16:37:17 2015 +0200 evas-3d: fix primitives Summary: There were warnings after adding primitive in the same frame more then once, the check was added to avoid it @fix Reviewers: cedric, raster, Hermet Subscribers: cedric, artem.popov Differential Revision: https://phab.enlightenment.org/D3090 Signed-off-by: Cedric BAIL <ced...@osg.samsung.com> --- src/lib/evas/canvas/evas_canvas3d_mesh.c| 11 +++ src/lib/evas/canvas/evas_canvas3d_mesh.eo | 8 src/lib/evas/common3d/primitives/primitive_common.h | 14 -- 3 files changed, 31 insertions(+), 2 deletions(-) diff --git a/src/lib/evas/canvas/evas_canvas3d_mesh.c b/src/lib/evas/canvas/evas_canvas3d_mesh.c index 892ecd1..e7bc091 100644 --- a/src/lib/evas/canvas/evas_canvas3d_mesh.c +++ b/src/lib/evas/canvas/evas_canvas3d_mesh.c @@ -306,6 +306,17 @@ _evas_canvas3d_mesh_vertex_count_get(Eo *obj EINA_UNUSED, Evas_Canvas3D_Mesh_Dat return pd->vertex_count; } +EOLIAN static Eina_Bool +_evas_canvas3d_mesh_frame_exist(Eo *obj EINA_UNUSED, Evas_Canvas3D_Mesh_Data *pd, int frame) +{ + Evas_Canvas3D_Mesh_Frame *f = evas_canvas3d_mesh_frame_find(pd, frame); + + if (f) + return EINA_TRUE; + + return EINA_FALSE; +} + EOLIAN static void _evas_canvas3d_mesh_frame_add(Eo *obj, Evas_Canvas3D_Mesh_Data *pd, int frame) { diff --git a/src/lib/evas/canvas/evas_canvas3d_mesh.eo b/src/lib/evas/canvas/evas_canvas3d_mesh.eo index aa1a23e..df01a85 100644 --- a/src/lib/evas/canvas/evas_canvas3d_mesh.eo +++ b/src/lib/evas/canvas/evas_canvas3d_mesh.eo @@ -156,6 +156,14 @@ class Evas.Canvas3D.Mesh (Evas.Canvas3D.Object, Evas.Common_Interface, Efl.File) ]] } + frame_exist { + [[Returns EINA_TRUE if frame was added and EINA_FALSE in other case.]] + params { +@in frame: int; [[Frame number.]] + } + return: Eina_Bool; + } + frame_add { [[Add a key frame to the given mesh. diff --git a/src/lib/evas/common3d/primitives/primitive_common.h b/src/lib/evas/common3d/primitives/primitive_common.h index 7f4e39d..50092d7 100644 --- a/src/lib/evas/common3d/primitives/primitive_common.h +++ b/src/lib/evas/common3d/primitives/primitive_common.h @@ -17,9 +17,14 @@ unsigned short *indices = malloc(sizeof(short) * icount); #define SET_VERTEX_DATA(frame) \ + Eina_Bool frame_exist; \ + eo_do(mesh, \ + frame_exist = evas_canvas3d_mesh_frame_exist(frame)); \ + if (!frame_exist) \ + eo_do(mesh, \ + evas_canvas3d_mesh_frame_add(frame)); \ eo_do(mesh, \ evas_canvas3d_mesh_vertex_count_set(vcount), \ - evas_canvas3d_mesh_frame_add(frame), \ evas_canvas3d_mesh_index_data_copy_set(EVAS_CANVAS3D_INDEX_FORMAT_UNSIGNED_SHORT, \ icount, [0])); \ _set_vec3_vertex_data(mesh, frame, vcount, vertices, EVAS_CANVAS3D_VERTEX_ATTRIB_POSITION); \ @@ -29,9 +34,14 @@ free(indices); #define SET_VERTEX_DATA_FROM_ARRAY(mesh, frame, varray, vcount, indices, icount) \ + Eina_Bool frame_exist; \ + eo_do(mesh, \ + frame_exist = evas_canvas3d_mesh_frame_exist(frame)); \ + if (!frame_exist) \ + eo_do(mesh, \ + evas_canvas3d_mesh_frame_add(frame)); \ eo_do(mesh, \ evas_canvas3d_mesh_vertex_count_set(vcount), \ - evas_canvas3d_mesh_frame_add(frame), \ evas_canvas3d_mesh_index_data_copy_set(EVAS_CANVAS3D_INDEX_FORMAT_UNSIGNED_SHORT, \ icount, [0])); \ _set_vertex_data_from_array(mesh, frame, varray, EVAS_CANVAS3D_VERTEX_ATTRIB_POSITION, \ --
[EGIT] [core/efl] master 01/02: evas: CID 1323091
cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=a7679b60ac0c9f9fef3bb3a399cde944276f86d4 commit a7679b60ac0c9f9fef3bb3a399cde944276f86d4 Author: perepelits.m <perepelit...@samsung.com> Date: Wed Sep 9 00:07:45 2015 +0200 evas: CID 1323091 Summary: @fix CID 1323091 for Coverity Reviewers: cedric, Hermet, raster Subscribers: cedric, artem.popov Differential Revision: https://phab.enlightenment.org/D3037 Signed-off-by: Cedric BAIL <ced...@osg.samsung.com> --- src/lib/evas/canvas/evas_canvas3d_node.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/lib/evas/canvas/evas_canvas3d_node.c b/src/lib/evas/canvas/evas_canvas3d_node.c index 03f985d..0b930ee 100644 --- a/src/lib/evas/canvas/evas_canvas3d_node.c +++ b/src/lib/evas/canvas/evas_canvas3d_node.c @@ -1048,8 +1048,11 @@ evas_canvas3d_node_mesh_collect(Evas_Canvas3D_Node *node, void *data) { mesh_pd = eo_data_scope_get(mesh, MY_CLASS); f = evas_canvas3d_mesh_frame_find(mesh_pd, 0); - if (f == NULL) - ERR("Not existing mesh frame."); + if (!f) + { + ERR("Not existing mesh frame."); + continue; + } float *tangent_data = (float *)f->vertices[EVAS_CANVAS3D_VERTEX_ATTRIB_TANGENT].data; if (!tangent_data && ((mesh_pd->shade_mode == EVAS_CANVAS3D_SHADE_MODE_NORMAL_MAP) || --
[EGIT] [core/efl] master 02/04: evas: add tangent space algorithm
cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=be33840b6b703f2b1e64c8e4788f968ad8c7f87b commit be33840b6b703f2b1e64c8e4788f968ad8c7f87b Author: perepelits.m perepelit...@samsung.com Date: Wed Jul 29 22:24:02 2015 +0200 evas: add tangent space algorithm Summary: This is a logic of tangent data calculation, we need it in order to avoid bugs with normal mapping after building with opengl=yes. Reviewers: Hermet, raster, cedric Reviewed By: cedric Subscribers: Oleksander, cedric, artem.popov Differential Revision: https://phab.enlightenment.org/D2802 Signed-off-by: Cedric BAIL ced...@osg.samsung.com --- src/lib/evas/include/evas_3d_utils.h | 223 +++ 1 file changed, 223 insertions(+) diff --git a/src/lib/evas/include/evas_3d_utils.h b/src/lib/evas/include/evas_3d_utils.h index bd6aaa6..3239e3e 100644 --- a/src/lib/evas/include/evas_3d_utils.h +++ b/src/lib/evas/include/evas_3d_utils.h @@ -439,6 +439,22 @@ evas_vec3_quaternion_rotate(Evas_Vec3 *out, const Evas_Vec3 *v, const Evas_Vec4 out-z = v-z + uv.z + uuv.z; } +static inline void +evas_vec3_orthogonal_projection_on_plain(Evas_Vec3 *out, const Evas_Vec3 *v, const Evas_Vec3 *normal) +{ + Evas_Real a; + Evas_Vec3 projection; + + /* Orthoprojection of vector on the plane is the difference + between a vector and its orthogonal projection onto the orthogonal + complement to the plane */ + a = evas_vec3_dot_product(v, normal) / evas_vec3_length_square_get(normal); + evas_vec3_scale(projection, normal, a); + evas_vec3_subtract(out, v, projection); + + return; +} + /* 4D vector */ static inline void evas_vec4_set(Evas_Vec4 *dst, Evas_Real x, Evas_Real y, Evas_Real z, Evas_Real w) @@ -2157,6 +2173,46 @@ box_intersection_box(Evas_Box3 *v1, Evas_Box3 *v2) } static inline void +tangent_new_basis(Evas_Vec3 *out, Evas_Triangle3 *triangle, + Evas_Vec2 *a, Evas_Vec2 *b, Evas_Vec2 *c) +{ + Evas_Vec2 new1, new2; + Evas_Vec3 old1, old2; + evas_vec3_set(out, 0, 0, 0); + + evas_vec2_subtract(new1, b, a); + evas_vec2_subtract(new2, c, a); + evas_vec3_subtract(old1, (triangle-p1), (triangle-p0)); + evas_vec3_subtract(old2, (triangle-p2), (triangle-p0)); + + + /* calculation of new basis(in system coordinates of texturing) by solution of system of equations */ + if (new2.y != 0) + { +evas_vec3_scale(old2, old2, (new1.y / new2.y)); +evas_vec2_scale(new2, new2, (new1.y / new2.y)); + +evas_vec2_subtract(new1, new1, new2); +evas_vec3_subtract(old1, old1, old2); + +evas_vec3_scale(out, old1, 1 / new1.x); + } + + else if (new1.y != 0) + { +evas_vec3_scale(old1, old1, (new2.y / new1.y)); +evas_vec2_scale(new1, new1, (new2.y / new1.y)); + +evas_vec2_subtract(new2, new2, new1); +evas_vec3_subtract(old2, old2, old1); + +evas_vec3_scale(out, old2, 1 / new2.x); + } + + return; +} + +static inline void convex_hull_vertex_set(Evas_Triangle3 *el, int *vertex_count, float **vertex, unsigned short int **index, unsigned int k, int *leader, int coord) { @@ -2716,3 +2772,170 @@ evas_convex_hull_get(float *data, int count, int stride, float **vertex, return; } + +static inline void +tangent_space_weighted_sum(Evas_Vec3 *big_t, Evas_Vec3 *little_t, +Evas_Real *big_angle, Evas_Real little_angle) +{ + /* one way to calculate tangent in vertex that is found in many triangles */ + evas_vec3_scale(big_t, big_t, *big_angle / (*big_angle + little_angle)); + evas_vec3_scale(little_t, little_t, little_angle / (*big_angle + little_angle)); + evas_vec3_add(big_t, big_t, little_t); + *big_angle += little_angle; + return; +} + + +static inline Evas_Real +tangent_space_triangle_angle_get(Evas_Vec3 *first, Evas_Vec3 *second, Evas_Vec3 *third) +{ + Evas_Vec3 a, b, c; + Evas_Real cos, arccos; + + evas_vec3_subtract(a, second, third); + evas_vec3_subtract(b, third, first); + evas_vec3_subtract(c, first, second); + + cos = -(evas_vec3_length_square_get(a) - evas_vec3_length_square_get(b) - + evas_vec3_length_square_get(c)) / (2 * evas_vec3_length_get(b) * + evas_vec3_length_get(c)); + arccos = acos(cos); + + return arccos; +} + +static inline void +evas_tangent_space_get(float *data, float *tex_data, float *normal_data, unsigned short int *index, int vertex_count, + int index_count, int stride, int tex_stride, int normal_stride, float **tangent) +{ + Eina_Bool if_not_primitive = EINA_FALSE; + Evas_Real big_angle, little_angle; + Evas_Triangle3 triangle; + Evas_Vec2 tex1, tex2, tex3; + Evas_Vec3 big_tangent, little_tangent, normal; + Evas_Vec4 *plain = NULL; + int i, j, k, l, m, found_index = NULL; + int indexes[3]; + + if (!tex_data
[EGIT] [core/efl] master 02/02: edje: add Convex Hull logic
cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=e40c223181ec6b46437796809f6c2a7595bfc9bd commit e40c223181ec6b46437796809f6c2a7595bfc9bd Author: perepelits.m perepelit...@samsung.com Date: Sat Jul 4 02:39:08 2015 +0200 edje: add Convex Hull logic Summary: This is an algorithm which calcuates a convex hull of some mesh, in fact it returns vertex, index, normal and color datas, though the new mesh could be build just as for AABB Reviewers: raster, Hermet, cedric Subscribers: cedric, artem.popov Differential Revision: https://phab.enlightenment.org/D2585 Signed-off-by: Cedric BAIL ced...@osg.samsung.com --- src/lib/evas/include/evas_3d_utils.h | 681 +++ 1 file changed, 681 insertions(+) diff --git a/src/lib/evas/include/evas_3d_utils.h b/src/lib/evas/include/evas_3d_utils.h index 828348d..bd6aaa6 100644 --- a/src/lib/evas/include/evas_3d_utils.h +++ b/src/lib/evas/include/evas_3d_utils.h @@ -7,6 +7,10 @@ #define DEGREE_TO_RADIAN(x) (((x) * M_PI) / 180.0) #define EVAS_MATRIX_IS_IDENTITY 0x0001 +#define MIN_DIFF 0.001 + +#define FLT_COMPARISON(a, b)\ + (fabs(a - b) FLT_EPSILON) typedef struct _Evas_Color Evas_Color; typedef struct _Evas_Vec2 Evas_Vec2; @@ -345,6 +349,15 @@ evas_vec3_distance_square_get(const Evas_Vec3 *a, const Evas_Vec3 *b) return evas_vec3_length_square_get(v); } +static inline Evas_Real +evas_vec3_angle_get(const Evas_Vec3 *a, const Evas_Vec3 *b) +{ + Evas_Real angle; + + angle = evas_vec3_dot_product(a, b) / (evas_vec3_length_get(a) * evas_vec3_length_get(b)); + return angle; +} + static inline void evas_vec3_normalize(Evas_Vec3 *out, const Evas_Vec3 *v) { @@ -571,6 +584,25 @@ evas_vec4_transform(Evas_Vec4 *out, const Evas_Vec4 *v, const Evas_Mat4 *m) } static inline void +evas_vec4_plain_by_points(Evas_Vec4 *out, const Evas_Vec3 *a, const Evas_Vec3 *b, const Evas_Vec3 *c) +{ + out-x = (b-y - a-y) * (c-z - a-z) - (b-z - a-z) * (c-y - a-y); + out-y = -(b-x - a-x) * (c-z - a-z) + (b-z - a-z) * (c-x - a-x); + out-z = (b-x - a-x) * (c-y - a-y) - (b-y - a-y) * (c-x - a-x); + out-w = (-a-x) * ((b-y - a-y)*(c-z - a-z) - (b-z - a-z) * (c-y - a-y)) - +(-a-y) * ((b-x - a-x) * (c-z - a-z) - (b-z - a-z) * (c-x - a-x)) + +(-a-z) * ((b-x - a-x) * (c-y - a-y) - (b-y - a-y) * (c-x - a-x)); +} + +static inline Evas_Real +evas_vec4_angle_plains(Evas_Vec4 *a, Evas_Vec4 *b) +{ + return (Evas_Real) ((a-x * b-x) + (a-y * b-y) + (a-z * b-z)) / ((sqrt((a-x * a-x) + + (a-y * a-y) + (a-z * a-z))) * (sqrt((b-x * b-x) + (b-y * b-y) + + (b-z * b-z; +} + +static inline void evas_vec3_homogeneous_position_set(Evas_Vec3 *out, const Evas_Vec4 *v) { /* Assume v is a positional vector. (v-w != 0.0) */ @@ -590,6 +622,95 @@ evas_vec3_homogeneous_direction_set(Evas_Vec3 *out, const Evas_Vec4 *v) out-z = v-z; } +static inline Eina_Bool +evas_vec3_if_equivalent(Evas_Vec3 *a, const Evas_Vec3 *b) +{ + /* Assume v is a directional vector. (v-w == 0.0) */ + return ((a-x == b-x) (a-y == b-y) (a-z == b-z)); +} + +static inline void +evas_triangle3_set(Evas_Triangle3 *v, Evas_Vec3 *a, Evas_Vec3 *b, Evas_Vec3 *c) +{ + evas_vec3_copy(v-p0, a); + evas_vec3_copy(v-p1, b); + evas_vec3_copy(v-p2, c); +} + +static inline Eina_Bool +evas_triangle3_is_line(Evas_Triangle3 *v) +{ + if (evas_vec3_if_equivalent(v-p0, v-p1) || + evas_vec3_if_equivalent(v-p0, v-p2) || + evas_vec3_if_equivalent(v-p1, v-p2)) + return EINA_TRUE; + + return EINA_FALSE; +} + +static inline Eina_Bool +convex_hull_triangle3_if_not_first_edje(Evas_Triangle3 *v, Evas_Vec3 *a, Evas_Vec3 *b) +{ + if (((v-p1.x == a-x) (v-p1.y == a-y) (v-p1.z == a-z)) + ((v-p2.x == b-x) (v-p2.y == b-y) (v-p2.z == b-z))) + return EINA_TRUE; + else if (((v-p2.x == a-x) (v-p2.y == a-y) (v-p2.z == a-z)) +((v-p1.x == b-x) (v-p1.y == b-y) (v-p1.z == b-z))) + return EINA_TRUE; + + return EINA_FALSE; +} + +static inline Eina_Bool +convex_hull_triangle3_if_first_edje(Evas_Triangle3 *v, Evas_Vec3 *a, Evas_Vec3 *b) +{ + if ((!FLT_COMPARISON(v-p0.x, a-x) !FLT_COMPARISON(v-p0.y, a-y) +!FLT_COMPARISON(v-p0.z, a-z)) (!FLT_COMPARISON(v-p1.x, b-x) +!FLT_COMPARISON(v-p1.y, b-y) !FLT_COMPARISON(v-p1.z, b-z))) + return EINA_TRUE; + else if ((!FLT_COMPARISON(v-p1.x, a-x) !FLT_COMPARISON(v-p1.y, a-y) + !FLT_COMPARISON(v-p1.z, a-z)) (!FLT_COMPARISON(v-p0.x, b-x) + !FLT_COMPARISON(v-p0.y, b-y) !FLT_COMPARISON(v-p0.z, b-z))) + return EINA_TRUE; + + return EINA_FALSE; +} + +static inline Eina_Bool +convex_hull_triangle3_if_first_point(Evas_Triangle3 *v, Evas_Vec3 *a) +{ + return ((v-p0.x == a-x) (v-p0.y == a-y) (v-p0.z == a-z)); +} + +static inline Eina_Bool
[EGIT] [core/efl] master 04/04: evas: fix shooter example
cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=f259ff8d4cf30ce2c23137702af04e123c599f99 commit f259ff8d4cf30ce2c23137702af04e123c599f99 Author: perepelits.m perepelit...@samsung.com Date: Thu Jun 25 16:22:00 2015 +0200 evas: fix shooter example Summary: Disable atlas flag for all objects, fix motion algorithm, add primitives. Reviewers: Hermet, raster, cedric Subscribers: cedric, artem.popov Differential Revision: https://phab.enlightenment.org/D2693 Signed-off-by: Cedric BAIL ced...@osg.samsung.com --- src/examples/evas/shooter/evas-3d-shooter-header.h | 2 + src/examples/evas/shooter/evas-3d-shooter-macros.h | 129 src/examples/evas/shooter/evas-3d-shooter.c| 333 + 3 files changed, 150 insertions(+), 314 deletions(-) diff --git a/src/examples/evas/shooter/evas-3d-shooter-header.h b/src/examples/evas/shooter/evas-3d-shooter-header.h index 235c85b..de70da7 100644 --- a/src/examples/evas/shooter/evas-3d-shooter-header.h +++ b/src/examples/evas/shooter/evas-3d-shooter-header.h @@ -21,6 +21,8 @@ typedef struct _Scene_Data { + Eo *cube_primitive; + Eo *sphere_primitive; Eo *cylinder_primitive; Eo *texture_diffuse_eagle; Eo *texture_diffuse_world; diff --git a/src/examples/evas/shooter/evas-3d-shooter-macros.h b/src/examples/evas/shooter/evas-3d-shooter-macros.h index 2eb3282..bf3964a 100644 --- a/src/examples/evas/shooter/evas-3d-shooter-macros.h +++ b/src/examples/evas/shooter/evas-3d-shooter-macros.h @@ -62,10 +62,50 @@ typedef struct _vec2 float y; } vec2; -#define KEY_MOTION(lateral, camera) \ - { \ - lateral_motion_indicator = lateral; \ - camera_move = camera; \ +#define KEY_MOTION(way) \ + { \ + for (i = 0; (motion_vec[i] 0) (!pressed); i++)\ +pressed = (motion_vec[i] == way);\ + \ + if (!pressed) \ +motion_vec[i] = way; \ + \ + if ((way == 1) || (way == 3)) \ +camera_move = CAMERA_MOVE; \ + else \ +camera_move = -CAMERA_MOVE; \ + \ + if (way 3) \ +lateral_motion_indicator = 0;\ + else \ +lateral_motion_indicator = 1;\ + } + +#define KEY_MOTION_DOWN(way) \ + { \ + while ((motion_vec[i] != way) (i 4)) \ +i++; \ + for (j = i; j 3; j++)\ +motion_vec[j] = motion_vec[j + 1]; \ + motion_vec[3] = 0; \ + \ + i = 0; \ + while (motion_vec[i] 0) \ +i++; \ + if (i 0) \ +{\ + if ((motion_vec[i - 1] == 1) || (motion_vec[i - 1] == 3)) \ + camera_move = CAMERA_MOVE; \ + else \ + camera_move = -CAMERA_MOVE; \ + \ + if (motion_vec[i-1] 3) \ + lateral_motion_indicator = 0; \ + else \ + lateral_motion_indicator = 1; \ +}\ + else \ +camera_move = 0; \ } @@ -86,7 +126,7 @@ typedef struct _vec2 eo_do(mesh, evas_canvas3d_mesh_shade_mode_set(EVAS_CANVAS3D_SHADE_MODE_PHONG)); -#define SETUP_MESH(Object, Name, a, d, s
[EGIT] [core/efl] master 02/03: eina: add eina_quaternion_set
cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=9bf6f14a8a59195fe9be004aaff446c51474fc5d commit 9bf6f14a8a59195fe9be004aaff446c51474fc5d Author: perepelits.m perepelit...@samsung.com Date: Wed Jun 17 16:15:36 2015 +0200 eina: add eina_quaternion_set Reviewers: cedric, raster, Hermet Subscribers: cedric, artem.popov Differential Revision: https://phab.enlightenment.org/D2717 Signed-off-by: Cedric BAIL ced...@osg.samsung.com --- src/lib/eina/eina_quaternion.c | 21 + src/lib/eina/eina_quaternion.h | 5 + 2 files changed, 26 insertions(+) diff --git a/src/lib/eina/eina_quaternion.c b/src/lib/eina/eina_quaternion.c index 2ef0ede..8c751ac 100644 --- a/src/lib/eina/eina_quaternion.c +++ b/src/lib/eina/eina_quaternion.c @@ -28,6 +28,17 @@ #include eina_matrix.h #include eina_quaternion.h +EAPI void +eina_quaternion_f16p16_set(Eina_Quaternion *out, + Eina_F16p16 x, Eina_F16p16 y, + Eina_F16p16 z, Eina_F16p16 w) +{ + out-w = w; + out-x = x; + out-y = y; + out-z = z; +} + EAPI Eina_F16p16 eina_quaternion_f16p16_norm(const Eina_Quaternion_F16p16 *q) { @@ -338,6 +349,16 @@ eina_quaternion_f16p16_rotation_matrix3_get(Eina_Matrix3_F16p16 *m, eina_f16p16_add(xx, yy)); } +EAPI void +eina_quaternion_set(Eina_Quaternion *out, double x, +double y, double z, double w) +{ + out-w = w; + out-x = x; + out-y = y; + out-z = z; +} + EAPI double eina_quaternion_norm(const Eina_Quaternion *q) { diff --git a/src/lib/eina/eina_quaternion.h b/src/lib/eina/eina_quaternion.h index 7191c96..42d3cfe 100644 --- a/src/lib/eina/eina_quaternion.h +++ b/src/lib/eina/eina_quaternion.h @@ -53,6 +53,9 @@ struct _Eina_Point_3D_F16p16 Eina_F16p16 z; }; +EAPI void eina_quaternion_f16p16_set(Eina_Quaternion *out, + Eina_F16p16 x, Eina_F16p16 y, + Eina_F16p16 z, Eina_F16p16 w); EAPI Eina_F16p16 eina_quaternion_f16p16_norm(const Eina_Quaternion_F16p16 *q); EAPI void eina_quaternion_f16p16_negative(Eina_Quaternion_F16p16 *out, const Eina_Quaternion_F16p16 *in); @@ -87,6 +90,8 @@ EAPI void eina_quaternion_f16p16_rotate(Eina_Point_3D_F16p16 *p, EAPI void eina_quaternion_f16p16_rotation_matri3_get(Eina_Matrix3_F16p16 *m, const Eina_Quaternion_F16p16 *q); +EAPI void eina_quaternion_set(Eina_Quaternion *q, double x, + double y, double z, double w); EAPI double eina_quaternion_norm(const Eina_Quaternion *q); EAPI void eina_quaternion_negative(Eina_Quaternion *out, const Eina_Quaternion *in); --
[EGIT] [core/efl] master 07/08: edje: add of descriptors for Evas_3d integration.
cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=8915982562c438f7a2c2f517744d58efdbad503d commit 8915982562c438f7a2c2f517744d58efdbad503d Author: perepelits.m perepelit...@samsung.com Date: Tue May 26 19:05:39 2015 +0200 edje: add of descriptors for Evas_3d integration. Summary: Creates descriptors for all structures Reviewers: cedric, Hermet, raster Subscribers: cedric, artem.popov Differential Revision: https://phab.enlightenment.org/D2544 Signed-off-by: Cedric BAIL ced...@osg.samsung.com --- src/lib/edje/edje_data.c | 165 ++- 1 file changed, 164 insertions(+), 1 deletion(-) diff --git a/src/lib/edje/edje_data.c b/src/lib/edje/edje_data.c index 7af11c2..0aa16d1 100644 --- a/src/lib/edje/edje_data.c +++ b/src/lib/edje/edje_data.c @@ -14,6 +14,8 @@ Eet_Data_Descriptor *_edje_edd_edje_image_directory = NULL; Eet_Data_Descriptor *_edje_edd_edje_image_directory_entry = NULL; Eet_Data_Descriptor *_edje_edd_edje_image_directory_set = NULL; Eet_Data_Descriptor *_edje_edd_edje_image_directory_set_entry = NULL; +Eet_Data_Descriptor *_edje_edd_edje_model_directory = NULL; +Eet_Data_Descriptor *_edje_edd_edje_model_directory_entry = NULL; Eet_Data_Descriptor *_edje_edd_edje_limit = NULL; Eet_Data_Descriptor *_edje_edd_edje_limit_pointer = NULL; Eet_Data_Descriptor *_edje_edd_edje_sound_sample = NULL; @@ -44,6 +46,12 @@ Eet_Data_Descriptor *_edje_edd_edje_part_description_textblock = NULL; Eet_Data_Descriptor *_edje_edd_edje_part_description_box = NULL; Eet_Data_Descriptor *_edje_edd_edje_part_description_table = NULL; Eet_Data_Descriptor *_edje_edd_edje_part_description_external = NULL; +Eet_Data_Descriptor *_edje_edd_edje_part_description_3d_color = NULL; +Eet_Data_Descriptor *_edje_edd_edje_part_description_3d_offset = NULL; +Eet_Data_Descriptor *_edje_edd_edje_part_description_3d_vec = NULL; +Eet_Data_Descriptor *_edje_edd_edje_part_description_mesh_node = NULL; +Eet_Data_Descriptor *_edje_edd_edje_part_description_light = NULL; +Eet_Data_Descriptor *_edje_edd_edje_part_description_camera = NULL; Eet_Data_Descriptor *_edje_edd_edje_part_description_variant_list = NULL; Eet_Data_Descriptor *_edje_edd_edje_part_description_rectangle_pointer = NULL; Eet_Data_Descriptor *_edje_edd_edje_part_description_spacer_pointer = NULL; @@ -56,6 +64,9 @@ Eet_Data_Descriptor *_edje_edd_edje_part_description_textblock_pointer = NULL; Eet_Data_Descriptor *_edje_edd_edje_part_description_box_pointer = NULL; Eet_Data_Descriptor *_edje_edd_edje_part_description_table_pointer = NULL; Eet_Data_Descriptor *_edje_edd_edje_part_description_external_pointer = NULL; +Eet_Data_Descriptor *_edje_edd_edje_part_description_mesh_node_pointer = NULL; +Eet_Data_Descriptor *_edje_edd_edje_part_description_light_pointer = NULL; +Eet_Data_Descriptor *_edje_edd_edje_part_description_camera_pointer = NULL; Eet_Data_Descriptor *_edje_edd_edje_part_image_id = NULL; Eet_Data_Descriptor *_edje_edd_edje_part_image_id_pointer = NULL; Eet_Data_Descriptor *_edje_edd_edje_external_param = NULL; @@ -94,6 +105,9 @@ EMP(BOX, box); EMP(TABLE, table); EMP(EXTERNAL, external); EMP(SPACER, spacer); +EMP(MESH_NODE, mesh_node); +EMP(LIGHT, light); +EMP(CAMERA, camera); EAPI Eina_Mempool *_emp_part = NULL; @@ -137,7 +151,10 @@ struct { { EDJE_PART_TYPE_TABLE, table }, { EDJE_PART_TYPE_EXTERNAL, external }, { EDJE_PART_TYPE_PROXY, proxy }, - { EDJE_PART_TYPE_SPACER,spacer } + { EDJE_PART_TYPE_SPACER,spacer }, + { EDJE_PART_TYPE_MESH_NODE, mesh_node }, + { EDJE_PART_TYPE_LIGHT, light }, + { EDJE_PART_TYPE_CAMERA,camera } }; static const char * @@ -203,6 +220,8 @@ _edje_edd_shutdown(void) FREED(_edje_edd_edje_image_directory_entry); FREED(_edje_edd_edje_image_directory_set); FREED(_edje_edd_edje_image_directory_set_entry); + FREED(_edje_edd_edje_model_directory); + FREED(_edje_edd_edje_model_directory_entry); FREED(_edje_edd_edje_limit); FREED(_edje_edd_edje_limit_pointer); FREED(_edje_edd_edje_sound_sample); @@ -233,6 +252,12 @@ _edje_edd_shutdown(void) FREED(_edje_edd_edje_part_description_box); FREED(_edje_edd_edje_part_description_table); FREED(_edje_edd_edje_part_description_external); + FREED(_edje_edd_edje_part_description_mesh_node); + FREED(_edje_edd_edje_part_description_light); + FREED(_edje_edd_edje_part_description_camera); + FREED(_edje_edd_edje_part_description_3d_color); + FREED(_edje_edd_edje_part_description_3d_offset); + FREED(_edje_edd_edje_part_description_3d_vec); FREED(_edje_edd_edje_part_description_variant_list); FREED(_edje_edd_edje_part_description_rectangle_pointer); FREED(_edje_edd_edje_part_description_spacer_pointer); @@ -245,6 +270,9 @@ _edje_edd_shutdown(void) FREED(_edje_edd_edje_part_description_box_pointer); FREED
[EGIT] [core/efl] master 04/05: edje: switch Evas_3D color to use Edje_Color.
cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=d7a53b11f620568a1f374f34a4c24db6a57f6afa commit d7a53b11f620568a1f374f34a4c24db6a57f6afa Author: perepelits.m perepelit...@samsung.com Date: Tue May 19 12:39:05 2015 +0200 edje: switch Evas_3D color to use Edje_Color. Summary: Changes float on uchar as we do in other place for color component Reviewers: raster, Hermet, cedric Reviewed By: cedric Subscribers: cedric, artem.popov Differential Revision: https://phab.enlightenment.org/D2528 Signed-off-by: Cedric BAIL ced...@osg.samsung.com --- src/bin/edje/edje_cc_handlers.c | 32 src/lib/edje/edje_private.h | 18 ++ 2 files changed, 22 insertions(+), 28 deletions(-) diff --git a/src/bin/edje/edje_cc_handlers.c b/src/bin/edje/edje_cc_handlers.c index 21751d3..5b5d233 100644 --- a/src/bin/edje/edje_cc_handlers.c +++ b/src/bin/edje/edje_cc_handlers.c @@ -9561,10 +9561,10 @@ st_collections_group_parts_part_description_properties_ambient(void) ed = (Edje_Part_Description_Light*) current_desc; - ed-light.properties.ambient.r = parse_float_range(0, 0.0, 1.0); - ed-light.properties.ambient.g = parse_float_range(1, 0.0, 1.0); - ed-light.properties.ambient.b = parse_float_range(2, 0.0, 1.0); - ed-light.properties.ambient.a = parse_float_range(3, 0.0, 1.0); + ed-light.properties.ambient.r = parse_int_range(0, 0, 255); + ed-light.properties.ambient.g = parse_int_range(1, 0, 255); + ed-light.properties.ambient.b = parse_int_range(2, 0, 255); + ed-light.properties.ambient.a = parse_int_range(3, 0, 255); break; } case EDJE_PART_TYPE_MESH_NODE: @@ -9573,10 +9573,10 @@ st_collections_group_parts_part_description_properties_ambient(void) ed = (Edje_Part_Description_Mesh_Node*) current_desc; - ed-mesh_node.properties.ambient.r = parse_float_range(0, 0.0, 1.0); - ed-mesh_node.properties.ambient.g = parse_float_range(1, 0.0, 1.0); - ed-mesh_node.properties.ambient.b = parse_float_range(2, 0.0, 1.0); - ed-mesh_node.properties.ambient.a = parse_float_range(3, 0.0, 1.0); + ed-mesh_node.properties.ambient.r = parse_int_range(0, 0, 255); + ed-mesh_node.properties.ambient.g = parse_int_range(1, 0, 255); + ed-mesh_node.properties.ambient.b = parse_int_range(2, 0, 255); + ed-mesh_node.properties.ambient.a = parse_int_range(3, 0, 255); break; } default: @@ -9611,10 +9611,10 @@ st_collections_group_parts_part_description_properties_diffuse(void) ed = (Edje_Part_Description_Light*) current_desc; - ed-light.properties.diffuse.r = parse_float_range(0, 0.0, 1.0); - ed-light.properties.diffuse.g = parse_float_range(1, 0.0, 1.0); - ed-light.properties.diffuse.b = parse_float_range(2, 0.0, 1.0); - ed-light.properties.diffuse.a = parse_float_range(3, 0.0, 1.0); + ed-light.properties.diffuse.r = parse_int_range(0, 0, 255); + ed-light.properties.diffuse.g = parse_int_range(1, 0, 255); + ed-light.properties.diffuse.b = parse_int_range(2, 0, 255); + ed-light.properties.diffuse.a = parse_int_range(3, 0, 255); break; } case EDJE_PART_TYPE_MESH_NODE: @@ -9623,10 +9623,10 @@ st_collections_group_parts_part_description_properties_diffuse(void) ed = (Edje_Part_Description_Mesh_Node*) current_desc; - ed-mesh_node.properties.diffuse.r = parse_float_range(0, 0.0, 1.0); - ed-mesh_node.properties.diffuse.g = parse_float_range(1, 0.0, 1.0); - ed-mesh_node.properties.diffuse.b = parse_float_range(2, 0.0, 1.0); - ed-mesh_node.properties.diffuse.a = parse_float_range(3, 0.0, 1.0); + ed-mesh_node.properties.diffuse.r = parse_int_range(0, 0, 255); + ed-mesh_node.properties.diffuse.g = parse_int_range(1, 0, 255); + ed-mesh_node.properties.diffuse.b = parse_int_range(2, 0, 255); + ed-mesh_node.properties.diffuse.a = parse_int_range(3, 0, 255); break; } default: diff --git a/src/lib/edje/edje_private.h b/src/lib/edje/edje_private.h index d3e120c..e5507e4 100644 --- a/src/lib/edje/edje_private.h +++ b/src/lib/edje/edje_private.h @@ -253,11 +253,6 @@ struct _Edje_Color unsigned char r, g, b, a; }; -struct _Edje_Float_Color -{ - FLOAT_T r, g, b, a; -}; - struct _Edje_Map_Color { int idx; @@ -304,7 +299,6 @@ typedef struct _Edje_Position Edje_Position; typedef struct _Edje_SizeEdje_Size; typedef struct _Edje_Rectangle Edje_Rectangle; typedef struct _Edje_Color Edje_Color; -typedef struct _Edje_Float_Color
[EGIT] [core/efl] master 17/55: edje: add align 3d support.
cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=83bb3b5b5180bbe96d6ea8da1f3b82071b6a01c9 commit 83bb3b5b5180bbe96d6ea8da1f3b82071b6a01c9 Author: perepelits.m perepelit...@samsung.com Date: Thu Apr 16 19:29:01 2015 +0200 edje: add align 3d support. Summary: Adding of Z axis to be aligned Reviewers: cedric, raster, Hermet Subscribers: cedric, artem.popov Differential Revision: https://phab.enlightenment.org/D2368 Signed-off-by: Cedric BAIL ced...@osg.samsung.com --- src/bin/edje/edje_cc_handlers.c | 23 +-- 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/src/bin/edje/edje_cc_handlers.c b/src/bin/edje/edje_cc_handlers.c index 41da0f2..fe11ddb 100644 --- a/src/bin/edje/edje_cc_handlers.c +++ b/src/bin/edje/edje_cc_handlers.c @@ -6377,6 +6377,9 @@ ob_collections_group_parts_part_description(void) ed-minmul.have = 1; ed-minmul.w = FROM_INT(1); ed-minmul.h = FROM_INT(1); + ed-align_3d.x = FROM_DOUBLE(0.5); + ed-align_3d.y = FROM_DOUBLE(0.5); + ed-align_3d.z = FROM_DOUBLE(0.5); } static void @@ -6870,7 +6873,7 @@ st_collections_group_parts_part_description_limit(void) @property align @parameters -[X axis] [Y axis] +[X axis] [Y axis] ([Z axis]) @effect When the displayed object's size is smaller (or bigger) than its container, this property moves it relatively along both @@ -6878,16 +6881,24 @@ st_collections_group_parts_part_description_limit(void) the object touching container's respective ones, while @c 1.0 stands for right/bottom edges of the object (on horizonal/vertical axis, respectively). The default value is -@c 0.5 0.5. +@c 0.5 0.5. There is one more parametr for Z axis in case +of MESH_NODE. @endproperty */ static void st_collections_group_parts_part_description_align(void) { - check_arg_count(2); - - current_desc-align.x = FROM_DOUBLE(parse_float_range(0, 0.0, 1.0)); - current_desc-align.y = FROM_DOUBLE(parse_float_range(1, 0.0, 1.0)); + if (get_arg_count() == 2) + { +current_desc-align.x = FROM_DOUBLE(parse_float_range(0, 0.0, 1.0)); +current_desc-align.y = FROM_DOUBLE(parse_float_range(1, 0.0, 1.0)); + } + else if (get_arg_count() == 3) + { +current_desc-align_3d.x = FROM_DOUBLE(parse_float_range(0, 0.0, 1.0)); +current_desc-align_3d.y = FROM_DOUBLE(parse_float_range(1, 0.0, 1.0)); +current_desc-align_3d.z = FROM_DOUBLE(parse_float_range(2, 0.0, 1.0)); + } } /** --