diff options
author | Oleksandr Shcherbina <o.shcherbina@samsung.com> | 2014-12-01 06:26:28 +0100 |
---|---|---|
committer | Cedric BAIL <cedric@osg.samsung.com> | 2014-12-01 06:26:32 +0100 |
commit | 54c1667d4e4dfc160fa8a7ce6118d6032645314a (patch) | |
tree | c5c1162727d02b2b50b5a83f19cf25b7043a6343 /src/lib/evas/canvas | |
parent | 4366057dc640283d450701b828e48ff83e19f612 (diff) |
evas: Evas_3D - add bounding sphere, revision frustum culling
Summary:
Move check visibility of node from evas_3d_node to evas_3d_camera
Move functionality (normalize, check distance, calculate frustum)
in evas_3d_utils.h (we are planing use evas_is_sphere_in_frustum in evas_gl_3d.c -
don't render mesh if it non visible)
Add possibility check frustum by box, aabb, central point
Refactor example frustum culling
@feature
Reviewers: Hermet, raster, cedric
Subscribers: cedric
Differential Revision: https://phab.enlightenment.org/D1420
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
Diffstat (limited to 'src/lib/evas/canvas')
-rw-r--r-- | src/lib/evas/canvas/evas_3d_camera.c | 44 | ||||
-rw-r--r-- | src/lib/evas/canvas/evas_3d_camera.eo | 19 | ||||
-rw-r--r-- | src/lib/evas/canvas/evas_3d_node.c | 120 | ||||
-rw-r--r-- | src/lib/evas/canvas/evas_3d_node.eo | 33 |
4 files changed, 99 insertions, 117 deletions
diff --git a/src/lib/evas/canvas/evas_3d_camera.c b/src/lib/evas/canvas/evas_3d_camera.c index d8a7d24e35..c6da2d3aa7 100644 --- a/src/lib/evas/canvas/evas_3d_camera.c +++ b/src/lib/evas/canvas/evas_3d_camera.c | |||
@@ -140,5 +140,49 @@ _evas_3d_camera_projection_ortho_set(Eo *obj, Evas_3D_Camera_Data *pd, | |||
140 | eo_do(obj, evas_3d_object_change(EVAS_3D_STATE_CAMERA_PROJECTION, NULL)); | 140 | eo_do(obj, evas_3d_object_change(EVAS_3D_STATE_CAMERA_PROJECTION, NULL)); |
141 | } | 141 | } |
142 | 142 | ||
143 | EOLIAN static Eina_Bool | ||
144 | _evas_3d_camera_node_visible_get(Eo *obj EINA_UNUSED, Evas_3D_Camera_Data *pd, Evas_3D_Node *camera_node, Evas_3D_Node *node, Evas_3D_Frustum_Mode key) | ||
145 | { | ||
146 | Evas_Mat4 matrix_vp; | ||
147 | Evas_Vec4 planes[6]; | ||
148 | Evas_3D_Node_Data *pd_node = eo_data_scope_get(node, EVAS_3D_NODE_CLASS); | ||
149 | Evas_3D_Node_Data *pd_camera = eo_data_scope_get(camera_node, EVAS_3D_NODE_CLASS); | ||
150 | Evas_Vec3 central_point; | ||
151 | |||
152 | if (!node || pd_node->type != EVAS_3D_NODE_TYPE_MESH) | ||
153 | { | ||
154 | ERR("Mesh node %p type mismatch.", node); | ||
155 | return EINA_FALSE; | ||
156 | } | ||
157 | |||
158 | if (!camera_node || pd_camera->type != EVAS_3D_NODE_TYPE_CAMERA) | ||
159 | { | ||
160 | ERR("Camera node %p type mismatch.", camera_node); | ||
161 | return EINA_FALSE; | ||
162 | } | ||
163 | |||
164 | /*get need matrix like multiply projection matrix with view matrix*/ | ||
165 | evas_mat4_multiply(&matrix_vp, &pd->projection, &pd_camera->data.camera.matrix_world_to_eye); | ||
166 | |||
167 | evas_frustum_calculate(planes, &matrix_vp); | ||
168 | |||
169 | if (key == EVAS_3D_FRUSTUM_MODE_BSPHERE) | ||
170 | return evas_is_sphere_in_frustum(&pd_node->bsphere, planes); | ||
171 | else if (key == EVAS_3D_FRUSTUM_MODE_AABB) | ||
172 | return evas_is_box_in_frustum(&pd_node->aabb, planes); | ||
173 | else if (key == EVAS_3D_FRUSTUM_MODE_CENTRAL_POINT) | ||
174 | { | ||
175 | central_point.x = (pd_node->aabb.p0.x + pd_node->aabb.p1.x) / 2; | ||
176 | central_point.y = (pd_node->aabb.p0.y + pd_node->aabb.p1.y) / 2; | ||
177 | central_point.z = (pd_node->aabb.p0.z + pd_node->aabb.p1.z) / 2; | ||
178 | return evas_is_point_in_frustum(¢ral_point, planes); | ||
179 | } | ||
180 | else | ||
181 | { | ||
182 | ERR("Unknown frustun mode."); | ||
183 | return EINA_TRUE; | ||
184 | } | ||
185 | } | ||
186 | |||
143 | #include "canvas/evas_3d_camera.eo.c" | 187 | #include "canvas/evas_3d_camera.eo.c" |
144 | 188 | ||
diff --git a/src/lib/evas/canvas/evas_3d_camera.eo b/src/lib/evas/canvas/evas_3d_camera.eo index 4b4d95e0b9..45e9e9a2c7 100644 --- a/src/lib/evas/canvas/evas_3d_camera.eo +++ b/src/lib/evas/canvas/evas_3d_camera.eo | |||
@@ -96,6 +96,25 @@ class Evas_3D_Camera (Evas_3D_Object, Evas.Common_Interface) | |||
96 | Evas_Real dfar; /*@ Distance to far clipping plane. */ | 96 | Evas_Real dfar; /*@ Distance to far clipping plane. */ |
97 | } | 97 | } |
98 | } | 98 | } |
99 | node_visible_get { | ||
100 | /*@ | ||
101 | Check is bounding sphere of given node inside frustum of camera node. | ||
102 | * | ||
103 | * @param camera The given camera node. | ||
104 | * @param node The given node. | ||
105 | * @return @c EINA_TRUE in frustum, @c EINA_FALSE otherwise | ||
106 | |||
107 | * If the nodes are @ NULL or nodes type mismatch error wrong type of nodes will be generated and returned @ EINA_FALSE. | ||
108 | |||
109 | * @ingroup Evas_3D_Camera | ||
110 | */ | ||
111 | return: bool; | ||
112 | params { | ||
113 | @in Evas_3D_Node *camera_node; | ||
114 | @in Evas_3D_Node *node; | ||
115 | @in Evas_3D_Frustum_Mode key; | ||
116 | } | ||
117 | } | ||
99 | } | 118 | } |
100 | 119 | ||
101 | implements { | 120 | implements { |
diff --git a/src/lib/evas/canvas/evas_3d_node.c b/src/lib/evas/canvas/evas_3d_node.c index 7b30486c26..bcbb1db63f 100644 --- a/src/lib/evas/canvas/evas_3d_node.c +++ b/src/lib/evas/canvas/evas_3d_node.c | |||
@@ -204,6 +204,7 @@ _node_aabb_update(Evas_3D_Node *node, void *data EINA_UNUSED) | |||
204 | Eina_Bool transform_dirty = EINA_FALSE, mesh_geom_dirty = EINA_FALSE; | 204 | Eina_Bool transform_dirty = EINA_FALSE, mesh_geom_dirty = EINA_FALSE; |
205 | Eina_Bool mesh_frame_dirty = EINA_FALSE, member_dirty = EINA_FALSE; | 205 | Eina_Bool mesh_frame_dirty = EINA_FALSE, member_dirty = EINA_FALSE; |
206 | Eina_Bool frame_found = EINA_FALSE, is_change_orientation = EINA_FALSE; | 206 | Eina_Bool frame_found = EINA_FALSE, is_change_orientation = EINA_FALSE; |
207 | Eina_Bool parent_dirty = EINA_FALSE; | ||
207 | const Eina_List *m, *l; | 208 | const Eina_List *m, *l; |
208 | Evas_3D_Mesh *mesh; | 209 | Evas_3D_Mesh *mesh; |
209 | int frame, count, size, i, j; | 210 | int frame, count, size, i, j; |
@@ -217,19 +218,21 @@ _node_aabb_update(Evas_3D_Node *node, void *data EINA_UNUSED) | |||
217 | transform_dirty = evas_3d_object_dirty_get(EVAS_3D_STATE_NODE_TRANSFORM), | 218 | transform_dirty = evas_3d_object_dirty_get(EVAS_3D_STATE_NODE_TRANSFORM), |
218 | mesh_geom_dirty = evas_3d_object_dirty_get(EVAS_3D_STATE_NODE_MESH_GEOMETRY), | 219 | mesh_geom_dirty = evas_3d_object_dirty_get(EVAS_3D_STATE_NODE_MESH_GEOMETRY), |
219 | mesh_frame_dirty = evas_3d_object_dirty_get(EVAS_3D_STATE_NODE_MESH_FRAME), | 220 | mesh_frame_dirty = evas_3d_object_dirty_get(EVAS_3D_STATE_NODE_MESH_FRAME), |
221 | parent_dirty = evas_3d_object_dirty_get(EVAS_3D_STATE_NODE_PARENT), | ||
220 | member_dirty = evas_3d_object_dirty_get(EVAS_3D_STATE_NODE_MEMBER)); | 222 | member_dirty = evas_3d_object_dirty_get(EVAS_3D_STATE_NODE_MEMBER)); |
221 | 223 | ||
222 | if (transform_dirty || | 224 | if (transform_dirty || |
223 | mesh_geom_dirty || | 225 | mesh_geom_dirty || |
224 | mesh_frame_dirty || | 226 | mesh_frame_dirty || |
225 | member_dirty) | 227 | member_dirty || |
228 | parent_dirty) | ||
226 | { | 229 | { |
227 | if (pd->type == EVAS_3D_NODE_TYPE_MESH) | 230 | if (pd->type == EVAS_3D_NODE_TYPE_MESH) |
228 | { | 231 | { |
229 | 232 | ||
230 | if (pd->orientation.x || pd->orientation.y || pd->orientation.z) | 233 | if (pd->orientation_world.x || pd->orientation_world.y || pd->orientation_world.z) |
231 | { | 234 | { |
232 | evas_vec4_set(&orientation, pd->orientation.x, pd->orientation.y, pd->orientation.z, pd->orientation.w); | 235 | evas_vec4_set(&orientation, pd->orientation_world.x, pd->orientation_world.y, pd->orientation_world.z, pd->orientation_world.w); |
233 | is_change_orientation = EINA_TRUE; | 236 | is_change_orientation = EINA_TRUE; |
234 | } | 237 | } |
235 | 238 | ||
@@ -347,19 +350,19 @@ _node_aabb_update(Evas_3D_Node *node, void *data EINA_UNUSED) | |||
347 | evas_vec3_quaternion_rotate(&pd->obb.p0, &pd->obb.p0, &orientation); | 350 | evas_vec3_quaternion_rotate(&pd->obb.p0, &pd->obb.p0, &orientation); |
348 | evas_vec3_quaternion_rotate(&pd->obb.p1, &pd->obb.p1, &orientation); | 351 | evas_vec3_quaternion_rotate(&pd->obb.p1, &pd->obb.p1, &orientation); |
349 | } | 352 | } |
350 | if ((pd->scale.x != 1 || pd->scale.y != 1 || pd->scale.z != 1)) | 353 | if ((pd->scale_world.x != 1 || pd->scale_world.y != 1 || pd->scale_world.z != 1)) |
351 | { | 354 | { |
352 | Evas_Vec3 scale; | 355 | Evas_Vec3 scale; |
353 | evas_vec3_set(&scale, pd->scale.x, pd->scale.y, pd->scale.z); | 356 | evas_vec3_set(&scale, pd->scale_world.x, pd->scale_world.y, pd->scale_world.z); |
354 | evas_vec3_multiply(&pd->obb.p0, &scale, &pd->obb.p0); | 357 | evas_vec3_multiply(&pd->obb.p0, &scale, &pd->obb.p0); |
355 | evas_vec3_multiply(&pd->obb.p1, &scale, &pd->obb.p1); | 358 | evas_vec3_multiply(&pd->obb.p1, &scale, &pd->obb.p1); |
356 | evas_vec3_multiply(&pd->aabb.p0, &scale, &pd->aabb.p0); | 359 | evas_vec3_multiply(&pd->aabb.p0, &scale, &pd->aabb.p0); |
357 | evas_vec3_multiply(&pd->aabb.p1, &scale, &pd->aabb.p1); | 360 | evas_vec3_multiply(&pd->aabb.p1, &scale, &pd->aabb.p1); |
358 | } | 361 | } |
359 | if ((pd->position.x || pd->position.y || pd->position.z)) | 362 | if ((pd->position_world.x || pd->position_world.y || pd->position_world.z)) |
360 | { | 363 | { |
361 | Evas_Vec3 position; | 364 | Evas_Vec3 position; |
362 | evas_vec3_set(&position, pd->position.x, pd->position.y, pd->position.z); | 365 | evas_vec3_set(&position, pd->position_world.x, pd->position_world.y, pd->position_world.z); |
363 | evas_vec3_add(&pd->obb.p0, &position, &pd->obb.p0); | 366 | evas_vec3_add(&pd->obb.p0, &position, &pd->obb.p0); |
364 | evas_vec3_add(&pd->obb.p1, &position, &pd->obb.p1); | 367 | evas_vec3_add(&pd->obb.p1, &position, &pd->obb.p1); |
365 | evas_vec3_add(&pd->aabb.p0, &position, &pd->aabb.p0); | 368 | evas_vec3_add(&pd->aabb.p0, &position, &pd->aabb.p0); |
@@ -372,7 +375,7 @@ _node_aabb_update(Evas_3D_Node *node, void *data EINA_UNUSED) | |||
372 | Eina_List *current; | 375 | Eina_List *current; |
373 | Evas_3D_Node *datanode; | 376 | Evas_3D_Node *datanode; |
374 | 377 | ||
375 | /* Update AABB and OBB of this node. */ | 378 | /* Update AABB, OBB, bounding sphere of this node. */ |
376 | evas_box3_empty_set(&pd->aabb); | 379 | evas_box3_empty_set(&pd->aabb); |
377 | evas_box3_empty_set(&pd->obb); | 380 | evas_box3_empty_set(&pd->obb); |
378 | 381 | ||
@@ -383,6 +386,7 @@ _node_aabb_update(Evas_3D_Node *node, void *data EINA_UNUSED) | |||
383 | evas_box3_union(&pd->aabb, &pd->aabb, &datapd->aabb); | 386 | evas_box3_union(&pd->aabb, &pd->aabb, &datapd->aabb); |
384 | } | 387 | } |
385 | } | 388 | } |
389 | evas_build_sphere(&pd->obb, &pd->bsphere); | ||
386 | } | 390 | } |
387 | 391 | ||
388 | return EINA_TRUE; | 392 | return EINA_TRUE; |
@@ -1362,99 +1366,13 @@ _evas_3d_node_bounding_box_get(Eo *obj EINA_UNUSED, Evas_3D_Node_Data *pd, Evas_ | |||
1362 | if (z2) *z2 = pd->aabb.p1.z; | 1366 | if (z2) *z2 = pd->aabb.p1.z; |
1363 | } | 1367 | } |
1364 | 1368 | ||
1365 | EOLIAN static int | 1369 | EOLIAN static void |
1366 | _evas_3d_node_obb_frustum_check(Eo *obj EINA_UNUSED, Evas_3D_Node_Data *pd, Evas_3D_Node *camera_node) | 1370 | _evas_3d_node_bounding_sphere_get(Eo *obj EINA_UNUSED, Evas_3D_Node_Data *pd, Evas_Real *x, Evas_Real *y, Evas_Real *z, Evas_Real *r) |
1367 | { | 1371 | { |
1368 | Evas_Mat4 matrix_eye = { { 0 } }; | 1372 | if (x) *x = pd->bsphere.center.x; |
1369 | Evas_Mat4 matrix_local_to_world; | 1373 | if (y) *y = pd->bsphere.center.y; |
1370 | Evas_Mat4 matrix_mv; | 1374 | if (z) *z = pd->bsphere.center.z; |
1371 | Evas_Mat4 matrix_mvp; | 1375 | if (r) *r = pd->bsphere.radius; |
1372 | Evas_Vec4 plane_right, plane_left, plane_bottom, plane_top, plane_far, plane_near, tmp; | ||
1373 | int frustum = 0; | ||
1374 | Evas_3D_Node_Data *camera_pd = eo_data_scope_get(camera_node, EVAS_3D_CAMERA_CLASS); | ||
1375 | Evas_3D_Camera_Data *camera = eo_data_scope_get(camera_pd->data.camera.camera, EVAS_3D_CAMERA_CLASS); | ||
1376 | |||
1377 | |||
1378 | if (camera_pd->type != EVAS_3D_NODE_TYPE_CAMERA) | ||
1379 | { | ||
1380 | ERR("Nodes type mismatch."); | ||
1381 | return -1; | ||
1382 | } | ||
1383 | |||
1384 | #define CHECK_IN_FRUSTUM_MIN(name) \ | ||
1385 | (((plane_##name.x * pd->obb.p0.x + plane_##name.y * pd->obb.p0.y + plane_##name.z * pd->obb.p0.z + plane_##name.w) >= 0) ? EINA_TRUE : EINA_FALSE) | ||
1386 | |||
1387 | #define CHECK_IN_FRUSTUM_MAX(name) \ | ||
1388 | (((plane_##name.x * pd->obb.p1.x + plane_##name.y * pd->obb.p1.y + plane_##name.z * pd->obb.p1.z + plane_##name.w) >= 0) ? EINA_TRUE : EINA_FALSE) | ||
1389 | |||
1390 | #define NORMALIZE(name) \ | ||
1391 | evas_vec4_copy(&tmp, &plane_##name); \ | ||
1392 | plane_##name.x = plane_##name.x / sqrtf(evas_vec4_length_square_get(&tmp)); \ | ||
1393 | plane_##name.y = plane_##name.y / sqrtf(evas_vec4_length_square_get(&tmp)); \ | ||
1394 | plane_##name.z = plane_##name.z / sqrtf(evas_vec4_length_square_get(&tmp)); \ | ||
1395 | plane_##name.w = plane_##name.w / sqrtf(evas_vec4_length_square_get(&tmp)); | ||
1396 | |||
1397 | /*get need matrix like multiply view matrix with projection matrix*/ | ||
1398 | evas_mat4_inverse_build(&matrix_eye, &camera_pd->position_world, &camera_pd->orientation_world, &camera_pd->scale_world); | ||
1399 | evas_mat4_build(&matrix_local_to_world, &pd->position_world, &pd->orientation_world, &pd->scale_world); | ||
1400 | evas_mat4_multiply(&matrix_mv, &matrix_eye, &matrix_local_to_world); | ||
1401 | evas_mat4_multiply(&matrix_mvp, &camera->projection, &matrix_mv); | ||
1402 | |||
1403 | /*get planes and normilize results*/ | ||
1404 | evas_vec4_set(&plane_right, matrix_mvp.m[3] - matrix_mvp.m[0], | ||
1405 | matrix_mvp.m[7] - matrix_mvp.m[4], | ||
1406 | matrix_mvp.m[11] - matrix_mvp.m[8], | ||
1407 | matrix_mvp.m[15] - matrix_mvp.m[12]); | ||
1408 | NORMALIZE(right) | ||
1409 | |||
1410 | evas_vec4_set(&plane_left, matrix_mvp.m[3] + matrix_mvp.m[0], | ||
1411 | matrix_mvp.m[7] + matrix_mvp.m[4], | ||
1412 | matrix_mvp.m[11] + matrix_mvp.m[8], | ||
1413 | matrix_mvp.m[15] + matrix_mvp.m[12]); | ||
1414 | NORMALIZE(left) | ||
1415 | |||
1416 | evas_vec4_set(&plane_bottom, matrix_mvp.m[3] + matrix_mvp.m[1], | ||
1417 | matrix_mvp.m[7] + matrix_mvp.m[5], | ||
1418 | matrix_mvp.m[11] + matrix_mvp.m[9], | ||
1419 | matrix_mvp.m[15] + matrix_mvp.m[13]); | ||
1420 | NORMALIZE(bottom) | ||
1421 | |||
1422 | evas_vec4_set(&plane_top, matrix_mvp.m[3] - matrix_mvp.m[1], | ||
1423 | matrix_mvp.m[7] - matrix_mvp.m[5], | ||
1424 | matrix_mvp.m[11] - matrix_mvp.m[9], | ||
1425 | matrix_mvp.m[15] - matrix_mvp.m[13]); | ||
1426 | NORMALIZE(top) | ||
1427 | |||
1428 | evas_vec4_set(&plane_far, matrix_mvp.m[3] - matrix_mvp.m[2], | ||
1429 | matrix_mvp.m[7] - matrix_mvp.m[6], | ||
1430 | matrix_mvp.m[11] - matrix_mvp.m[10], | ||
1431 | matrix_mvp.m[15] - matrix_mvp.m[14]); | ||
1432 | NORMALIZE(far) | ||
1433 | |||
1434 | evas_vec4_set(&plane_near, matrix_mvp.m[3] + matrix_mvp.m[2], | ||
1435 | matrix_mvp.m[7] + matrix_mvp.m[6], | ||
1436 | matrix_mvp.m[11] + matrix_mvp.m[10], | ||
1437 | matrix_mvp.m[15] + matrix_mvp.m[14]); | ||
1438 | NORMALIZE(near) | ||
1439 | |||
1440 | #undef NORMALIZE | ||
1441 | |||
1442 | /*check OBB points in frustum (Ax + By + Cz + D >= 0)*/ | ||
1443 | if (CHECK_IN_FRUSTUM_MIN(right) && CHECK_IN_FRUSTUM_MIN(left) | ||
1444 | && CHECK_IN_FRUSTUM_MIN(bottom) && CHECK_IN_FRUSTUM_MIN(top) | ||
1445 | && CHECK_IN_FRUSTUM_MIN(far) && CHECK_IN_FRUSTUM_MIN(near)) | ||
1446 | frustum |= 1; | ||
1447 | |||
1448 | if (CHECK_IN_FRUSTUM_MAX(right) && CHECK_IN_FRUSTUM_MAX(left) | ||
1449 | && CHECK_IN_FRUSTUM_MAX(bottom) && CHECK_IN_FRUSTUM_MAX(top) | ||
1450 | && CHECK_IN_FRUSTUM_MAX(far) && CHECK_IN_FRUSTUM_MAX(near)) | ||
1451 | frustum |= 2; | ||
1452 | |||
1453 | #undef CHECK_IN_FRUSTUM_MIN | ||
1454 | #undef CHECK_IN_FRUSTUM_MAX | ||
1455 | |||
1456 | return frustum; | ||
1457 | } | 1376 | } |
1458 | 1377 | ||
1459 | |||
1460 | #include "canvas/evas_3d_node.eo.c" | 1378 | #include "canvas/evas_3d_node.eo.c" |
diff --git a/src/lib/evas/canvas/evas_3d_node.eo b/src/lib/evas/canvas/evas_3d_node.eo index 5046f44a39..b82b90eca3 100644 --- a/src/lib/evas/canvas/evas_3d_node.eo +++ b/src/lib/evas/canvas/evas_3d_node.eo | |||
@@ -324,13 +324,12 @@ class Evas_3D_Node (Evas_3D_Object, Evas.Common_Interface) | |||
324 | 324 | ||
325 | bounding_box_get{ | 325 | bounding_box_get{ |
326 | /* | 326 | /* |
327 | 327 | Get axis-aligned bounding box (AABB) of the given node. | |
328 | * Get axis-aligned bounding box (AABB) of the given node. | ||
329 | * | 328 | * |
330 | * @param node The given node. | 329 | * @param node The given node. |
331 | * @param x Pointer to receive X coordinate of the first point of AABB. | 330 | * @param x Pointer to receive X coordinate of the first point of AABB. |
332 | * @param y Pointer to receive Y coordinate of the first point of AABB. | 331 | * @param y Pointer to receive Y coordinate of the first point of AABB. |
333 | * @param z Pointer to receive Z coordinate of the first point of AABB. | 332 | * @param z Pointer to receive Z coordinate of the first point of AABB. |
334 | * @param x2 Pointer to receive X coordinate of the second point of AABB. | 333 | * @param x2 Pointer to receive X coordinate of the second point of AABB. |
335 | * @param y2 Pointer to receive Y coordinate of the second point of AABB. | 334 | * @param y2 Pointer to receive Y coordinate of the second point of AABB. |
336 | * @param z2 Pointer to receive Z coordinate of the second point of AABB. | 335 | * @param z2 Pointer to receive Z coordinate of the second point of AABB. |
@@ -347,23 +346,25 @@ class Evas_3D_Node (Evas_3D_Object, Evas.Common_Interface) | |||
347 | } | 346 | } |
348 | } | 347 | } |
349 | 348 | ||
350 | obb_frustum_check { | 349 | bounding_sphere_get { |
351 | /* | 350 | /* |
352 | 351 | Get bounding sphere of the given node. | |
353 | * Check is the obb of node in frustum of camera node. | ||
354 | * | 352 | * |
355 | * @param camera_node The given node of camera. | 353 | * @param node The given node. |
356 | * @param node The given node. | ||
357 | * @return @c 0 if the obb is not in frustum, @c 1 if only min coordinate of obb is in frustum, | ||
358 | * @c 2 if only max coordinate of obb is in frustum, @c 3 if both coordinates of obb is in frustum. | ||
359 | 354 | ||
360 | * If the camera_node is not of type EVAS_3D_NODE_TYPE_CAMERA error wrong type of node will be generated and returned @ -1. | 355 | * @param x Pointer to receive X coordinate of the center of sphere. |
356 | * @param y Pointer to receive Y coordinate of the center of sphere. | ||
357 | * @param z Pointer to receive Z coordinate of center of sphere. | ||
358 | * @param r Pointer to receive radius of center of sphere. | ||
361 | 359 | ||
362 | * @ingroup Evas_3D_Node | 360 | @ingroup Evas_3D_Node |
363 | */ | 361 | */ |
364 | return: int; | ||
365 | params { | 362 | params { |
366 | @in Evas_3D_Node *camera_node; | 363 | |
364 | @in Evas_Real *x; /*@ Coordinates of vector.*/ | ||
365 | @in Evas_Real *y; | ||
366 | @in Evas_Real *z; | ||
367 | @in Evas_Real *r; | ||
367 | } | 368 | } |
368 | } | 369 | } |
369 | } | 370 | } |