Merge pull request #3301 from mahiuchun/double

Fix build when ASSIMP_DOUBLE_PRECISION is on.
pull/3306/head
Kim Kulling 2020-06-30 21:24:35 +02:00 committed by GitHub
commit 7b7764afb9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 5 additions and 5 deletions

View File

@ -1079,7 +1079,7 @@ ASSIMP_API void aiMatrix4DecomposeIntoScalingAxisAnglePosition(
const C_STRUCT aiMatrix4x4 *mat, const C_STRUCT aiMatrix4x4 *mat,
C_STRUCT aiVector3D *scaling, C_STRUCT aiVector3D *scaling,
C_STRUCT aiVector3D *axis, C_STRUCT aiVector3D *axis,
float *angle, ai_real *angle,
C_STRUCT aiVector3D *position) { C_STRUCT aiVector3D *position) {
ai_assert(nullptr != mat); ai_assert(nullptr != mat);
ai_assert(nullptr != scaling); ai_assert(nullptr != scaling);

View File

@ -214,7 +214,7 @@ BinFloat ToBinary(const ai_real &pValue) {
const bool OneComplement = ((-42 == ~42) && (binValue & 0x80000000)); const bool OneComplement = ((-42 == ~42) && (binValue & 0x80000000));
if (DefaultValue) if (DefaultValue)
return BinFloat(1 << (CHAR_BIT * sizeof(BinFloat) - 1)) - binValue; return BinFloat(BinFloat(1) << (CHAR_BIT * sizeof(BinFloat) - 1)) - binValue;
// One's complement? // One's complement?
else if (OneComplement) else if (OneComplement)
return BinFloat(-0) - binValue; return BinFloat(-0) - binValue;

View File

@ -222,7 +222,7 @@ template <>
struct MinMaxChooser<aiVertexWeight> { struct MinMaxChooser<aiVertexWeight> {
void operator()(aiVertexWeight &min, aiVertexWeight &max) { void operator()(aiVertexWeight &min, aiVertexWeight &max) {
MinMaxChooser<unsigned int>()(min.mVertexId, max.mVertexId); MinMaxChooser<unsigned int>()(min.mVertexId, max.mVertexId);
MinMaxChooser<float>()(min.mWeight, max.mWeight); MinMaxChooser<ai_real>()(min.mWeight, max.mWeight);
} }
}; };

View File

@ -1044,7 +1044,7 @@ ASSIMP_API void aiMatrix4DecomposeIntoScalingAxisAnglePosition(
const C_STRUCT aiMatrix4x4* mat, const C_STRUCT aiMatrix4x4* mat,
C_STRUCT aiVector3D* scaling, C_STRUCT aiVector3D* scaling,
C_STRUCT aiVector3D* axis, C_STRUCT aiVector3D* axis,
float* angle, ai_real* angle,
C_STRUCT aiVector3D* position); C_STRUCT aiVector3D* position);
// -------------------------------------------------------------------------------- // --------------------------------------------------------------------------------

View File

@ -176,7 +176,7 @@ TEST_F(AssimpAPITest_aiMatrix4x4, aiMatrix4DecomposeIntoScalingAxisAnglePosition
aiVector3D scaling_c, scaling_cpp, aiVector3D scaling_c, scaling_cpp,
axis_c, axis_cpp, axis_c, axis_cpp,
position_c, position_cpp; position_c, position_cpp;
float angle_c, angle_cpp; ai_real angle_c, angle_cpp;
result_c = result_cpp = get_predetermined_transformation_matrix_for_decomposition(); result_c = result_cpp = get_predetermined_transformation_matrix_for_decomposition();
result_cpp.Decompose(scaling_cpp, axis_cpp, angle_cpp, position_cpp); result_cpp.Decompose(scaling_cpp, axis_cpp, angle_cpp, position_cpp);