update assimp lib

This commit is contained in:
marauder2k7 2024-12-09 20:22:47 +00:00
parent 03a348deb7
commit d3f8fee74e
1725 changed files with 196314 additions and 62009 deletions

View file

@ -2,8 +2,7 @@
Open Asset Import Library (assimp)
----------------------------------------------------------------------
Copyright (c) 2006-2022, assimp team
Copyright (c) 2006-2024, assimp team
All rights reserved.
@ -42,8 +41,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/** @file A helper class that processes texture transformations */
#include <assimp/Importer.hpp>
#include <assimp/postprocess.h>
#include <assimp/DefaultLogger.hpp>
@ -56,33 +53,24 @@ using namespace Assimp;
// ------------------------------------------------------------------------------------------------
// Constructor to be privately used by Importer
TextureTransformStep::TextureTransformStep() :
configFlags()
{
TextureTransformStep::TextureTransformStep() : configFlags() {
// nothing to do here
}
// ------------------------------------------------------------------------------------------------
// Destructor, private as well
TextureTransformStep::~TextureTransformStep() = default;
// ------------------------------------------------------------------------------------------------
// Returns whether the processing step is present in the given flag field.
bool TextureTransformStep::IsActive( unsigned int pFlags) const
{
bool TextureTransformStep::IsActive( unsigned int pFlags) const {
return (pFlags & aiProcess_TransformUVCoords) != 0;
}
// ------------------------------------------------------------------------------------------------
// Setup properties
void TextureTransformStep::SetupProperties(const Importer* pImp)
{
void TextureTransformStep::SetupProperties(const Importer* pImp) {
configFlags = pImp->GetPropertyInteger(AI_CONFIG_PP_TUV_EVALUATE,AI_UVTRAFO_ALL);
}
// ------------------------------------------------------------------------------------------------
void TextureTransformStep::PreProcessUVTransform(STransformVecInfo& info)
{
void TextureTransformStep::PreProcessUVTransform(STransformVecInfo& info) {
/* This function tries to simplify the input UV transformation.
* That's very important as it allows us to reduce the number
* of output UV channels. The order in which the transformations
@ -90,7 +78,7 @@ void TextureTransformStep::PreProcessUVTransform(STransformVecInfo& info)
*/
int rounded;
char szTemp[512];
char szTemp[512] = {};
/* Optimize the rotation angle. That's slightly difficult as
* we have an inprecise floating-point number (when comparing
@ -98,12 +86,10 @@ void TextureTransformStep::PreProcessUVTransform(STransformVecInfo& info)
* an epsilon of 5 degrees). If there is a rotation value, we can't
* perform any further optimizations.
*/
if (info.mRotation)
{
if (info.mRotation) {
float out = info.mRotation;
rounded = static_cast<int>((info.mRotation / static_cast<float>(AI_MATH_TWO_PI)));
if (rounded)
{
if (rounded) {
out -= rounded * static_cast<float>(AI_MATH_PI);
ASSIMP_LOG_INFO("Texture coordinate rotation ", info.mRotation, " can be simplified to ", out);
}
@ -187,8 +173,7 @@ void TextureTransformStep::PreProcessUVTransform(STransformVecInfo& info)
}
// ------------------------------------------------------------------------------------------------
void UpdateUVIndex(const std::list<TTUpdateInfo>& l, unsigned int n)
{
void UpdateUVIndex(const std::list<TTUpdateInfo>& l, unsigned int n) {
// Don't set if == 0 && wasn't set before
for (std::list<TTUpdateInfo>::const_iterator it = l.begin();it != l.end(); ++it) {
const TTUpdateInfo& info = *it;
@ -203,8 +188,7 @@ void UpdateUVIndex(const std::list<TTUpdateInfo>& l, unsigned int n)
}
// ------------------------------------------------------------------------------------------------
inline const char* MappingModeToChar(aiTextureMapMode map)
{
inline static const char* MappingModeToChar(aiTextureMapMode map) {
if (aiTextureMapMode_Wrap == map)
return "-w";
@ -215,8 +199,7 @@ inline const char* MappingModeToChar(aiTextureMapMode map)
}
// ------------------------------------------------------------------------------------------------
void TextureTransformStep::Execute( aiScene* pScene)
{
void TextureTransformStep::Execute( aiScene* pScene) {
ASSIMP_LOG_DEBUG("TransformUVCoordsProcess begin");
@ -407,8 +390,8 @@ void TextureTransformStep::Execute( aiScene* pScene)
cnt = 0;
for (it = trafo.begin();it != trafo.end(); ++it,++cnt) {
if ((*it).lockedPos != AI_TT_UV_IDX_LOCK_NONE && (*it).lockedPos != cnt) {
it2 = trafo.begin();unsigned int t = 0;
while (t != (*it).lockedPos)
it2 = trafo.begin();
while ((*it2).lockedPos != (*it).lockedPos)
++it2;
if ((*it2).lockedPos != AI_TT_UV_IDX_LOCK_NONE) {
@ -508,8 +491,9 @@ void TextureTransformStep::Execute( aiScene* pScene)
ai_assert(nullptr != src);
// Copy the data to the destination array
if (dest != src)
if (dest != src) {
::memcpy(dest,src,sizeof(aiVector3D)*mesh->mNumVertices);
}
end = dest + mesh->mNumVertices;