Add MikkTSpace Tangets code as 3rdparty lib

This commit is contained in:
Kim Kulling
2025-07-17 16:16:38 +02:00
parent 5081d263db
commit 11899f0120
3 changed files with 10 additions and 1 deletions

View File

@@ -961,6 +961,12 @@ ENDIF()
SOURCE_GROUP( Contrib\\Poly2Tri FILES ${Poly2Tri_SRCS})
#ENDIF()
# mikktspacetangets
SET( MikkTSpaceTangents_SRCS
../contrib/MikkTSpace/mikktspace.c
../contrib/MikkTSpace/mikktspace.h
)
# minizip/unzip
IF(ASSIMP_HUNTER_ENABLED)
hunter_add_package(minizip)
@@ -1159,6 +1165,7 @@ SET( assimp_src
${ziplib_SRCS}
${Pugixml_SRCS}
${stb_SRCS}
${MikkTSpaceTangents_SRCS}
# Necessary to show the headers in the project when using the VC++ generator:
${PUBLIC_HEADERS}

View File

@@ -50,7 +50,7 @@ static void get_tex_coords(const SMikkTSpaceContext *context, float outuv[], int
} else if (currentMesh->mNumUVComponents[iVert] == 3){
outuv[0] = t.x;
outuv[1] = t.y;
outuv[2] = t.z;
outuv[2] = 0.0;
}
}

View File

@@ -11,9 +11,11 @@ public:
~GenerateMikkTSpaceTangents() override = default;
bool IsActive(unsigned int pFlags) const override;
void Execute(aiScene* pScene) override;
void SetupProperties(const Importer *pImp) override;
void ExecutePerMesh(aiMesh *mesh);
private:
bool mActive = false;
SMikkTSpaceInterface mIface;
SMikkTSpaceContext mContext;
};