(Properties) Added ability to add non-animatable event-thread only properties via...
[platform/core/uifw/dali-core.git] / dali / integration-api / dynamics / dynamics-body-intf.h
1 #ifndef __DALI_INTEGRATION_DYNAMICS_BODY_INTF_H__
2 #define __DALI_INTEGRATION_DYNAMICS_BODY_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/dali-common.h>
22 #include <dali/public-api/geometry/mesh-data.h>
23
24 namespace Dali
25 {
26
27 class Quaternion;
28 struct Vector3;
29
30 namespace Integration
31 {
32
33 class DynamicsBodySettings;
34 class DynamicsShape;
35 class DynamicsWorld;
36
37 class DALI_IMPORT_API DynamicsBody
38 {
39 public:
40   /**
41    * Destructor
42    */
43   virtual ~DynamicsBody() {}
44
45   /**
46    * Initialize the body
47    * @param[in] settings      Configuration parameters for the new body
48    * @param[in] shape         The collision shape for the body
49    * ~param[in] dynamicsWorld The dynamics world
50    * @param[in] startPosition The initial position for the body
51    * @param[in] startRotation The initial rotation of the body
52    */
53   virtual void Initialize( const DynamicsBodySettings& settings, DynamicsShape* shape,
54                            Integration::DynamicsWorld& dynamicsWorld,
55                            const Vector3& startPosition, const Quaternion& startRotation ) = 0;
56
57   /**
58    * Set the mass
59    * @param[in] mass The new mass for the body
60    */
61   virtual void SetMass(const float mass) = 0;
62
63   ///@ copydoc Dali::DynamicsBody::SetElasticity
64   virtual  void SetElasticity(const float elasticity) = 0;
65
66   /// @copydoc Dali::DynamicsBody::SetLinearVelocity
67   virtual void SetLinearVelocity(const Vector3& velocity) = 0;
68
69   /// @copydoc Dali::DynamicsBody::GetLinearVelocity
70   virtual Vector3 GetLinearVelocity() const = 0;
71
72   /// @copydoc Dali::DynamicsBody::SetAngularVelocity
73   virtual void SetAngularVelocity(const Vector3& velocity) = 0;
74
75   /// @copydoc Dali::DynamicsBody::SetLinearVelocity
76   virtual Vector3 GetAngularVelocity() const = 0;
77
78   /// @copydoc Dali::DynamicsBody::SetKinematic
79   virtual void SetKinematic(bool flag ) = 0;
80
81   /// @copydoc Dali::DynamicsBody::IsKinematic
82   virtual bool IsKinematic() const = 0;
83
84   /// @copydoc Dali::DynamicsBody::SetSleepEnabled
85   virtual void SetSleepEnabled(bool flag) = 0;
86
87   /// @copydoc Dali::DynamicsBody::WakeUp
88   virtual void WakeUp() = 0;
89
90   /// @copydoc Dali::DynamicsBody::AddAnchor
91   virtual void AddAnchor( unsigned int index, const DynamicsBody* anchorBody, const bool collisions ) = 0;
92
93   /// @copydoc Dali::DynamicsBody::ConserveVolume
94   virtual void ConserveVolume( bool flag ) = 0;
95
96   /// @copydoc Dali::DynamicsBody::ConserveShape
97   virtual void ConserveShape( bool flag ) = 0;
98
99   /// @copydoc Dali::DynamicsBody::GetCollisionGroup
100   virtual short int GetCollisionGroup() const = 0;
101
102   /// @copydoc Dali::DynamicsBody::SetCollisionGroup
103   virtual void SetCollisionGroup( short int collisionGroup ) = 0;
104
105   /// @copydoc Dali::DynamicsBody::GetCollisionMask
106   virtual short int GetCollisionMask() const = 0;
107
108   /// @copydoc Dali::DynamicsBody::SetCollisionMask
109   virtual void SetCollisionMask( short int collisionMask ) = 0;
110
111   virtual int GetType() const = 0;
112
113   virtual bool IsActive() const = 0;
114
115   virtual void SetTransform( const Vector3& position, const Quaternion& rotation ) = 0;
116   virtual void GetTransform( Vector3& position, Quaternion& rotation ) = 0;
117
118   /**
119    * Get the vertices and normal from a soft body
120    * @param[in,out] meshData A MeshData object with preallocated space for all the vertices.
121    */
122   virtual void GetSoftVertices( MeshData::VertexContainer& meshData ) const = 0;
123
124 }; // class DynamicsBody
125
126  } //namespace Integration
127
128 } //namespace Dali
129
130 #endif // __DALI_INTEGRATION_DYNAMICS_BODY_INTF_H__