From 8802ce20516f02cb1db9cb8768ba3f14791236f9 Mon Sep 17 00:00:00 2001 From: Oleksandr Shcherbina Date: Thu, 5 Feb 2015 15:25:29 +0100 Subject: [PATCH] evas: Evas_3D - fix order of transformation while updating bounding object. Summary: The order of tranformation changed to scale, orientation, position as in some cases it can lead to incorrect value for the bounding box. @fix Reviewers: cedric, Hermet, raster Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D1942 Signed-off-by: Cedric BAIL --- src/lib/evas/canvas/evas_3d_node.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/lib/evas/canvas/evas_3d_node.c b/src/lib/evas/canvas/evas_3d_node.c index b013e63293..ed47791ad5 100644 --- a/src/lib/evas/canvas/evas_3d_node.c +++ b/src/lib/evas/canvas/evas_3d_node.c @@ -345,11 +345,6 @@ _node_aabb_update(Evas_3D_Node *node, void *data EINA_UNUSED) if (frame_found) { - if (is_change_orientation) - { - evas_vec3_quaternion_rotate(&pd->obb.p0, &pd->obb.p0, &orientation); - evas_vec3_quaternion_rotate(&pd->obb.p1, &pd->obb.p1, &orientation); - } if ((pd->scale_world.x != 1 || pd->scale_world.y != 1 || pd->scale_world.z != 1)) { Evas_Vec3 scale; @@ -359,6 +354,11 @@ _node_aabb_update(Evas_3D_Node *node, void *data EINA_UNUSED) evas_vec3_multiply(&pd->aabb.p0, &scale, &pd->aabb.p0); evas_vec3_multiply(&pd->aabb.p1, &scale, &pd->aabb.p1); } + if (is_change_orientation) + { + evas_vec3_quaternion_rotate(&pd->obb.p0, &pd->obb.p0, &orientation); + evas_vec3_quaternion_rotate(&pd->obb.p1, &pd->obb.p1, &orientation); + } if ((pd->position_world.x || pd->position_world.y || pd->position_world.z)) { Evas_Vec3 position;