1 #ifndef __DALI_INTEGRATION_DYNAMICS_WORLD_INTF_H__
2 #define __DALI_INTEGRATION_DYNAMICS_WORLD_INTF_H__
5 // Copyright (c) 2014 Samsung Electronics Co., Ltd.
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
11 // http://floralicense.org/license/
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.
21 #include <dali/public-api/common/map-wrapper.h>
22 #include <dali/integration-api/dynamics/dynamics-debug-vertex.h>
32 struct DynamicsCollisionData;
36 struct DynamicsWorldSettings;
37 typedef std::map<void*, DynamicsCollisionData> CollisionDataContainer;
39 DynamicsWorld* InitializeDynamics( DynamicsWorldSettings* settings );
42 * @copydoc Dali::DynamicsWorld
44 class DALI_IMPORT_API DynamicsWorld
50 virtual ~DynamicsWorld() {}
52 virtual void Initialize( const DynamicsWorldSettings& worldSettings ) = 0;
55 * Add a body to the simulation
57 virtual void AddBody(DynamicsBody* body) = 0;
60 * Remove a body from the simulation
62 virtual void RemoveBody(DynamicsBody* body) = 0;
65 * Add a joint to the simulation
67 virtual void AddJoint(DynamicsJoint* joint) = 0;
70 * Remove body from the simulation
72 virtual void RemoveJoint(DynamicsJoint* joint) = 0;
74 /// @copydoc Dali::DynamicsWorld::SetGravity
75 virtual void SetGravity( const Vector3& gravity ) = 0;
77 /// @copydoc Dali::DynamicsWorld::SetDebugDrawMode
78 virtual void SetDebugDrawMode(int mode) = 0;
81 * Allow dynamics engine to do its debug drawing
83 virtual const DynamicsDebugVertexContainer& DebugDraw() = 0;
86 * Update the simulation
87 * @param[in] elapsedSeconds The amount of time taht has elapsed since previous call
89 virtual void Update( float elapsedSeconds ) = 0;
92 * Check for collisions between simulation objects
93 * @param[out] contacts A container which will be filled with the current collision/contact data
95 virtual void CheckForCollisions( CollisionDataContainer& contacts ) = 0;
97 }; // class DynamicsWorld
99 } //namespace Integration
103 #endif // __DALI_INTEGRATION_DYNAMICS_WORLD_INTF_H__