Added support for point and line primitives.

Added SortByPType and DeterminePType (anon.) steps
Optimized ASE, fixed 3DS.
Rewrite all loaders to conform to the api changes.
Optimized normal computation code in LWOLoader.cpp
Added new unit tests
Added test file for AC3D (good old wuson again)
 

git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@167 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
This commit is contained in:
aramis_acg
2008-09-30 20:20:56 +00:00
parent 8925813026
commit 927cd1cd46
42 changed files with 27578 additions and 961 deletions

View File

@@ -114,11 +114,9 @@ bool CalcTangentsProcess::ProcessMesh( aiMesh* pMesh, unsigned int meshIndex)
// assert() it here.
//assert( must be verbose, dammit);
// TODO (Aramis)
// If we had a model format in the lib which has native support for
// tangents and bitangents, it would be necessary to add a
// "KillTangentsAndBitangents" flag ...
if (pMesh->mTangents && pMesh->mBitangents)
if (pMesh->mTangents && pMesh->mBitangents ||
!(pMesh->mPrimitiveTypes & (aiPrimitiveType_TRIANGLE | aiPrimitiveType_POLYGON)))
{
return false;
}
@@ -131,6 +129,8 @@ bool CalcTangentsProcess::ProcessMesh( aiMesh* pMesh, unsigned int meshIndex)
}
const float angleEpsilon = 0.9999f;
std::vector<bool> vertexDone( pMesh->mNumVertices, false);
// create space for the tangents and bitangents
pMesh->mTangents = new aiVector3D[pMesh->mNumVertices];
pMesh->mBitangents = new aiVector3D[pMesh->mNumVertices];
@@ -145,6 +145,13 @@ bool CalcTangentsProcess::ProcessMesh( aiMesh* pMesh, unsigned int meshIndex)
for( unsigned int a = 0; a < pMesh->mNumFaces; a++)
{
const aiFace& face = pMesh->mFaces[a];
if (face.mNumIndices < 3)
{
for (unsigned int i = 0; i < face.mNumIndices;++i)
vertexDone[face.mIndices[i]] = true;
continue;
}
// triangle or polygon... we always use only the first three indices. A polygon
// is supposed to be planar anyways....
@@ -215,7 +222,6 @@ bool CalcTangentsProcess::ProcessMesh( aiMesh* pMesh, unsigned int meshIndex)
// in the second pass we now smooth out all tangents and bitangents at the same local position
// if they are not too far off.
std::vector<bool> vertexDone( pMesh->mNumVertices, false);
for( unsigned int a = 0; a < pMesh->mNumVertices; a++)
{
if( vertexDone[a])