summaryrefslogtreecommitdiff
path: root/src/lib/evas/canvas/evas_canvas3d_mesh.c
diff options
context:
space:
mode:
authorperepelits.m <perepelits.m@samsung.com>2015-11-09 14:29:44 -0800
committerCedric BAIL <cedric@osg.samsung.com>2015-11-09 14:29:46 -0800
commit3031a4a5c6e7c57c3d40e1a65b3641961c30002a (patch)
tree544401d9f8579bc1a0b0dc7eba9a9143c270d0a3 /src/lib/evas/canvas/evas_canvas3d_mesh.c
parent0c1bb7d7b3d4e9a91ae33455ab761d7e9405c2df (diff)
evas: API for Convex Hull in Evas.Canvas3d
Summary: This API builds vertex and index data of convex hull around the given mesh. Reviewers: raster, perepelits.m, Hermet, cedric Reviewed By: cedric Subscribers: cedric, artem.popov Differential Revision: https://phab.enlightenment.org/D2799 Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
Diffstat (limited to 'src/lib/evas/canvas/evas_canvas3d_mesh.c')
-rw-r--r--src/lib/evas/canvas/evas_canvas3d_mesh.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/lib/evas/canvas/evas_canvas3d_mesh.c b/src/lib/evas/canvas/evas_canvas3d_mesh.c
index e7bc091..f5aaec4 100644
--- a/src/lib/evas/canvas/evas_canvas3d_mesh.c
+++ b/src/lib/evas/canvas/evas_canvas3d_mesh.c
@@ -1127,5 +1127,23 @@ _evas_canvas3d_mesh_shadows_constant_bias_get(Eo *obj EINA_UNUSED, Evas_Canvas3D
1127{ 1127{
1128 return pd->shadows_constant_bias; 1128 return pd->shadows_constant_bias;
1129} 1129}
1130EOLIAN static void
1131_evas_canvas3d_mesh_convex_hull_data_get(Eo *obj EINA_UNUSED, Evas_Canvas3D_Mesh_Data *pd,
1132 int frame, Eina_Inarray *vertex, Eina_Inarray *index)
1133{
1134 int stride;
1135
1136 Evas_Canvas3D_Mesh_Frame *f = evas_canvas3d_mesh_frame_find(pd, frame);
1137 if (f->vertices[EVAS_CANVAS3D_VERTEX_ATTRIB_POSITION].stride != 0)
1138 stride = f->vertices[EVAS_CANVAS3D_VERTEX_ATTRIB_POSITION].stride / sizeof(float);
1139 else
1140 stride = 3;
1141
1142 float *data = (float *)f->vertices[EVAS_CANVAS3D_VERTEX_ATTRIB_POSITION].data;
1143
1144 evas_convex_hull_get(data, pd->vertex_count, stride, vertex, index);
1145
1146 return;
1147}
1130 1148
1131#include "canvas/evas_canvas3d_mesh.eo.c" 1149#include "canvas/evas_canvas3d_mesh.eo.c"