Emscripten workarounds and llvm syntax fixes
[platform/core/uifw/dali-core.git] / dali / integration-api / dynamics / dynamics-world-intf.h
1 #ifndef __DALI_INTEGRATION_DYNAMICS_WORLD_INTF_H__
2 #define __DALI_INTEGRATION_DYNAMICS_WORLD_INTF_H__
3
4 //
5 // Copyright (c) 2014 Samsung Electronics Co., Ltd.
6 //
7 // Licensed under the Flora License, Version 1.0 (the License);
8 // you may not use this file except in compliance with the License.
9 // You may obtain a copy of the License at
10 //
11 //     http://floralicense.org/license/
12 //
13 // Unless required by applicable law or agreed to in writing, software
14 // distributed under the License is distributed on an AS IS BASIS,
15 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 // See the License for the specific language governing permissions and
17 // limitations under the License.
18 //
19
20 // INTERNAL INCLUDES
21 #include <dali/public-api/common/map-wrapper.h>
22 #include <dali/integration-api/dynamics/dynamics-debug-vertex.h>
23
24 namespace Dali
25 {
26
27 struct Vector3;
28
29 namespace Integration
30 {
31
32 struct DynamicsCollisionData;
33 class DynamicsBody;
34 class DynamicsJoint;
35 class DynamicsWorld;
36 struct DynamicsWorldSettings;
37 typedef std::map<void*, DynamicsCollisionData> CollisionDataContainer;
38
39 DynamicsWorld* InitializeDynamics( DynamicsWorldSettings* settings );
40
41 /**
42  * @copydoc Dali::DynamicsWorld
43  */
44 class DALI_IMPORT_API DynamicsWorld
45 {
46 public:
47   /**
48    * Destructor
49    */
50   virtual ~DynamicsWorld() {}
51
52   virtual void Initialize( const DynamicsWorldSettings& worldSettings ) = 0;
53
54   /**
55    * Add a body to the simulation
56    */
57   virtual void AddBody(DynamicsBody* body) = 0;
58
59   /**
60    * Remove a body from the simulation
61    */
62   virtual void RemoveBody(DynamicsBody* body) = 0;
63
64   /**
65    * Add a joint to the simulation
66    */
67   virtual void AddJoint(DynamicsJoint* joint) = 0;
68
69   /**
70    * Remove body from the simulation
71    */
72   virtual void RemoveJoint(DynamicsJoint* joint) = 0;
73
74   /// @copydoc Dali::DynamicsWorld::SetGravity
75   virtual void SetGravity( const Vector3& gravity ) = 0;
76
77   /// @copydoc Dali::DynamicsWorld::SetDebugDrawMode
78   virtual void SetDebugDrawMode(int mode) = 0;
79
80   /**
81    * Allow dynamics engine to do its debug drawing
82    */
83   virtual const DynamicsDebugVertexContainer& DebugDraw() = 0;
84
85   /**
86    * Update the simulation
87    * @param[in] elapsedSeconds The amount of time taht has elapsed since previous call
88    */
89   virtual void Update( float elapsedSeconds ) = 0;
90
91   /**
92    * Check for collisions between simulation objects
93    * @param[out] contacts A container which will be filled with the current collision/contact data
94    */
95   virtual void CheckForCollisions( CollisionDataContainer& contacts ) = 0;
96
97 }; // class DynamicsWorld
98
99 } //namespace Integration
100
101 } //namespace Dali
102
103 #endif // __DALI_INTEGRATION_DYNAMICS_WORLD_INTF_H__