2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
5 // Licensed under the Flora License, Version 1.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://floralicense.org/license/
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an AS IS BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
19 * @file FUiEffects_RendererEngineModelAabb.h
20 * @brief Class of Axis-Aligned Bounding Box for efficient geometry objects occlusion culling
24 #ifndef _FUI_EFFECTS_INTERNAL_RENDERER_ENGINE_MODEL_AABB_H_
25 #define _FUI_EFFECTS_INTERNAL_RENDERER_ENGINE_MODEL_AABB_H_
27 #include <renderer/math/FUiEffects_RendererMathMatrix.h>
28 #include <renderer/math/FUiEffects_RendererMathVector.h>
30 namespace Tizen { namespace Ui { namespace Effects { namespace _Renderer { namespace EngineModel
43 void Extend(const Aabb& other)
45 minimum.X() = Math::EffectsMin(minimum.X(), other.minimum.X());
46 minimum.Y() = Math::EffectsMin(minimum.Y(), other.minimum.Y());
47 minimum.Z() = Math::EffectsMin(minimum.Z(), other.minimum.Z());
49 maximum.X() = Math::EffectsMax(maximum.X(), other.maximum.X());
50 maximum.Y() = Math::EffectsMax(maximum.Y(), other.maximum.Y());
51 maximum.Z() = Math::EffectsMax(maximum.Z(), other.maximum.Z());
56 Aabb GetTransformed(const Math::Matrix4f& tran) const
60 result.minimum = minimum * tran;
61 result.maximum = maximum * tran;
62 if (result.minimum.X() > result.maximum.X())
64 std::swap(result.minimum.X(), result.maximum.X());
66 if (result.minimum.Y() > result.maximum.Y())
68 std::swap(result.minimum.Y(), result.maximum.Y());
70 if (result.minimum.Z() > result.maximum.Z())
72 std::swap(result.minimum.Z(), result.maximum.Z());
78 Math::Vector3f minimum;
79 Math::Vector3f maximum;
82 }}}}} //Tizen::Ui::Effects::_Renderer::EngineModel
84 #endif //_FUI_EFFECTS_INTERNAL_RENDERER_ENGINE_MODEL_AABB_H_