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_PeSpringSurface.h
19 * @brief This is the header file for the SpringSurface class
22 #ifndef _FUI_EFFECTS_INTERNAL_PE_SPRINGSURFACE_H_
23 #define _FUI_EFFECTS_INTERNAL_PE_SPRINGSURFACE_H_
26 #include "FUiEffects_PeElementSurface.h"
27 #include "FUiEffects_PePointSurface.h"
29 namespace Tizen { namespace Ui { namespace Effects { namespace _PhysicsEngine
33 * @class SpringSurface
34 * @brief Class for physical element: spring
40 : public ElementSurface
45 * SpringSurface class constructor
49 * @param[in] objId physical element's id
50 * @param[in] stiffness spring coefficient of rigidity
51 * @param[in] pPoint1 pointer to connected point 1
52 * @param[in] pPoint2 pointer to connected point 2
58 PointSurface* pPoint1,
68 virtual ~SpringSurface(void);
71 * @brief Gets object's type
72 * @return enum value that corresponds to object's type
75 virtual Tizen::Ui::Effects::_Runtime::ESurface GetType(void) const;
78 * Sets object into the initial state
83 virtual void Initialize(void);
86 * Performs simulation step with given delta time
90 * @param[in] timeStep simulation time step
93 virtual void Calculate(float timeStep);
96 * Gets element property value
100 * @return struct that contains property type and value
101 * @param[in] property enum value for necessary property
104 virtual Tizen::Ui::Effects::_Runtime::PropertyCast GetProperty(
105 Tizen::Ui::Effects::_Runtime::ElementProperty property
109 * Sets element bool property values
113 * @return true if set successful, false if failed
114 * @param[in] property property name
115 * @param[in] boolValue new bool value for property
118 virtual bool SetProperty(
119 Tizen::Ui::Effects::_Runtime::ElementProperty property,
124 * Sets element numeric property values
128 * @return true if set successful, false if failed
129 * @param[in] property property name
130 * @param[in] numericValue new numeric value for property
133 virtual bool SetProperty(
134 Tizen::Ui::Effects::_Runtime::ElementProperty property,
135 LUA_NUMBER numericValue
139 * Sets element vector property values
143 * @return true if set successful, false if failed
144 * @param[in] property property name
145 * @param[in] vectorValue new vector value for property
148 virtual bool SetProperty(
149 Tizen::Ui::Effects::_Runtime::ElementProperty property,
150 const Tizen::Ui::Effects::_Utils::Vec3f& vectorValue
156 // internal init method
157 void InitSpring(void);
165 const float __stiffnessInit; // Initial spring coefficient of rigidity
168 float __restLength; // Length of the unstrained spring
169 float __stiffness; // Spring coefficient of rigidity
171 // points that are connected by spring
172 PointSurface* __pPoint1;
173 PointSurface* __pPoint2;
177 } } } } // Tizen::Ui::Effects::_PhysicsEngine
179 #endif //_FUI_EFFECTS_INTERNAL_PE_SPRINGSURFACE_H_