Renaming PI to aiPi.
parent
06a60c43cf
commit
31e8042071
|
@ -87,7 +87,7 @@ inline IntegerType lcm( IntegerType a, IntegerType b ) {
|
||||||
}
|
}
|
||||||
return a / t * b;
|
return a / t * b;
|
||||||
}
|
}
|
||||||
/// @brief Will return the smallest epsilon-value for the requested type.
|
/// @brief Will return the smallest epsilon-value for the requested type.
|
||||||
/// @return The numercical limit epsilon depending on its type.
|
/// @return The numercical limit epsilon depending on its type.
|
||||||
template<class T>
|
template<class T>
|
||||||
inline T getEpsilon() {
|
inline T getEpsilon() {
|
||||||
|
@ -97,7 +97,7 @@ inline T getEpsilon() {
|
||||||
/// @brief Will return the constant PI for the requested type.
|
/// @brief Will return the constant PI for the requested type.
|
||||||
/// @return Pi
|
/// @return Pi
|
||||||
template<class T>
|
template<class T>
|
||||||
inline T PI() {
|
inline T aiPi() {
|
||||||
return static_cast<T>(3.14159265358979323846);
|
return static_cast<T>(3.14159265358979323846);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -57,7 +57,7 @@ protected:
|
||||||
aiMatrix4x4 get_predetermined_transformation_matrix_for_decomposition() const {
|
aiMatrix4x4 get_predetermined_transformation_matrix_for_decomposition() const {
|
||||||
aiMatrix4x4 t, r;
|
aiMatrix4x4 t, r;
|
||||||
aiMatrix4x4::Translation(aiVector3D(14,-25,-8), t);
|
aiMatrix4x4::Translation(aiVector3D(14,-25,-8), t);
|
||||||
aiMatrix4x4::Rotation(Math::PI<float>() / 4.0f, aiVector3D(1).Normalize(), r);
|
aiMatrix4x4::Rotation(Math::aiPi<float>() / 4.0f, aiVector3D(1).Normalize(), r);
|
||||||
return t * r;
|
return t * r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -59,7 +59,7 @@ TEST_F(AssimpAPITest_aiQuaternion, aiCreateQuaternionFromMatrixTest) {
|
||||||
// to prevent running into division by zero.
|
// to prevent running into division by zero.
|
||||||
aiMatrix3x3 m, r;
|
aiMatrix3x3 m, r;
|
||||||
aiMatrix3x3::Translation(aiVector2D(14,-25), m);
|
aiMatrix3x3::Translation(aiVector2D(14,-25), m);
|
||||||
aiMatrix3x3::RotationZ(Math::PI<float>() / 4.0f, r);
|
aiMatrix3x3::RotationZ(Math::aiPi<float>() / 4.0f, r);
|
||||||
m = m * r;
|
m = m * r;
|
||||||
|
|
||||||
result_cpp = aiQuaternion(m);
|
result_cpp = aiQuaternion(m);
|
||||||
|
@ -127,8 +127,8 @@ TEST_F(AssimpAPITest_aiQuaternion, aiQuaternionInterpolateTest) {
|
||||||
// Use predetermined quaternions to prevent division by zero
|
// Use predetermined quaternions to prevent division by zero
|
||||||
// during slerp calculations.
|
// during slerp calculations.
|
||||||
const float INTERPOLATION(0.5f);
|
const float INTERPOLATION(0.5f);
|
||||||
const auto q1 = aiQuaternion(aiVector3D(-1,1,1).Normalize(), Math::PI<float>() / 4.0f);
|
const auto q1 = aiQuaternion(aiVector3D(-1,1,1).Normalize(), Math::aiPi<float>() / 4.0f);
|
||||||
const auto q2 = aiQuaternion(aiVector3D(1,2,1).Normalize(), Math::PI<float>() / 2.0f);
|
const auto q2 = aiQuaternion(aiVector3D(1,2,1).Normalize(), Math::aiPi<float>() / 2.0f);
|
||||||
aiQuaternion::Interpolate(result_cpp, q1, q2, INTERPOLATION);
|
aiQuaternion::Interpolate(result_cpp, q1, q2, INTERPOLATION);
|
||||||
aiQuaternionInterpolate(&result_c, &q1, &q2, INTERPOLATION);
|
aiQuaternionInterpolate(&result_c, &q1, &q2, INTERPOLATION);
|
||||||
EXPECT_EQ(result_cpp, result_c);
|
EXPECT_EQ(result_cpp, result_c);
|
||||||
|
|
|
@ -51,6 +51,6 @@ const float AssimpMathTest::Epsilon = Math::getEpsilon<float>();
|
||||||
RandomUniformFloatGenerator AssimpMathTest::RandNonZero(1.0f, 100.0f);
|
RandomUniformFloatGenerator AssimpMathTest::RandNonZero(1.0f, 100.0f);
|
||||||
|
|
||||||
// Initialize with an interval of [-PI,PI] inclusively.
|
// Initialize with an interval of [-PI,PI] inclusively.
|
||||||
RandomUniformFloatGenerator AssimpMathTest::RandPI(-Math::PI<float>(), Math::PI<float>());
|
RandomUniformFloatGenerator AssimpMathTest::RandPI(-Math::aiPi<float>(), Math::aiPi<float>());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue