1 #ifndef __DALI_INTEGRATION_DYNAMICS_BODY_INTF_H__
2 #define __DALI_INTEGRATION_DYNAMICS_BODY_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/dali-common.h>
22 #include <dali/public-api/geometry/mesh-data.h>
33 class DynamicsBodySettings;
37 class DALI_IMPORT_API DynamicsBody
43 virtual ~DynamicsBody() {}
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
53 virtual void Initialize( const DynamicsBodySettings& settings, DynamicsShape* shape,
54 Integration::DynamicsWorld& dynamicsWorld,
55 const Vector3& startPosition, const Quaternion& startRotation ) = 0;
59 * @param[in] mass The new mass for the body
61 virtual void SetMass(const float mass) = 0;
63 ///@ copydoc Dali::DynamicsBody::SetElasticity
64 virtual void SetElasticity(const float elasticity) = 0;
66 /// @copydoc Dali::DynamicsBody::SetLinearVelocity
67 virtual void SetLinearVelocity(const Vector3& velocity) = 0;
69 /// @copydoc Dali::DynamicsBody::GetLinearVelocity
70 virtual Vector3 GetLinearVelocity() const = 0;
72 /// @copydoc Dali::DynamicsBody::SetAngularVelocity
73 virtual void SetAngularVelocity(const Vector3& velocity) = 0;
75 /// @copydoc Dali::DynamicsBody::SetLinearVelocity
76 virtual Vector3 GetAngularVelocity() const = 0;
78 /// @copydoc Dali::DynamicsBody::SetKinematic
79 virtual void SetKinematic(bool flag ) = 0;
81 /// @copydoc Dali::DynamicsBody::IsKinematic
82 virtual bool IsKinematic() const = 0;
84 /// @copydoc Dali::DynamicsBody::SetSleepEnabled
85 virtual void SetSleepEnabled(bool flag) = 0;
87 /// @copydoc Dali::DynamicsBody::WakeUp
88 virtual void WakeUp() = 0;
90 /// @copydoc Dali::DynamicsBody::AddAnchor
91 virtual void AddAnchor( unsigned int index, const DynamicsBody* anchorBody, const bool collisions ) = 0;
93 /// @copydoc Dali::DynamicsBody::ConserveVolume
94 virtual void ConserveVolume( bool flag ) = 0;
96 /// @copydoc Dali::DynamicsBody::ConserveShape
97 virtual void ConserveShape( bool flag ) = 0;
99 /// @copydoc Dali::DynamicsBody::GetCollisionGroup
100 virtual short int GetCollisionGroup() const = 0;
102 /// @copydoc Dali::DynamicsBody::SetCollisionGroup
103 virtual void SetCollisionGroup( short int collisionGroup ) = 0;
105 /// @copydoc Dali::DynamicsBody::GetCollisionMask
106 virtual short int GetCollisionMask() const = 0;
108 /// @copydoc Dali::DynamicsBody::SetCollisionMask
109 virtual void SetCollisionMask( short int collisionMask ) = 0;
111 virtual int GetType() const = 0;
113 virtual bool IsActive() const = 0;
115 virtual void SetTransform( const Vector3& position, const Quaternion& rotation ) = 0;
116 virtual void GetTransform( Vector3& position, Quaternion& rotation ) = 0;
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.
122 virtual void GetSoftVertices( MeshData::VertexContainer& meshData ) const = 0;
124 }; // class DynamicsBody
126 } //namespace Integration
130 #endif // __DALI_INTEGRATION_DYNAMICS_BODY_INTF_H__