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.
18 * @file FUiEffects_RendererViewport.h
19 * @brief This is the header file for the Viewport class
22 #ifndef _FUI_EFFECTS_INTERNAL_RENDERER_VIEWPORT_H_
23 #define _FUI_EFFECTS_INTERNAL_RENDERER_VIEWPORT_H_
25 #include <utils/FUiEffects_Utils.h>
26 #include "FUiEffects_RendererLog.h"
28 namespace Tizen { namespace Ui { namespace Effects { namespace _Renderer
33 * @brief This class for scene viewport and coordinates transformations. Currently for orto projection ONLY!!!!!!, Z = 0
39 * Transforms window coordinates to model space
41 * @param [in] p point on screen
43 * @return Vec3f Point in model space
45 Tizen::Ui::Effects::_Utils::Vec3f TransformScreenToWorld(Tizen::Ui::Effects::_Utils::Vec2f p) const
47 if ((fabsf(screenRight - screenLeft) > std::numeric_limits<float>::epsilon()) && (fabsf(screenTop - screenBottom) > std::numeric_limits<float>::epsilon()))
49 return Tizen::Ui::Effects::_Utils::Vec3f((p.x - screenLeft) * (worldRight - worldLeft) / (screenRight - screenLeft) + worldLeft,
50 p.y * (worldTop - worldBottom) / (screenBottom - screenTop) + worldBottom,
55 return Tizen::Ui::Effects::_Utils::Vec3f(0.0f, 0.0f, 0.0f);
75 } } } } // Tizen::Ui::Effects::_EffectRenderer
77 #endif //_FUI_EFFECTS_INTERNAL_RENDERER_VIEWPORT_H_