ADD Vertex utility class to simplify conversion from and to interleaved vertices.
Refactor JoinVerticesProcess to utilize the new utility. ADD basic operators for aiColor4D, move to dedicated header and implementation file. ADD some utility functions to SpatialSort. ADD my existing Catmull-Clark implementation to Assimp for all model formats with support for subdivision surfaces. Slightly WIP, likely to produce errors on non-closed meshes. Currently only implemented in the AC3D loader. Switch to byteswap intrinsics instead of inline assembly (bswap). Currently MSVC only. FIX phong shading in assimp_view. VertexTriangleAdjacency class now also works on arbitrary polygons - UNTESTED, tbd. git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@532 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
This commit is contained in:
@@ -366,7 +366,7 @@ inline void FindMeshCenterTransformed (aiMesh* mesh, aiVector3D& out,
|
||||
// Compute a good epsilon value for position comparisons on a mesh
|
||||
inline float ComputePositionEpsilon(const aiMesh* pMesh)
|
||||
{
|
||||
const float epsilon = 1e-5f;
|
||||
const float epsilon = 1e-4f;
|
||||
|
||||
// calculate the position bounds so we have a reliable epsilon to check position differences against
|
||||
aiVector3D minVec, maxVec;
|
||||
@@ -374,6 +374,26 @@ inline float ComputePositionEpsilon(const aiMesh* pMesh)
|
||||
return (maxVec - minVec).Length() * epsilon;
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------------
|
||||
// Compute a good epsilon value for position comparisons on a array of meshes
|
||||
inline float ComputePositionEpsilon(const aiMesh* const* pMeshes, size_t num)
|
||||
{
|
||||
const float epsilon = 1e-4f;
|
||||
|
||||
// calculate the position bounds so we have a reliable epsilon to check position differences against
|
||||
aiVector3D minVec, maxVec, mi, ma;
|
||||
MinMaxChooser<aiVector3D>()(minVec,maxVec);
|
||||
|
||||
for (size_t a = 0; a < num; ++a) {
|
||||
const aiMesh* pMesh = pMeshes[a];
|
||||
ArrayBounds(pMesh->mVertices,pMesh->mNumVertices,mi,ma);
|
||||
|
||||
minVec = std::min(minVec,mi);
|
||||
maxVec = std::max(maxVec,ma);
|
||||
}
|
||||
return (maxVec - minVec).Length() * epsilon;
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------------
|
||||
// Compute an unique value for the vertex format of a mesh
|
||||
inline unsigned int GetMeshVFormatUnique(aiMesh* pcMesh)
|
||||
|
||||
Reference in New Issue
Block a user