diff --git a/CMSceneGraph b/CMSceneGraph index 048acfdf..50f5514a 160000 --- a/CMSceneGraph +++ b/CMSceneGraph @@ -1 +1 @@ -Subproject commit 048acfdf45554155de4ca6e79e67480a9c9eebd1 +Subproject commit 50f5514aee947cc8cb400cd9bf98b58803fc58a6 diff --git a/example/Basic/RenderBoundBox.cpp b/example/Basic/RenderBoundBox.cpp index 85bafff1..70bbfe45 100644 --- a/example/Basic/RenderBoundBox.cpp +++ b/example/Basic/RenderBoundBox.cpp @@ -253,31 +253,15 @@ private: { CreateComponentInfo cci(GetSceneRoot()); - AABB aabb; -// OBB obb; + OBB obb; for(int i=0;i<6;i++) { PrimitiveComponent *component=rm_torus->component[i]; - component->GetLocalAABB(aabb); + component->GetWorldOBB(obb); - //Matrix4f translate_matrix=obb.GetRotationMatrix(); - //Matrix4f rotate_matrix=obb.GetRotationMatrix(); - //Matrix4f scale_matrix=ScaleMatrix(obb.GetHalfExtend()*2.0f); - - Matrix3f rotate_scale_matrix=component->GetLocalToWorldMatrix(); - - rotate_scale_matrix[0]=glm::normalize(rotate_scale_matrix[0]); - rotate_scale_matrix[1]=glm::normalize(rotate_scale_matrix[1]); - rotate_scale_matrix[2]=glm::normalize(rotate_scale_matrix[2]); - - Matrix4f rotate_matrix=rotate_scale_matrix; - - Matrix4f translate_matrix=TranslateMatrix(aabb.GetCenter()); - Matrix4f scale_matrix=ScaleMatrix(aabb.GetLength()); - - cci.mat=translate_matrix*rotate_matrix*scale_matrix; + cci.mat=obb.GetMatrix(); CreateComponent(&cci,rm_box->cdp); }