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_RendererEngineModelCamera.cpp
20 * @brief This file contains implementation of Camera class
24 #include <renderer/engine-model/FUiEffects_RendererEngineModelCamera.h>
25 #include <renderer/math/FUiEffects_RendererMathCommon.h>
27 namespace Tizen { namespace Ui { namespace Effects { namespace _Renderer { namespace EngineModel
32 _proj.value.MakePerspectiveFovRH(Math::F_Deg_2_Rad(45.0f), 1.0f, 0.1f, 32000.0f);
33 _proj.invalid = false;
35 _frustum.invalid = true;
37 _minPos.Set(0.0f, 0.0f);
38 _maxPos.Set(0.0f, 0.0f);
40 _clearColor.Set(1.0f, 1.0f, 1.0f, 1.0f);
48 Camera::SetViewport(const Math::Vector2f& minPos, const Math::Vector2f& maxPos)
56 Camera::GetViewportMin(void)
62 Camera::GetViewportMax(void)
68 Camera::Visit(Visitor& v)
81 Camera::SetProj(const Math::Matrix4f& arg)
84 _proj.invalid = false;
86 _frustum.invalid = true;
91 Camera::SetLocal(const Math::Matrix4f& arg)
94 _frustum.invalid = true;
99 Camera::SetWorld(const Math::Matrix4f& arg)
102 _frustum.invalid = true;
107 Camera::GetFrustum(void)
109 if (_frustum.invalid)
113 return _frustum.value;
117 Camera::AttachedToParent(Group* pParent)
119 if (!Node::AttachedToParent(pParent))
124 _frustum.invalid = true;
129 Camera::RemoveFromParent(Group* pParent)
131 if (!Node::RemoveFromParent(pParent))
136 _frustum.invalid = true;
141 Camera::ParentMoved(Group* pParent)
143 Node::ParentMoved(pParent);
144 _frustum.invalid = true;
149 Camera::ValidateFrustum(void)
151 _frustum.value.Build(GetProj(), GetWorld());
152 _frustum.invalid = false;
157 Camera::SetClearColor(const Math::Vector4f& color)
163 const Math::Vector4f&
164 Camera::GetClearColor(void)
169 }}}}} //Tizen::Ui::Effects::_Renderer::EngineModel