RavEngine
Loading...
Searching...
No Matches
math_constant.h
1//----------------------------------------------------------------------------//
2// //
3// ozz-animation is hosted at http://github.com/guillaumeblanc/ozz-animation //
4// and distributed under the MIT License (MIT). //
5// //
6// Copyright (c) Guillaume Blanc //
7// //
8// Permission is hereby granted, free of charge, to any person obtaining a //
9// copy of this software and associated documentation files (the "Software"), //
10// to deal in the Software without restriction, including without limitation //
11// the rights to use, copy, modify, merge, publish, distribute, sublicense, //
12// and/or sell copies of the Software, and to permit persons to whom the //
13// Software is furnished to do so, subject to the following conditions: //
14// //
15// The above copyright notice and this permission notice shall be included in //
16// all copies or substantial portions of the Software. //
17// //
18// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR //
19// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, //
20// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL //
21// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER //
22// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING //
23// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER //
24// DEALINGS IN THE SOFTWARE. //
25// //
26//----------------------------------------------------------------------------//
27
28#ifndef OZZ_OZZ_BASE_MATHS_MATH_CONSTANT_H_
29#define OZZ_OZZ_BASE_MATHS_MATH_CONSTANT_H_
30
31#ifndef INCLUDE_OZZ_MATH_CONSTANT_H_
32#define INCLUDE_OZZ_MATH_CONSTANT_H_
33
34namespace ozz {
35namespace math {
36
37// Defines math trigonometric constants.
38static const float k2Pi = 6.283185307179586476925286766559f;
39static const float kPi = 3.1415926535897932384626433832795f;
40static const float kPi_2 = 1.5707963267948966192313216916398f;
41static const float kPi_4 = .78539816339744830961566084581988f;
42static const float kSqrt3 = 1.7320508075688772935274463415059f;
43static const float kSqrt3_2 = 0.86602540378443864676372317075294f;
44static const float kSqrt2 = 1.4142135623730950488016887242097f;
45static const float kSqrt2_2 = 0.70710678118654752440084436210485f;
46
47// Angle unit conversion constants.
48static const float kDegreeToRadian = kPi / 180.f;
49static const float kRadianToDegree = 180.f / kPi;
50
51// Defines the square normalization tolerance value.
52static const float kNormalizationToleranceSq = 1e-6f;
53static const float kNormalizationToleranceEstSq = 2e-3f;
54
55// Defines the square orthogonalisation tolerance value.
56static const float kOrthogonalisationToleranceSq = 1e-16f;
57} // namespace math
58} // namespace ozz
59
60#endif // INCLUDE_OZZ_MATH_CONSTANT_H_
61#endif // OZZ_OZZ_BASE_MATHS_MATH_CONSTANT_H_