summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorOleksandr Shcherbina <o.shcherbina@samsung.com>2016-03-18 11:55:04 -0700
committerCedric Bail <cedric@osg.samsung.com>2016-03-18 11:55:07 -0700
commitbd200cefc44cb8b03ef465791b4dfc6b6cec85be (patch)
tree5ad057325aaa386dbf25169d985f9112746d0193 /src
parent20c9d087d1d17716c120a3653e74323b6525c792 (diff)
evas.canvas3d: fix wrong output in evas-3d-pick example
Summary: Since that https://git.enlightenment.org/core/efl.git/commit/?id=c850cc0d80b754be851576083eba27a72b58b9f2 we don't use scene object for recalculation pick coordinates. @fix Reviewers: cedric, Hermet, raster Subscribers: jpeg Differential Revision: https://phab.enlightenment.org/D3806 Signed-off-by: Cedric Bail <cedric@osg.samsung.com>
Diffstat (limited to 'src')
-rw-r--r--src/examples/evas/evas-3d-pick.c19
1 files changed, 2 insertions, 17 deletions
diff --git a/src/examples/evas/evas-3d-pick.c b/src/examples/evas/evas-3d-pick.c
index 21d4116df1..be45053a6f 100644
--- a/src/examples/evas/evas-3d-pick.c
+++ b/src/examples/evas/evas-3d-pick.c
@@ -81,35 +81,20 @@ _on_mouse_down(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj,
81 void *event_info) 81 void *event_info)
82{ 82{
83 Evas_Event_Mouse_Down *ev = event_info; 83 Evas_Event_Mouse_Down *ev = event_info;
84 Evas_Coord x, y, w, h;
85 Evas_Coord obj_x, obj_y;
86 int scene_w, scene_h;
87 Evas_Real scene_x, scene_y;
88 Evas_Real s, t; 84 Evas_Real s, t;
89 Evas_Canvas3D_Node *n; 85 Evas_Canvas3D_Node *n;
90 Evas_Canvas3D_Mesh *m; 86 Evas_Canvas3D_Mesh *m;
91 Eina_Bool pick; 87 Eina_Bool pick;
92 88
93 evas_object_geometry_get(obj, &x, &y, &w, &h); 89 pick = evas_canvas3d_scene_pick(scene, ev->canvas.x, ev->canvas.y, &n, &m, &s, &t);
94 90
95 obj_x = ev->canvas.x - x;
96 obj_y = ev->canvas.y - y;
97
98 evas_canvas3d_scene_size_get(scene, &scene_w, &scene_h);
99
100 scene_x = obj_x * scene_w / (Evas_Real)w;
101 scene_y = obj_y * scene_h / (Evas_Real)h;
102
103 pick = evas_canvas3d_scene_pick(scene, scene_x, scene_y, &n, &m, &s, &t);
104 if (pick) printf("Picked : "); 91 if (pick) printf("Picked : ");
105 else printf("Not picked : "); 92 else printf("Not picked : ");
106 93
107 printf("output(%d, %d) canvas(%d, %d) object(%d, %d) scene(%f, %f) texcoord(%f, %f) " 94 printf("output(%d, %d) canvas(%d, %d) texcoord(%f, %f) "
108 "node(%p) mesh(%p)\n", 95 "node(%p) mesh(%p)\n",
109 ev->output.x, ev->output.y, 96 ev->output.x, ev->output.y,
110 ev->canvas.x, ev->canvas.y, 97 ev->canvas.x, ev->canvas.y,
111 obj_x, obj_y,
112 scene_x, scene_y,
113 s, t, n, m); 98 s, t, n, m);
114} 99}
115 100