Merge "DALi Version 1.0.48" into devel/master
[platform/core/uifw/dali-core.git] / dali / integration-api / dynamics / dynamics-collision-data.h
1 #ifndef __DALI_INTEGRATION_DYNAMICS_COLLISION_DATA_H__
2 #define __DALI_INTEGRATION_DYNAMICS_COLLISION_DATA_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 //INTERNAL HEADERS
22 #include <dali/public-api/math/vector3.h>
23
24 namespace Dali
25 {
26
27 struct Vector3;
28
29 namespace Integration
30 {
31
32 class DynamicsBody;
33
34 struct DynamicsCollisionData
35 {
36 public:
37   DynamicsCollisionData(DynamicsBody* bodyA, DynamicsBody* bodyB, const Vector3& pointOnA, const Vector3& pointOnB, const Vector3& normal, const float impact)
38   : mBodyA(bodyA),
39     mBodyB(bodyB),
40     mPointOnA(pointOnA),
41     mPointOnB(pointOnB),
42     mNormal(normal),
43     mImpact(impact)
44   {
45   }
46
47   DynamicsCollisionData(const DynamicsCollisionData& rhs)
48   : mBodyA(rhs.mBodyA),
49     mBodyB(rhs.mBodyB),
50     mPointOnA(rhs.mPointOnA),
51     mPointOnB(rhs.mPointOnB),
52     mNormal(rhs.mNormal),
53     mImpact(rhs.mImpact)
54   {
55   }
56
57   DynamicsCollisionData()
58   : mBodyA(NULL),
59     mBodyB(NULL),
60     mImpact(0.0f)
61   {
62   }
63
64   ~DynamicsCollisionData()
65   {
66   }
67
68   DynamicsCollisionData& operator=(const DynamicsCollisionData& rhs)
69   {
70     if( this != &rhs )
71     {
72       mBodyA = rhs.mBodyA;
73       mBodyB = rhs.mBodyB;
74       mPointOnA = rhs.mPointOnA;
75       mPointOnB = rhs.mPointOnB;
76       mNormal = rhs.mNormal;
77       mImpact = rhs.mImpact;
78     }
79     return *this;
80   }
81
82   DynamicsBody* mBodyA;
83   DynamicsBody* mBodyB;
84   Vector3       mPointOnA;
85   Vector3       mPointOnB;
86   Vector3       mNormal;
87   float         mImpact;
88 }; // struct DynamicsCollisionData
89
90 } // namespace Integration
91
92 } // namespace Dali
93
94 #endif // __DALI_INTEGRATION_DYNAMICS_COLLISION_DATA_H__