Doxygen grouping
[platform/core/uifw/dali-core.git] / dali / public-api / math / angle-axis.h
1 #ifndef __DALI_ANGLE_AXIS_H__
2 #define __DALI_ANGLE_AXIS_H__
3
4 /*
5  * Copyright (c) 2015 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 INCLUDES
22 #include <dali/public-api/math/radian.h>
23 #include <dali/public-api/math/vector3.h>
24
25 namespace Dali
26 {
27 /**
28  * @addtogroup dali-core-object
29  * @{
30  */
31
32 struct Radian;
33
34 /**
35  * @brief An angle & axis pair.
36  *
37  * This is slightly easier to understand than quaternions for handling rotations
38  * of objects. Both elements should be non-zero to correctly describe a rotation.
39  */
40 struct AngleAxis
41 {
42   /**
43    * @brief Create an angle-axis pair.
44    */
45   AngleAxis()
46   : angle(0.0f),
47     axis(0.0f, 0.0f, 0.0f)
48   { }
49
50   /**
51    * @brief Create an angle-axis pair.
52    *
53    * @param[in] initialAngle The initial angle in radians.
54    * @param[in] initialAxis The initial axis.
55    */
56   AngleAxis( Radian initialAngle, const Vector3& initialAxis )
57   : angle( initialAngle ),
58     axis( initialAxis )
59   { }
60
61   Radian angle; ///< The angle in radians
62   Vector3 axis; ///< The axis
63
64 };
65
66 // compiler generated destructor, copy constructor and assignment operators are ok as this class is POD
67
68 /**
69  * @brief Compare two angle axis for equality
70  *
71  * @param lhs angle axis
72  * @param rhs angle axis
73  * @return true if they are equal
74  */
75 inline bool operator==( const Dali::AngleAxis& lhs, const Dali::AngleAxis& rhs )
76 {
77   return (lhs.angle == rhs.angle) && (lhs.axis == rhs.axis);
78 }
79
80 /**
81  * @}
82  */
83 } // namespace Dali
84
85 #endif // __DALI_ANGLE_AXIS_H__