From efc60076dc951b0b0cfd9612fd8b5382a9e1e7e4 Mon Sep 17 00:00:00 2001 From: ChenJunshuai Date: Fri, 18 Feb 2022 19:01:47 +0800 Subject: [PATCH 1/4] udpate build script to fit "Visual Studio 16 2019" Generator --- BUILDBINARIES_EXAMPLE.bat | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/BUILDBINARIES_EXAMPLE.bat b/BUILDBINARIES_EXAMPLE.bat index 2dd13a542..0752b3b47 100644 --- a/BUILDBINARIES_EXAMPLE.bat +++ b/BUILDBINARIES_EXAMPLE.bat @@ -10,16 +10,15 @@ :: Also see: https://github.com/assimp/assimp/pull/2646 SET SOURCE_DIR=. +SET GENERATOR=Visual Studio 16 2019 -:: For generators see "cmake --help" -SET GENERATOR=Visual Studio 15 2017 - -SET BINARIES_DIR="./BINARIES/Win32" -cmake CMakeLists.txt -G "%GENERATOR%" -S %SOURCE_DIR% -B %BINARIES_DIR% +SET BINARIES_DIR="./build/Win32" +cmake . -G "%GENERATOR%" -A Win32 -S %SOURCE_DIR% -B %BINARIES_DIR% +cmake --build %BINARIES_DIR% --config debug cmake --build %BINARIES_DIR% --config release -SET BINARIES_DIR="./BINARIES/x64" -cmake CMakeLists.txt -G "%GENERATOR% Win64" -S %SOURCE_DIR% -B %BINARIES_DIR% +SET BINARIES_DIR="./build/x64" +cmake . -G "%GENERATOR%" -A x64 -S %SOURCE_DIR% -B %BINARIES_DIR% cmake --build %BINARIES_DIR% --config debug cmake --build %BINARIES_DIR% --config release From ad766cb738fbc899efe64593ff9ec2fd9c0a70a1 Mon Sep 17 00:00:00 2001 From: youkeyao Date: Sun, 20 Feb 2022 17:10:20 +0800 Subject: [PATCH 2/4] update the calculation and orthogonalization for bitangent --- code/PostProcessing/CalcTangentsProcess.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/code/PostProcessing/CalcTangentsProcess.cpp b/code/PostProcessing/CalcTangentsProcess.cpp index 0ebad91df..b8847e473 100644 --- a/code/PostProcessing/CalcTangentsProcess.cpp +++ b/code/PostProcessing/CalcTangentsProcess.cpp @@ -191,9 +191,9 @@ bool CalcTangentsProcess::ProcessMesh(aiMesh *pMesh, unsigned int meshIndex) { tangent.x = (w.x * sy - v.x * ty) * dirCorrection; tangent.y = (w.y * sy - v.y * ty) * dirCorrection; tangent.z = (w.z * sy - v.z * ty) * dirCorrection; - bitangent.x = (w.x * sx - v.x * tx) * dirCorrection; - bitangent.y = (w.y * sx - v.y * tx) * dirCorrection; - bitangent.z = (w.z * sx - v.z * tx) * dirCorrection; + bitangent.x = (- w.x * sx + v.x * tx) * dirCorrection; + bitangent.y = (- w.y * sx + v.y * tx) * dirCorrection; + bitangent.z = (- w.z * sx + v.z * tx) * dirCorrection; // store for every vertex of that face for (unsigned int b = 0; b < face.mNumIndices; ++b) { @@ -201,7 +201,7 @@ bool CalcTangentsProcess::ProcessMesh(aiMesh *pMesh, unsigned int meshIndex) { // project tangent and bitangent into the plane formed by the vertex' normal aiVector3D localTangent = tangent - meshNorm[p] * (tangent * meshNorm[p]); - aiVector3D localBitangent = bitangent - meshNorm[p] * (bitangent * meshNorm[p]); + aiVector3D localBitangent = bitangent - meshNorm[p] * (bitangent * meshNorm[p]) - localTangent * (bitangent * localTangent); localTangent.NormalizeSafe(); localBitangent.NormalizeSafe(); From 14874d26f445981d6e1554486a5562ab3a91d11e Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Sun, 20 Feb 2022 11:53:26 +0100 Subject: [PATCH 3/4] Fix stat for 32-biut linuxes - Reenable fix to ensure that stat works correctly on 32-bit linuxes again - stat will return 32-bit inodes when checking a file. So when this call will be used on a 64-bit linux this will cause errors like: Error writing to foo: Value too large for defined data type File I/O error: foo - closes https://github.com/assimp/assimp/issues/4390 --- CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0c4e7dbd4..1cdf617d3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -243,6 +243,13 @@ SET(ASSIMP_LIBRARY_SUFFIX "" CACHE STRING "Suffix to append to library names") IF( UNIX ) # Use GNUInstallDirs for Unix predefined directories INCLUDE(GNUInstallDirs) + # Ensure that we do not run into issues like http://www.tcm.phy.cam.ac.uk/sw/inodes64.html on 32 bit linux + IF( ${OPERATING_SYSTEM} MATCHES "Android") + ELSE() + IF ( CMAKE_SIZEOF_VOID_P EQUAL 4) # only necessary for 32-bit linux + #ADD_DEFINITIONS(-D_FILE_OFFSET_BITS=64 ) + ENDIF() + ENDIF() ENDIF() # Grouped compiler settings ######################################## From 96522bc114fc41653250f444dde3843b95ec113c Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Sun, 20 Feb 2022 14:06:11 +0100 Subject: [PATCH 4/4] Update CMakeLists.txt --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1cdf617d3..3e6c18d91 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -247,7 +247,7 @@ IF( UNIX ) IF( ${OPERATING_SYSTEM} MATCHES "Android") ELSE() IF ( CMAKE_SIZEOF_VOID_P EQUAL 4) # only necessary for 32-bit linux - #ADD_DEFINITIONS(-D_FILE_OFFSET_BITS=64 ) + ADD_DEFINITIONS(-D_FILE_OFFSET_BITS=64 ) ENDIF() ENDIF() ENDIF()