1 #ifndef __DALI_ANGLE_AXIS_H__
2 #define __DALI_ANGLE_AXIS_H__
5 * Copyright (c) 2015 Samsung Electronics Co., Ltd.
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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.
22 #include <dali/public-api/math/radian.h>
23 #include <dali/public-api/math/vector3.h>
28 * @addtogroup dali-core-object
35 * @brief An angle & axis pair.
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.
43 * @brief Create an angle-axis pair.
47 axis(0.0f, 0.0f, 0.0f)
51 * @brief Create an angle-axis pair.
53 * @param[in] initialAngle The initial angle in radians.
54 * @param[in] initialAxis The initial axis.
56 AngleAxis( Radian initialAngle, const Vector3& initialAxis )
57 : angle( initialAngle ),
61 Radian angle; ///< The angle in radians
62 Vector3 axis; ///< The axis
66 // compiler generated destructor, copy constructor and assignment operators are ok as this class is POD
69 * @brief Compare two angle axis for equality
71 * @param lhs angle axis
72 * @param rhs angle axis
73 * @return true if they are equal
75 inline bool operator==( const Dali::AngleAxis& lhs, const Dali::AngleAxis& rhs )
77 return (lhs.angle == rhs.angle) && (lhs.axis == rhs.axis);
85 #endif // __DALI_ANGLE_AXIS_H__