update assimp to 5.2.3 Bugfix-Release

This commit is contained in:
AzaezelX 2022-04-26 11:56:24 -05:00
parent 3f796d2a06
commit f297476092
1150 changed files with 165834 additions and 112019 deletions

View file

@ -2,7 +2,7 @@
Open Asset Import Library (assimp)
----------------------------------------------------------------------
Copyright (c) 2006-2019, assimp team
Copyright (c) 2006-2022, assimp team
All rights reserved.
@ -92,9 +92,8 @@ void TextureTransformStep::PreProcessUVTransform(STransformVecInfo& info)
* are applied is - as always - scaling, rotation, translation.
*/
char szTemp[512];
int rounded = 0;
int rounded;
char szTemp[512];
/* Optimize the rotation angle. That's slightly difficult as
* we have an inprecise floating-point number (when comparing
@ -105,10 +104,11 @@ void TextureTransformStep::PreProcessUVTransform(STransformVecInfo& info)
if (info.mRotation)
{
float out = info.mRotation;
if ((rounded = static_cast<int>((info.mRotation / static_cast<float>(AI_MATH_TWO_PI)))))
rounded = static_cast<int>((info.mRotation / static_cast<float>(AI_MATH_TWO_PI)));
if (rounded)
{
out -= rounded * static_cast<float>(AI_MATH_PI);
ASSIMP_LOG_INFO_F("Texture coordinate rotation ", info.mRotation, " can be simplified to ", out);
ASSIMP_LOG_INFO("Texture coordinate rotation ", info.mRotation, " can be simplified to ", out);
}
// Next step - convert negative rotation angles to positives
@ -125,7 +125,8 @@ void TextureTransformStep::PreProcessUVTransform(STransformVecInfo& info)
* type (e.g. if mirroring is active there IS a difference between
* offset 2 and 3)
*/
if ((rounded = (int)info.mTranslation.x)) {
rounded = (int)info.mTranslation.x;
if (rounded) {
float out = 0.0f;
szTemp[0] = 0;
if (aiTextureMapMode_Wrap == info.mapU) {
@ -158,7 +159,8 @@ void TextureTransformStep::PreProcessUVTransform(STransformVecInfo& info)
* type (e.g. if mirroring is active there IS a difference between
* offset 2 and 3)
*/
if ((rounded = (int)info.mTranslation.y)) {
rounded = (int)info.mTranslation.y;
if (rounded) {
float out = 0.0f;
szTemp[0] = 0;
if (aiTextureMapMode_Wrap == info.mapV) {
@ -176,7 +178,7 @@ void TextureTransformStep::PreProcessUVTransform(STransformVecInfo& info)
}
else if (aiTextureMapMode_Clamp == info.mapV || aiTextureMapMode_Decal == info.mapV) {
// Clamp - translations beyond 1,1 are senseless
::ai_snprintf(szTemp,512,"[c] UV V offset %f canbe clamped to 1.0f",info.mTranslation.y);
::ai_snprintf(szTemp,512,"[c] UV V offset %f can be clamped to 1.0f",info.mTranslation.y);
out = 1.f;
}
@ -185,7 +187,6 @@ void TextureTransformStep::PreProcessUVTransform(STransformVecInfo& info)
info.mTranslation.y = out;
}
}
return;
}
// ------------------------------------------------------------------------------------------------
@ -428,7 +429,7 @@ void TextureTransformStep::Execute( aiScene* pScene)
// at the end of the list
bool ref[AI_MAX_NUMBER_OF_TEXTURECOORDS];
for (unsigned int n = 0; n < AI_MAX_NUMBER_OF_TEXTURECOORDS;++n)
ref[n] = (!mesh->mTextureCoords[n] ? true : false);
ref[n] = !mesh->mTextureCoords[n];
for (it = trafo.begin();it != trafo.end(); ++it)
ref[(*it).uvIndex] = true;
@ -447,7 +448,7 @@ void TextureTransformStep::Execute( aiScene* pScene)
if (size > AI_MAX_NUMBER_OF_TEXTURECOORDS) {
if (!DefaultLogger::isNullLogger()) {
ASSIMP_LOG_ERROR_F(static_cast<unsigned int>(trafo.size()), " UV channels required but just ",
ASSIMP_LOG_ERROR(static_cast<unsigned int>(trafo.size()), " UV channels required but just ",
AI_MAX_NUMBER_OF_TEXTURECOORDS, " available");
}
size = AI_MAX_NUMBER_OF_TEXTURECOORDS;
@ -507,7 +508,7 @@ void TextureTransformStep::Execute( aiScene* pScene)
aiVector3D* dest, *end;
dest = mesh->mTextureCoords[n];
ai_assert(NULL != src);
ai_assert(nullptr != src);
// Copy the data to the destination array
if (dest != src)
@ -538,7 +539,7 @@ void TextureTransformStep::Execute( aiScene* pScene)
m5.a3 += trl.x; m5.b3 += trl.y;
matrix = m2 * m4 * matrix * m3 * m5;
for (src = dest; src != end; ++src) { /* manual homogenious divide */
for (src = dest; src != end; ++src) { /* manual homogeneous divide */
src->z = 1.f;
*src = matrix * *src;
src->x /= src->z;
@ -556,7 +557,7 @@ void TextureTransformStep::Execute( aiScene* pScene)
if (!DefaultLogger::isNullLogger()) {
if (transformedChannels) {
ASSIMP_LOG_INFO_F("TransformUVCoordsProcess end: ", outChannels, " output channels (in: ", inChannels, ", modified: ", transformedChannels,")");
ASSIMP_LOG_INFO("TransformUVCoordsProcess end: ", outChannels, " output channels (in: ", inChannels, ", modified: ", transformedChannels,")");
} else {
ASSIMP_LOG_DEBUG("TransformUVCoordsProcess finished");
}