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 <cedric@osg.samsung.com>
This commit is contained in:
Oleksandr Shcherbina 2015-02-05 15:25:29 +01:00 committed by Cedric BAIL
parent 0c4de0235c
commit 8802ce2051
1 changed files with 5 additions and 5 deletions

View File

@ -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;