License conversion from Flora to Apache 2.0
[platform/core/uifw/dali-adaptor.git] / plugins / dynamics / bullet / bullet-dynamics-debug.h
1 #ifndef __DALI_PLUGIN_BULLET_DYNAMICS_DEBUG_H__
2 #define __DALI_PLUGIN_BULLET_DYNAMICS_DEBUG_H__
3
4 /*
5  * Copyright (c) 2014 Samsung Electronics Co., Ltd.
6  *
7  * Licensed under the Apache License, Version 2.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://www.apache.org/licenses/LICENSE-2.0
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
21 // EXTERNAL HEADERS
22 #include <dali/integration-api/dynamics/dynamics-debug-vertex.h>
23 // TODO: Change this to use #pragma GCC diagnostic push / pop when the compiler is updated to 4.6.0+
24 #pragma GCC diagnostic ignored "-Wfloat-equal"
25 #include <btBulletDynamicsCommon.h>
26 #pragma GCC diagnostic error "-Wfloat-equal"
27
28 namespace Dali
29 {
30
31 namespace Plugin
32 {
33
34 /**
35  * Debug draw class, BulletPhysics engine will invoke methods on this object to render debug information.
36  * Debug lines are collated into a container and then rendered as a single array during Core::Render
37  */
38 class BulletDebugDraw : public btIDebugDraw
39 {
40 public:
41   /**
42    * Constructor
43    */
44   BulletDebugDraw();
45
46   /**
47    * Destructor
48    */
49   virtual ~BulletDebugDraw();
50
51   virtual void drawLine(const btVector3& from,const btVector3& to,const btVector3& color);
52   virtual void drawContactPoint(const btVector3& PointOnB,const btVector3& normalOnB,btScalar distance,int lifeTime,const btVector3& color);
53   virtual void reportErrorWarning(const char* warningString);
54   virtual void draw3dText(const btVector3& location,const char* textString);
55   virtual void setDebugMode(int debugMode);
56   virtual int  getDebugMode() const;
57
58   void ClearVertices();
59   const Integration::DynamicsDebugVertexContainer& GetVertices() const;
60
61 private:
62
63   int mDebugMode;
64   Integration::DynamicsDebugVertexContainer mVertices;
65
66 }; // class BulletDebugDraw
67
68 } // namespace Plugin
69
70 } // namespace Dali
71
72 #endif /* __DALI_PLUGIN_BULLET_DYNAMICS_DEBUG_H__ */