From ae2cce0899db7c97b684a35e0f78e60168e23658 Mon Sep 17 00:00:00 2001 From: rmitton Date: Sat, 23 Jan 2016 15:22:48 -0800 Subject: [PATCH 01/45] Validation fix for empty scenes. The validator requires empty scenes to have NULL pointers. --- code/SIBImporter.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/code/SIBImporter.cpp b/code/SIBImporter.cpp index bfb093512..880391fb5 100644 --- a/code/SIBImporter.cpp +++ b/code/SIBImporter.cpp @@ -860,9 +860,9 @@ void SIBImporter::InternReadFile(const std::string& pFile, pScene->mNumMaterials = sib.mtls.size(); pScene->mNumMeshes = sib.meshes.size(); pScene->mNumLights = sib.lights.size(); - pScene->mMaterials = new aiMaterial* [pScene->mNumMaterials]; - pScene->mMeshes = new aiMesh* [pScene->mNumMeshes]; - pScene->mLights = new aiLight* [pScene->mNumLights]; + pScene->mMaterials = pScene->mNumMaterials ? new aiMaterial*[pScene->mNumMaterials] : 0; + pScene->mMeshes = pScene->mNumMeshes ? new aiMesh*[pScene->mNumMeshes] : 0; + pScene->mLights = pScene->mNumLights ? new aiLight*[pScene->mNumLights] : 0; if (pScene->mNumMaterials) memcpy(pScene->mMaterials, &sib.mtls[0], sizeof(aiMaterial*) * pScene->mNumMaterials); if (pScene->mNumMeshes) @@ -875,7 +875,7 @@ void SIBImporter::InternReadFile(const std::string& pFile, aiNode *root = new aiNode(); root->mName.Set(""); root->mNumChildren = sib.objs.size() + sib.lights.size(); - root->mChildren = new aiNode* [root->mNumChildren]; + root->mChildren = root->mNumChildren ? new aiNode*[root->mNumChildren] : 0; pScene->mRootNode = root; // Add nodes for each object. @@ -889,7 +889,7 @@ void SIBImporter::InternReadFile(const std::string& pFile, node->mTransformation = obj.axis; node->mNumMeshes = obj.meshCount; - node->mMeshes = new unsigned[node->mNumMeshes]; + node->mMeshes = node->mNumMeshes ? new unsigned[node->mNumMeshes] : 0; for (unsigned i=0;imNumMeshes;i++) node->mMeshes[i] = obj.meshIdx + i; From 94a35dfdd26dfd29a164ebc2e707a998cf50fef2 Mon Sep 17 00:00:00 2001 From: rmitton Date: Mon, 25 Jan 2016 13:42:30 -0800 Subject: [PATCH 02/45] Fixed NULL pointers to match coding standards. --- code/SIBImporter.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/code/SIBImporter.cpp b/code/SIBImporter.cpp index 880391fb5..a25b96698 100644 --- a/code/SIBImporter.cpp +++ b/code/SIBImporter.cpp @@ -860,9 +860,9 @@ void SIBImporter::InternReadFile(const std::string& pFile, pScene->mNumMaterials = sib.mtls.size(); pScene->mNumMeshes = sib.meshes.size(); pScene->mNumLights = sib.lights.size(); - pScene->mMaterials = pScene->mNumMaterials ? new aiMaterial*[pScene->mNumMaterials] : 0; - pScene->mMeshes = pScene->mNumMeshes ? new aiMesh*[pScene->mNumMeshes] : 0; - pScene->mLights = pScene->mNumLights ? new aiLight*[pScene->mNumLights] : 0; + pScene->mMaterials = pScene->mNumMaterials ? new aiMaterial*[pScene->mNumMaterials] : NULL; + pScene->mMeshes = pScene->mNumMeshes ? new aiMesh*[pScene->mNumMeshes] : NULL; + pScene->mLights = pScene->mNumLights ? new aiLight*[pScene->mNumLights] : NULL; if (pScene->mNumMaterials) memcpy(pScene->mMaterials, &sib.mtls[0], sizeof(aiMaterial*) * pScene->mNumMaterials); if (pScene->mNumMeshes) @@ -875,7 +875,7 @@ void SIBImporter::InternReadFile(const std::string& pFile, aiNode *root = new aiNode(); root->mName.Set(""); root->mNumChildren = sib.objs.size() + sib.lights.size(); - root->mChildren = root->mNumChildren ? new aiNode*[root->mNumChildren] : 0; + root->mChildren = root->mNumChildren ? new aiNode*[root->mNumChildren] : NULL; pScene->mRootNode = root; // Add nodes for each object. @@ -889,7 +889,7 @@ void SIBImporter::InternReadFile(const std::string& pFile, node->mTransformation = obj.axis; node->mNumMeshes = obj.meshCount; - node->mMeshes = node->mNumMeshes ? new unsigned[node->mNumMeshes] : 0; + node->mMeshes = node->mNumMeshes ? new unsigned[node->mNumMeshes] : NULL; for (unsigned i=0;imNumMeshes;i++) node->mMeshes[i] = obj.meshIdx + i; From f23285a1cecee28c73bcaf685040fec7f6138451 Mon Sep 17 00:00:00 2001 From: rmitton Date: Mon, 25 Jan 2016 13:45:08 -0800 Subject: [PATCH 03/45] Fixed whitespace to match coding standard. --- code/SIBImporter.cpp | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/code/SIBImporter.cpp b/code/SIBImporter.cpp index a25b96698..8fce2234e 100644 --- a/code/SIBImporter.cpp +++ b/code/SIBImporter.cpp @@ -512,7 +512,7 @@ static void ReadShape(SIB* sib, StreamReaderLE* stream) aiString name; while (stream->GetRemainingSizeToLimit() >= sizeof(SIBChunk)) - { + { SIBChunk chunk = ReadChunk(stream); unsigned oldLimit = stream->SetReadLimit(stream->GetCurrentPos() + chunk.Size); @@ -720,7 +720,7 @@ static void ReadLight(SIB* sib, StreamReaderLE* stream) aiLight* light = new aiLight(); while (stream->GetRemainingSizeToLimit() >= sizeof(SIBChunk)) - { + { SIBChunk chunk = ReadChunk(stream); unsigned oldLimit = stream->SetReadLimit(stream->GetCurrentPos() + chunk.Size); @@ -768,18 +768,18 @@ static void ReadInstance(SIB* sib, StreamReaderLE* stream) uint32_t shapeIndex = 0; while (stream->GetRemainingSizeToLimit() >= sizeof(SIBChunk)) - { + { SIBChunk chunk = ReadChunk(stream); unsigned oldLimit = stream->SetReadLimit(stream->GetCurrentPos() + chunk.Size); switch (chunk.Tag) { - case TAG('D','I','N','F'): break; // display info, not needed - case TAG('P','I','N','F'): break; // ? + case TAG('D','I','N','F'): break; // display info, not needed + case TAG('P','I','N','F'): break; // ? case TAG('A','X','I','S'): ReadAxis(inst.axis, stream); break; - case TAG('I','N','S','I'): shapeIndex = stream->GetU4(); break; - case TAG('S','M','T','X'): ReadScale(inst.axis, stream); break; - case TAG('S','N','A','M'): inst.name = ReadString(stream, chunk.Size/2); break; + case TAG('I','N','S','I'): shapeIndex = stream->GetU4(); break; + case TAG('S','M','T','X'): ReadScale(inst.axis, stream); break; + case TAG('S','N','A','M'): inst.name = ReadString(stream, chunk.Size/2); break; default: UnknownChunk(stream, chunk); break; } @@ -808,7 +808,7 @@ static void ReadScene(SIB* sib, StreamReaderLE* stream) { // Parse each chunk in turn. while (stream->GetRemainingSizeToLimit() >= sizeof(SIBChunk)) - { + { SIBChunk chunk = ReadChunk(stream); unsigned oldLimit = stream->SetReadLimit(stream->GetCurrentPos() + chunk.Size); @@ -860,9 +860,9 @@ void SIBImporter::InternReadFile(const std::string& pFile, pScene->mNumMaterials = sib.mtls.size(); pScene->mNumMeshes = sib.meshes.size(); pScene->mNumLights = sib.lights.size(); - pScene->mMaterials = pScene->mNumMaterials ? new aiMaterial*[pScene->mNumMaterials] : NULL; - pScene->mMeshes = pScene->mNumMeshes ? new aiMesh*[pScene->mNumMeshes] : NULL; - pScene->mLights = pScene->mNumLights ? new aiLight*[pScene->mNumLights] : NULL; + pScene->mMaterials = pScene->mNumMaterials ? new aiMaterial*[pScene->mNumMaterials] : NULL; + pScene->mMeshes = pScene->mNumMeshes ? new aiMesh*[pScene->mNumMeshes] : NULL; + pScene->mLights = pScene->mNumLights ? new aiLight*[pScene->mNumLights] : NULL; if (pScene->mNumMaterials) memcpy(pScene->mMaterials, &sib.mtls[0], sizeof(aiMaterial*) * pScene->mNumMaterials); if (pScene->mNumMeshes) @@ -875,7 +875,7 @@ void SIBImporter::InternReadFile(const std::string& pFile, aiNode *root = new aiNode(); root->mName.Set(""); root->mNumChildren = sib.objs.size() + sib.lights.size(); - root->mChildren = root->mNumChildren ? new aiNode*[root->mNumChildren] : NULL; + root->mChildren = root->mNumChildren ? new aiNode*[root->mNumChildren] : NULL; pScene->mRootNode = root; // Add nodes for each object. @@ -889,7 +889,7 @@ void SIBImporter::InternReadFile(const std::string& pFile, node->mTransformation = obj.axis; node->mNumMeshes = obj.meshCount; - node->mMeshes = node->mNumMeshes ? new unsigned[node->mNumMeshes] : NULL; + node->mMeshes = node->mNumMeshes ? new unsigned[node->mNumMeshes] : NULL; for (unsigned i=0;imNumMeshes;i++) node->mMeshes[i] = obj.meshIdx + i; From c7d86e97cc182138d36f2b679af1c8c52a2fc724 Mon Sep 17 00:00:00 2001 From: Andrew Parlane Date: Sat, 23 Jan 2016 19:34:20 -0400 Subject: [PATCH 04/45] ObjTools: Update getName() to work with const iterators. Ther's no need to convert the input parameter to a char * when we can just leave it as it is. --- code/ObjTools.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/code/ObjTools.h b/code/ObjTools.h index 311965ce3..5406acd6d 100644 --- a/code/ObjTools.h +++ b/code/ObjTools.h @@ -141,7 +141,7 @@ inline char_t getName( char_t it, char_t end, std::string &name ) return end; } - char *pStart = &( *it ); + char_t pStart = it; while( !isEndOfBuffer( it, end ) && !IsLineEnd( *it ) ) { ++it; } @@ -153,10 +153,10 @@ inline char_t getName( char_t it, char_t end, std::string &name ) // Get name // if there is no name, and the previous char is a separator, come back to start - while (&(*it) < pStart) { + while (it < pStart) { ++it; } - std::string strName( pStart, &(*it) ); + std::string strName( pStart, it ); if ( strName.empty() ) return it; else From 109f6feb6ee85435fd342883780145db2f750128 Mon Sep 17 00:00:00 2001 From: Andrew Parlane Date: Sat, 23 Jan 2016 19:40:47 -0400 Subject: [PATCH 05/45] ObjFileParser: Moved the parsing of line continuations (backslashes) to the parsing code. Rather than removing all backslashes followed by newlines from the buffer, and then parsing it. Handle removing the backslashes as we go. This means we don't need to erase the backslashes from the buffer (which is O(n)) instead we just skip those characters as we parse the buffer line by line. This time I've fixed the order of evaluation bug in the call to getFace(). --- code/ObjFileImporter.cpp | 32 ---- code/ObjFileParser.cpp | 350 ++++++++++++++++++--------------------- code/ObjFileParser.h | 35 ++-- 3 files changed, 175 insertions(+), 242 deletions(-) diff --git a/code/ObjFileImporter.cpp b/code/ObjFileImporter.cpp index 9ea93c93c..82e7fad1c 100644 --- a/code/ObjFileImporter.cpp +++ b/code/ObjFileImporter.cpp @@ -145,38 +145,6 @@ void ObjFileImporter::InternReadFile( const std::string& pFile, aiScene* pScene, modelName = pFile; } - // This next stage takes ~ 1/3th of the total readFile task - // so should amount for 1/3th of the progress - // only update every 100KB or it'll be too slow - unsigned int progress = 0; - unsigned int progressCounter = 0; - const unsigned int updateProgressEveryBytes = 100 * 1024; - const unsigned int progressTotal = (3*m_Buffer.size()/updateProgressEveryBytes); - // process all '\' - std::vector ::iterator iter = m_Buffer.begin(); - while (iter != m_Buffer.end()) - { - if (*iter == '\\') - { - // remove '\' - iter = m_Buffer.erase(iter); - // remove next character - while (*iter == '\r' || *iter == '\n') - iter = m_Buffer.erase(iter); - } - else - ++iter; - - if (++progressCounter >= updateProgressEveryBytes) - { - m_progress->UpdateFileRead(++progress, progressTotal); - progressCounter = 0; - } - } - - // 1/3rd progress - m_progress->UpdateFileRead(1, 3); - // parse the file into a temporary representation ObjFileParser parser(m_Buffer, modelName, pIOHandler, m_progress); diff --git a/code/ObjFileParser.cpp b/code/ObjFileParser.cpp index 29cca5952..211888113 100644 --- a/code/ObjFileParser.cpp +++ b/code/ObjFileParser.cpp @@ -61,16 +61,13 @@ const std::string ObjFileParser::DEFAULT_MATERIAL = AI_DEFAULT_MATERIAL_NAME; // ------------------------------------------------------------------- // Constructor with loaded data and directories. -ObjFileParser::ObjFileParser(std::vector &data,const std::string &modelName, IOSystem *io, ProgressHandler* progress ) : - m_DataIt(data.begin()), - m_DataItEnd(data.end()), +ObjFileParser::ObjFileParser(const std::vector &data,const std::string &modelName, IOSystem *io, ProgressHandler* progress ) : + m_DataBuffer(data), m_pModel(NULL), m_uiLine(0), m_pIO( io ), m_progress(progress) { - std::fill_n(m_buffer,Buffersize,0); - // Create the model instance to store all the data m_pModel = new ObjFile::Model(); m_pModel->m_ModelName = modelName; @@ -104,48 +101,77 @@ ObjFile::Model *ObjFileParser::GetModel() const // File parsing method. void ObjFileParser::parseFile() { - if (m_DataIt == m_DataItEnd) + //! Iterator to current position in buffer + ConstDataArrayIt dataIt = m_DataBuffer.begin(); + //! Iterator to end position of buffer + const ConstDataArrayIt dataItEnd = m_DataBuffer.end(); + + if (dataIt == dataItEnd) return; + //! Helper buffer + std::vector helperBuffer; + // only update every 100KB or it'll be too slow const unsigned int updateProgressEveryBytes = 100 * 1024; unsigned int progressCounter = 0; - const unsigned int bytesToProcess = std::distance(m_DataIt, m_DataItEnd); - const unsigned int progressTotal = 3 * bytesToProcess; - const unsigned int progressOffset = bytesToProcess; + const unsigned int bytesToProcess = std::distance(dataIt, dataItEnd); + const unsigned int progressTotal = bytesToProcess; unsigned int processed = 0; - DataArrayIt lastDataIt = m_DataIt; + ConstDataArrayIt lastDataIt = dataIt; - while (m_DataIt != m_DataItEnd) + while (dataIt != dataItEnd) { // Handle progress reporting - processed += std::distance(lastDataIt, m_DataIt); - lastDataIt = m_DataIt; + processed += std::distance(lastDataIt, dataIt); + lastDataIt = dataIt; if (processed > (progressCounter * updateProgressEveryBytes)) { progressCounter++; - m_progress->UpdateFileRead(progressOffset + processed*2, progressTotal); + m_progress->UpdateFileRead(processed, progressTotal); } + // take the next line and copy it into a helper buffer + // all subsequant parsing should use the helper buffer + copyNextLine(helperBuffer, dataIt, dataItEnd); + + if (helperBuffer[0] == '\0') + { + // either empty line, or end of file + if (dataIt == dataItEnd) + { + // end of file + return; + } + // else empty line, so skip + continue; + } + + //! Iterator to current position in helper buffer + ConstDataArrayIt helperIt = helperBuffer.begin(); + //! Iterator to end of helper buffer + const ConstDataArrayIt helperItEnd = helperBuffer.end(); + // parse line - switch (*m_DataIt) + switch (*helperIt) { case 'v': // Parse a vertex texture coordinate { - ++m_DataIt; - if (*m_DataIt == ' ' || *m_DataIt == '\t') { - // read in vertex definition - getVector3(m_pModel->m_Vertices); - } else if (*m_DataIt == 't') { - // read in texture coordinate ( 2D or 3D ) - ++m_DataIt; - getVector( m_pModel->m_TextureCoord ); - } else if (*m_DataIt == 'n') { - // Read in normal vector definition - ++m_DataIt; - getVector3( m_pModel->m_Normals ); + if (++helperIt != helperItEnd) { + if (*helperIt == ' ' || *helperIt == '\t') { + // read in vertex definition + getVector3(m_pModel->m_Vertices, ++helperIt, helperItEnd); + } else if (*helperIt == 't') { + // read in texture coordinate ( 2D or 3D ) + getVector( m_pModel->m_TextureCoord, ++helperIt, helperItEnd); + } else if (*helperIt == 'n') { + // Read in normal vector definition + getVector3( m_pModel->m_Normals, ++helperIt, helperItEnd); + } + // else unknown line } + // else no more data } break; @@ -153,35 +179,38 @@ void ObjFileParser::parseFile() case 'l': case 'f': { - getFace(*m_DataIt == 'f' ? aiPrimitiveType_POLYGON : (*m_DataIt == 'l' - ? aiPrimitiveType_LINE : aiPrimitiveType_POINT)); + aiPrimitiveType primType = (*helperIt == 'f') ? aiPrimitiveType_POLYGON : + (*helperIt == 'l') ? aiPrimitiveType_LINE : + aiPrimitiveType_POINT; + getFace(primType, ++helperIt, helperItEnd); } break; case '#': // Parse a comment { - getComment(); + // just ignore it } break; case 'u': // Parse a material desc. setter { - getMaterialDesc(); + getMaterialDesc(++helperIt, helperItEnd); } break; case 'm': // Parse a material library or merging group ('mg') { - if (*(m_DataIt + 1) == 'g') + if (*(helperIt + 1) == 'g') getGroupNumberAndResolution(); - else - getMaterialLib(); + else { + getMaterialLib(++helperIt, helperItEnd); + } } break; case 'g': // Parse group name { - getGroupName(); + getGroupName(++helperIt, helperItEnd); } break; @@ -193,13 +222,12 @@ void ObjFileParser::parseFile() case 'o': // Parse object name { - getObjectName(); + getObjectName(++helperIt, helperItEnd); } break; - default: { - m_DataIt = skipLine( m_DataIt, m_DataItEnd, m_uiLine ); + // unknown line, skip } break; } @@ -208,34 +236,37 @@ void ObjFileParser::parseFile() // ------------------------------------------------------------------- // Copy the next word in a temporary buffer -void ObjFileParser::copyNextWord(char *pBuffer, size_t length) +bool ObjFileParser::getNextFloat(ConstDataArrayIt &dataIt, const ConstDataArrayIt dataItEnd, float &result) { - size_t index = 0; - m_DataIt = getNextWord(m_DataIt, m_DataItEnd); - while( m_DataIt != m_DataItEnd && !IsSpaceOrNewLine( *m_DataIt ) ) { - pBuffer[index] = *m_DataIt; - index++; - if( index == length - 1 ) { - break; - } - ++m_DataIt; + std::vector tmpBuffer; + dataIt = getNextWord(dataIt, dataItEnd); + while( dataIt != dataItEnd && !IsSpaceOrNewLine( *dataIt ) ) { + tmpBuffer.push_back(*dataIt); + ++dataIt; } - ai_assert(index < length); - pBuffer[index] = '\0'; + if (tmpBuffer.size() == 0) + { + return false; + } + + tmpBuffer.push_back('\0'); + + result = fast_atof(&tmpBuffer[0]); + return true; } // ------------------------------------------------------------------- // Copy the next line into a temporary buffer -void ObjFileParser::copyNextLine(char *pBuffer, size_t length) +void ObjFileParser::copyNextLine(std::vector &buffer, ConstDataArrayIt &dataIt, const ConstDataArrayIt dataItEnd) { - size_t index = 0u; - + // clear old data out. This is O(1) since a char is a "trivially-destructable type" + buffer.clear(); // some OBJ files have line continuations using \ (such as in C++ et al) bool continuation = false; - for (;m_DataIt != m_DataItEnd && index < length-1; ++m_DataIt) + for (;dataIt != dataItEnd; ++dataIt) { - const char c = *m_DataIt; + const char c = *dataIt; if (c == '\\') { continuation = true; continue; @@ -243,98 +274,84 @@ void ObjFileParser::copyNextLine(char *pBuffer, size_t length) if (c == '\n' || c == '\r') { if(continuation) { - pBuffer[ index++ ] = ' '; + buffer.push_back(' '); continue; } + // end of line, update dataIt to point to the start of the next + dataIt = skipLine(dataIt, dataItEnd, m_uiLine ); break; } continuation = false; - pBuffer[ index++ ] = c; + buffer.push_back(c); } - ai_assert(index < length); - pBuffer[ index ] = '\0'; + // add a NULL terminator + buffer.push_back('\0'); } // ------------------------------------------------------------------- -void ObjFileParser::getVector( std::vector &point3d_array ) { +void ObjFileParser::getVector( std::vector &point3d_array, ConstDataArrayIt &dataIt, const ConstDataArrayIt dataItEnd) { size_t numComponents( 0 ); - const char* tmp( &m_DataIt[0] ); - while( !IsLineEnd( *tmp ) ) { - if ( !SkipSpaces( &tmp ) ) { + float components[3]; + while( dataIt != dataItEnd ) { + if (!getNextFloat(dataIt, dataItEnd, components[numComponents])) + { + // failed + break; + } + numComponents++; + if (numComponents == 3) + { + // 3 is the max break; } - SkipToken( tmp ); - ++numComponents; } - float x, y, z; + if( 2 == numComponents ) { - copyNextWord( m_buffer, Buffersize ); - x = ( float ) fast_atof( m_buffer ); - - copyNextWord( m_buffer, Buffersize ); - y = ( float ) fast_atof( m_buffer ); - z = 0.0; - } else if( 3 == numComponents ) { - copyNextWord( m_buffer, Buffersize ); - x = ( float ) fast_atof( m_buffer ); - - copyNextWord( m_buffer, Buffersize ); - y = ( float ) fast_atof( m_buffer ); - - copyNextWord( m_buffer, Buffersize ); - z = ( float ) fast_atof( m_buffer ); - } else { + components[2] = 0.0f; + } else if( 3 != numComponents ) { throw DeadlyImportError( "OBJ: Invalid number of components" ); } - point3d_array.push_back( aiVector3D( x, y, z ) ); - m_DataIt = skipLine( m_DataIt, m_DataItEnd, m_uiLine ); + point3d_array.push_back( aiVector3D( components[0], components[1], components[2] ) ); } // ------------------------------------------------------------------- // Get values for a new 3D vector instance -void ObjFileParser::getVector3(std::vector &point3d_array) { +void ObjFileParser::getVector3(std::vector &point3d_array, ConstDataArrayIt &dataIt, const ConstDataArrayIt dataItEnd) { float x, y, z; - copyNextWord(m_buffer, Buffersize); - x = (float) fast_atof(m_buffer); - - copyNextWord(m_buffer, Buffersize); - y = (float) fast_atof(m_buffer); - - copyNextWord( m_buffer, Buffersize ); - z = ( float ) fast_atof( m_buffer ); - - point3d_array.push_back( aiVector3D( x, y, z ) ); - m_DataIt = skipLine( m_DataIt, m_DataItEnd, m_uiLine ); + if (!getNextFloat(dataIt, dataItEnd, x) || + !getNextFloat(dataIt, dataItEnd, y) || + !getNextFloat(dataIt, dataItEnd, z)) + { + throw DeadlyImportError( "OBJ: Invalid number of components" ); + } + else + { + point3d_array.push_back( aiVector3D( x, y, z ) ); + } } // ------------------------------------------------------------------- // Get values for a new 2D vector instance -void ObjFileParser::getVector2( std::vector &point2d_array ) { +void ObjFileParser::getVector2( std::vector &point2d_array, ConstDataArrayIt &dataIt, const ConstDataArrayIt dataItEnd) { float x, y; - copyNextWord(m_buffer, Buffersize); - x = (float) fast_atof(m_buffer); - - copyNextWord(m_buffer, Buffersize); - y = (float) fast_atof(m_buffer); - - point2d_array.push_back(aiVector2D(x, y)); - - m_DataIt = skipLine( m_DataIt, m_DataItEnd, m_uiLine ); + if (!getNextFloat(dataIt, dataItEnd, x) || + !getNextFloat(dataIt, dataItEnd, y)) + { + throw DeadlyImportError( "OBJ: Invalid number of components" ); + } + else + { + point2d_array.push_back( aiVector2D( x, y ) ); + } } // ------------------------------------------------------------------- // Get values for a new face instance -void ObjFileParser::getFace(aiPrimitiveType type) +void ObjFileParser::getFace(aiPrimitiveType type, ConstDataArrayIt &dataIt, const ConstDataArrayIt dataItEnd) { - copyNextLine(m_buffer, Buffersize); - if (m_DataIt == m_DataItEnd) - return; - - char *pPtr = m_buffer; - char *pEnd = &pPtr[Buffersize]; - pPtr = getNextToken(pPtr, pEnd); - if (pPtr == pEnd || *pPtr == '\0') + ConstDataArrayIt pPtr = getNextToken(dataIt, dataItEnd); + if (pPtr == dataItEnd || *pPtr == '\0') return; std::vector *pIndices = new std::vector; @@ -349,7 +366,7 @@ void ObjFileParser::getFace(aiPrimitiveType type) const bool vt = (!m_pModel->m_TextureCoord.empty()); const bool vn = (!m_pModel->m_Normals.empty()); int iStep = 0, iPos = 0; - while (pPtr != pEnd) + while (pPtr != dataItEnd) { iStep = 1; @@ -378,7 +395,7 @@ void ObjFileParser::getFace(aiPrimitiveType type) else { //OBJ USES 1 Base ARRAYS!!!! - const int iVal = atoi( pPtr ); + const int iVal = atoi( &pPtr[0] ); // increment iStep position based off of the sign and # of digits int tmp = iVal; @@ -435,8 +452,8 @@ void ObjFileParser::getFace(aiPrimitiveType type) if ( pIndices->empty() ) { DefaultLogger::get()->error("Obj: Ignoring empty face"); - // skip line and clean up - m_DataIt = skipLine( m_DataIt, m_DataItEnd, m_uiLine ); + + // clean up delete pNormalID; delete pTexID; delete pIndices; @@ -470,31 +487,25 @@ void ObjFileParser::getFace(aiPrimitiveType type) if( !m_pModel->m_pCurrentMesh->m_hasNormals && hasNormal ) { m_pModel->m_pCurrentMesh->m_hasNormals = true; } - // Skip the rest of the line - m_DataIt = skipLine( m_DataIt, m_DataItEnd, m_uiLine ); } // ------------------------------------------------------------------- // Get values for a new material description -void ObjFileParser::getMaterialDesc() +void ObjFileParser::getMaterialDesc(ConstDataArrayIt &dataIt, const ConstDataArrayIt dataItEnd) { // Get next data for material data - m_DataIt = getNextToken(m_DataIt, m_DataItEnd); - if (m_DataIt == m_DataItEnd) { + dataIt = getNextToken(dataIt, dataItEnd); + if (dataIt == dataItEnd) { return; } - char *pStart = &(*m_DataIt); - while( m_DataIt != m_DataItEnd && !IsLineEnd( *m_DataIt ) ) { - ++m_DataIt; - } - // In some cases we should ignore this 'usemtl' command, this variable helps us to do so bool skip = false; // Get name - std::string strName(pStart, &(*m_DataIt)); + std::string strName(dataIt, dataItEnd); strName = trim_whitespaces(strName); + if (strName.empty()) skip = true; @@ -525,46 +536,20 @@ void ObjFileParser::getMaterialDesc() m_pModel->m_pCurrentMesh->m_uiMaterialIndex = getMaterialIndex(strName); } - - // Skip rest of line - m_DataIt = skipLine( m_DataIt, m_DataItEnd, m_uiLine ); -} - -// ------------------------------------------------------------------- -// Get a comment, values will be skipped -void ObjFileParser::getComment() -{ - while (m_DataIt != m_DataItEnd) - { - if ( '\n' == (*m_DataIt)) - { - ++m_DataIt; - break; - } - else - { - ++m_DataIt; - } - } } // ------------------------------------------------------------------- // Get material library from file. -void ObjFileParser::getMaterialLib() +void ObjFileParser::getMaterialLib(ConstDataArrayIt &dataIt, const ConstDataArrayIt dataItEnd) { // Translate tuple - m_DataIt = getNextToken(m_DataIt, m_DataItEnd); - if( m_DataIt == m_DataItEnd ) { + dataIt = getNextToken(dataIt, dataItEnd); + if( dataIt == dataItEnd ) { return; } - char *pStart = &(*m_DataIt); - while( m_DataIt != m_DataItEnd && !IsLineEnd( *m_DataIt ) ) { - ++m_DataIt; - } - // Check for existence - const std::string strMatName(pStart, &(*m_DataIt)); + const std::string strMatName(dataIt, dataItEnd); std::string absName; if ( m_pIO->StackSize() > 0 ) { std::string path = m_pIO->CurrentDirectory(); @@ -579,7 +564,6 @@ void ObjFileParser::getMaterialLib() if (!pFile ) { DefaultLogger::get()->error( "OBJ: Unable to locate material file " + strMatName ); - m_DataIt = skipLine( m_DataIt, m_DataItEnd, m_uiLine ); return; } @@ -597,19 +581,19 @@ void ObjFileParser::getMaterialLib() // ------------------------------------------------------------------- // Set a new material definition as the current material. -void ObjFileParser::getNewMaterial() +void ObjFileParser::getNewMaterial(ConstDataArrayIt &dataIt, const ConstDataArrayIt dataItEnd) { - m_DataIt = getNextToken(m_DataIt, m_DataItEnd); - m_DataIt = getNextWord(m_DataIt, m_DataItEnd); - if( m_DataIt == m_DataItEnd ) { + dataIt = getNextToken(dataIt, dataItEnd); + dataIt = getNextWord(dataIt, dataItEnd); + if( dataIt == dataItEnd ) { return; } - char *pStart = &(*m_DataIt); - std::string strMat( pStart, *m_DataIt ); - while( m_DataIt != m_DataItEnd && IsSpaceOrNewLine( *m_DataIt ) ) { - ++m_DataIt; + const char *pStart = &(*dataIt); + while( dataIt != dataItEnd && IsSpaceOrNewLine( *dataIt ) ) { + ++dataIt; } + std::string strMat( pStart, *dataIt ); std::map::iterator it = m_pModel->m_MaterialMap.find( strMat ); if ( it == m_pModel->m_MaterialMap.end() ) { @@ -626,8 +610,6 @@ void ObjFileParser::getNewMaterial() } m_pModel->m_pCurrentMesh->m_uiMaterialIndex = getMaterialIndex( strMat ); } - - m_DataIt = skipLine( m_DataIt, m_DataItEnd, m_uiLine ); } // ------------------------------------------------------------------- @@ -650,12 +632,13 @@ int ObjFileParser::getMaterialIndex( const std::string &strMaterialName ) // ------------------------------------------------------------------- // Getter for a group name. -void ObjFileParser::getGroupName() +void ObjFileParser::getGroupName(ConstDataArrayIt &dataIt, const ConstDataArrayIt dataItEnd) { std::string strGroupName; - m_DataIt = getName(m_DataIt, m_DataItEnd, strGroupName); - if( isEndOfBuffer( m_DataIt, m_DataItEnd ) ) { + dataIt = getNextToken(dataIt, dataItEnd); + dataIt = getName(dataIt, dataItEnd, strGroupName); + if( isEndOfBuffer( dataIt, dataItEnd ) ) { return; } @@ -681,7 +664,6 @@ void ObjFileParser::getGroupName() } m_pModel->m_strActiveGroup = strGroupName; } - m_DataIt = skipLine( m_DataIt, m_DataItEnd, m_uiLine ); } // ------------------------------------------------------------------- @@ -689,8 +671,6 @@ void ObjFileParser::getGroupName() void ObjFileParser::getGroupNumber() { // Not used - - m_DataIt = skipLine( m_DataIt, m_DataItEnd, m_uiLine ); } // ------------------------------------------------------------------- @@ -698,25 +678,19 @@ void ObjFileParser::getGroupNumber() void ObjFileParser::getGroupNumberAndResolution() { // Not used - - m_DataIt = skipLine( m_DataIt, m_DataItEnd, m_uiLine ); } // ------------------------------------------------------------------- // Stores values for a new object instance, name will be used to // identify it. -void ObjFileParser::getObjectName() +void ObjFileParser::getObjectName(ConstDataArrayIt &dataIt, const ConstDataArrayIt dataItEnd) { - m_DataIt = getNextToken(m_DataIt, m_DataItEnd); - if( m_DataIt == m_DataItEnd ) { + dataIt = getNextToken(dataIt, dataItEnd); + if( dataIt == dataItEnd ) { return; } - char *pStart = &(*m_DataIt); - while( m_DataIt != m_DataItEnd && !IsSpaceOrNewLine( *m_DataIt ) ) { - ++m_DataIt; - } - std::string strObjectName(pStart, &(*m_DataIt)); + std::string strObjectName(dataIt, dataItEnd); if (!strObjectName.empty()) { // Reset current object @@ -739,7 +713,6 @@ void ObjFileParser::getObjectName() createObject( strObjectName ); } } - m_DataIt = skipLine( m_DataIt, m_DataItEnd, m_uiLine ); } // ------------------------------------------------------------------- // Creates a new object instance @@ -803,7 +776,6 @@ bool ObjFileParser::needsNewMesh( const std::string &rMaterialName ) // Shows an error in parsing process. void ObjFileParser::reportErrorTokenInFace() { - m_DataIt = skipLine( m_DataIt, m_DataItEnd, m_uiLine ); DefaultLogger::get()->error("OBJ: Not supported token in face description detected"); } diff --git a/code/ObjFileParser.h b/code/ObjFileParser.h index e16de49a8..52fbe5540 100644 --- a/code/ObjFileParser.h +++ b/code/ObjFileParser.h @@ -65,14 +65,13 @@ class ProgressHandler; /// \brief Parser for a obj waveform file class ObjFileParser { public: - static const size_t Buffersize = 4096; typedef std::vector DataArray; typedef std::vector::iterator DataArrayIt; typedef std::vector::const_iterator ConstDataArrayIt; public: /// \brief Constructor with data array. - ObjFileParser(std::vector &Data,const std::string &strModelName, IOSystem* io, ProgressHandler* progress); + ObjFileParser(const std::vector &Data,const std::string &strModelName, IOSystem* io, ProgressHandler* progress); /// \brief Destructor ~ObjFileParser(); /// \brief Model getter. @@ -82,27 +81,25 @@ private: /// Parse the loaded file void parseFile(); /// Method to copy the new delimited word in the current line. - void copyNextWord(char *pBuffer, size_t length); + bool getNextFloat(ConstDataArrayIt &dataIt, const ConstDataArrayIt dataItEnd, float &result); /// Method to copy the new line. - void copyNextLine(char *pBuffer, size_t length); + void copyNextLine(std::vector &buffer, ConstDataArrayIt &dataIt, const ConstDataArrayIt dataItEnd); /// Stores the vector - void getVector( std::vector &point3d_array ); + void getVector( std::vector &point3d_array, ConstDataArrayIt &dataIt, const ConstDataArrayIt dataItEnd); /// Stores the following 3d vector. - void getVector3( std::vector &point3d_array ); + void getVector3(std::vector &point3d_array, ConstDataArrayIt &dataIt, const ConstDataArrayIt dataItEnd); /// Stores the following 3d vector. - void getVector2(std::vector &point2d_array); + void getVector2(std::vector &point2d_array, ConstDataArrayIt &dataIt, const ConstDataArrayIt dataItEnd); /// Stores the following face. - void getFace(aiPrimitiveType type); + void getFace(aiPrimitiveType type, ConstDataArrayIt &dataIt, const ConstDataArrayIt dataItEnd); /// Reads the material description. - void getMaterialDesc(); - /// Gets a comment. - void getComment(); + void getMaterialDesc(ConstDataArrayIt &dataIt, const ConstDataArrayIt dataItEnd); /// Gets a a material library. - void getMaterialLib(); + void getMaterialLib(ConstDataArrayIt &dataIt, const ConstDataArrayIt dataItEnd); /// Creates a new material. - void getNewMaterial(); + void getNewMaterial(ConstDataArrayIt &dataIt, const ConstDataArrayIt dataItEnd); /// Gets the group name from file. - void getGroupName(); + void getGroupName(ConstDataArrayIt &dataIt, const ConstDataArrayIt dataItEnd); /// Gets the group number from file. void getGroupNumber(); /// Gets the group number and resolution from file. @@ -110,7 +107,7 @@ private: /// Returns the index of the material. Is -1 if not material was found. int getMaterialIndex( const std::string &strMaterialName ); /// Parse object name - void getObjectName(); + void getObjectName(ConstDataArrayIt &dataIt, const ConstDataArrayIt dataItEnd); /// Creates a new object. void createObject( const std::string &strObjectName ); /// Creates a new mesh. @@ -128,16 +125,12 @@ private: /// Default material name static const std::string DEFAULT_MATERIAL; - //! Iterator to current position in buffer - DataArrayIt m_DataIt; - //! Iterator to end position of buffer - DataArrayIt m_DataItEnd; + //! Data buffer + const std::vector &m_DataBuffer; //! Pointer to model instance ObjFile::Model *m_pModel; //! Current line (for debugging) unsigned int m_uiLine; - //! Helper buffer - char m_buffer[Buffersize]; /// Pointer to IO system instance. IOSystem *m_pIO; //! Pointer to progress handler From bcd38707c580148b508ad7a9525099a03017a313 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Fri, 29 Jan 2016 21:22:41 +0100 Subject: [PATCH 06/45] 3DSConverter: fix level 4 compiler warning. --- code/3DSConverter.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/code/3DSConverter.cpp b/code/3DSConverter.cpp index 18bb3132e..cea255380 100644 --- a/code/3DSConverter.cpp +++ b/code/3DSConverter.cpp @@ -70,8 +70,9 @@ void Discreet3DSImporter::ReplaceDefaultMaterial() for (unsigned int i = 0; i < mScene->mMaterials.size();++i) { std::string s = mScene->mMaterials[i].mName; - for (std::string::iterator it = s.begin(); it != s.end(); ++it) - *it = ::tolower(*it); + for ( std::string::iterator it = s.begin(); it != s.end(); ++it ) { + *it = static_cast< char >( ::tolower( *it ) ); + } if (std::string::npos == s.find("default"))continue; @@ -663,14 +664,14 @@ void Discreet3DSImporter::AddNodeToGraph(aiScene* pcSOut,aiNode* pcOut, nda->mRotationKeys = new aiQuatKey[nda->mNumRotationKeys]; // Rotations are quaternion offsets - aiQuaternion abs; + aiQuaternion abs1; for (unsigned int n = 0; n < nda->mNumRotationKeys;++n) { const aiQuatKey& q = pcIn->aRotationKeys[n]; - abs = (n ? abs * q.mValue : q.mValue); + abs1 = (n ? abs1 * q.mValue : q.mValue); nda->mRotationKeys[n].mTime = q.mTime; - nda->mRotationKeys[n].mValue = abs.Normalize(); + nda->mRotationKeys[n].mValue = abs1.Normalize(); } } From a37ea18f09b2d1b8f970609c782e3b7eb0dd0d1f Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Sun, 31 Jan 2016 00:41:14 +0100 Subject: [PATCH 07/45] SIBImporter: fix c++14 compilation issue for clang. --- code/SIBImporter.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/code/SIBImporter.cpp b/code/SIBImporter.cpp index 34db8d78f..4a124a4ae 100644 --- a/code/SIBImporter.cpp +++ b/code/SIBImporter.cpp @@ -163,7 +163,12 @@ static aiColor3D ReadColor(StreamReaderLE* stream) static void UnknownChunk(StreamReaderLE* stream, const SIBChunk& chunk) { - char temp[5] = { (chunk.Tag>>24)&0xff, (chunk.Tag>>16)&0xff, (chunk.Tag>>8)&0xff, chunk.Tag&0xff, '\0' }; + char temp[5] = { + ( char ) ( chunk.Tag>>24 ) & 0xff, + ( char ) ( chunk.Tag>>16 ) & 0xff, + ( char ) ( chunk.Tag>>8 ) & 0xff, + ( char ) chunk.Tag & 0xff, '\0' + }; DefaultLogger::get()->warn((Formatter::format(), "SIB: Skipping unknown '",temp,"' chunk.")); } From 9f9f69d6cc9f0e20fc518d911a27519de89c00db Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Sun, 31 Jan 2016 13:43:05 +0100 Subject: [PATCH 08/45] AndroidJNIIOSystem: update license info to 2016. --- .../port/AndroidJNI/AndroidJNIIOSystem.h | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/include/assimp/port/AndroidJNI/AndroidJNIIOSystem.h b/include/assimp/port/AndroidJNI/AndroidJNIIOSystem.h index 53aa2b844..566aee0ae 100644 --- a/include/assimp/port/AndroidJNI/AndroidJNIIOSystem.h +++ b/include/assimp/port/AndroidJNI/AndroidJNIIOSystem.h @@ -2,11 +2,11 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2012, assimp team +Copyright (c) 2006-2016, assimp team All rights reserved. -Redistribution and use of this software in source and binary forms, -with or without modification, are permitted provided that the +Redistribution and use of this software in source and binary forms, +with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above @@ -23,16 +23,16 @@ following conditions are met: derived from this software without specific prior written permission of the assimp team. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ---------------------------------------------------------------------- From f1666d22cef13bf71f1f422e3a7123d74e0cf74e Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Sun, 31 Jan 2016 13:44:15 +0100 Subject: [PATCH 09/45] Closes https://github.com/assimp/assimp/issues/778: export android system. --- include/assimp/port/AndroidJNI/AndroidJNIIOSystem.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/assimp/port/AndroidJNI/AndroidJNIIOSystem.h b/include/assimp/port/AndroidJNI/AndroidJNIIOSystem.h index 566aee0ae..727aaa7c6 100644 --- a/include/assimp/port/AndroidJNI/AndroidJNIIOSystem.h +++ b/include/assimp/port/AndroidJNI/AndroidJNIIOSystem.h @@ -54,7 +54,7 @@ namespace Assimp { // --------------------------------------------------------------------------- /** Android extension to DefaultIOSystem using the standard C file functions */ -class AndroidJNIIOSystem : public DefaultIOSystem +class ASSIMP_API AndroidJNIIOSystem : public DefaultIOSystem { public: From a1bd83d7976fbddf9e5caa50f0fa4e3b08b2e97a Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Mon, 1 Feb 2016 16:16:09 +0100 Subject: [PATCH 10/45] ai_assert: split 2 checks in one macro to 2 separate ai_assert tests. --- code/SceneCombiner.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/code/SceneCombiner.cpp b/code/SceneCombiner.cpp index 1027b9d22..b56e2e601 100644 --- a/code/SceneCombiner.cpp +++ b/code/SceneCombiner.cpp @@ -1128,10 +1128,11 @@ void SceneCombiner::Copy (aiTexture** _dest, const aiTexture* src) } // ------------------------------------------------------------------------------------------------ -void SceneCombiner::Copy (aiAnimation** _dest, const aiAnimation* src) +void SceneCombiner::Copy( aiAnimation** _dest, const aiAnimation* src ) { - ai_assert(NULL != _dest && NULL != src); - + ai_assert( NULL != _dest ); + ai_assert( NULL != src ); + aiAnimation* dest = *_dest = new aiAnimation(); // get a flat copy From aaec1656f3f74a911cf6b4544670b344d3f41d63 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Mon, 1 Feb 2016 16:16:48 +0100 Subject: [PATCH 11/45] Closes https://github.com/assimp/assimp/issues/43 : provide different matrix scheme via union. --- include/assimp/matrix3x3.h | 28 +++++++++++++++++++--------- include/assimp/matrix4x4.h | 36 +++++++++++++++++++++++------------- 2 files changed, 42 insertions(+), 22 deletions(-) diff --git a/include/assimp/matrix3x3.h b/include/assimp/matrix3x3.h index 802505143..6b2350efc 100644 --- a/include/assimp/matrix3x3.h +++ b/include/assimp/matrix3x3.h @@ -161,10 +161,15 @@ public: public: - - TReal a1, a2, a3; - TReal b1, b2, b3; - TReal c1, c2, c3; + union { + struct { + TReal a1, a2, a3; + TReal b1, b2, b3; + TReal c1, c2, c3; + }; + TReal m[ 3 ][ 3 ]; + TReal mData[ 9 ]; + }; } PACK_STRUCT; typedef aiMatrix3x3t aiMatrix3x3; @@ -172,13 +177,18 @@ typedef aiMatrix3x3t aiMatrix3x3; #else struct aiMatrix3x3 { - - float a1, a2, a3; - float b1, b2, b3; - float c1, c2, c3; + union { + struct { + float a1, a2, a3; + float b1, b2, b3; + float c1, c2, c3; + }; + float m[ 3 ][ 3 ]; + float mData[ 9 ]; + }; } PACK_STRUCT; -#endif +#endif // __cplusplus #include "./Compiler/poppack1.h" diff --git a/include/assimp/matrix4x4.h b/include/assimp/matrix4x4.h index 3b7b6948c..79ef26774 100644 --- a/include/assimp/matrix4x4.h +++ b/include/assimp/matrix4x4.h @@ -213,8 +213,8 @@ public: /** @brief A function for creating a rotation matrix that rotates a * vector called "from" into another vector called "to". * Input : from[3], to[3] which both must be *normalized* non-zero vectors - * Output: mtx[3][3] -- a 3x3 matrix in colum-major form - * Authors: Tomas M�ller, John Hughes + * Output: mtx[3][3] -- a 3x3 matrix in column-major form + * Authors: Tomas Mueller, John Hughes * "Efficiently Building a Matrix to Rotate One Vector to Another" * Journal of Graphics Tools, 4(4):1-4, 1999 */ @@ -222,12 +222,16 @@ public: const aiVector3t& to, aiMatrix4x4t& out); public: - - TReal a1, a2, a3, a4; - TReal b1, b2, b3, b4; - TReal c1, c2, c3, c4; - TReal d1, d2, d3, d4; - + union { + struct { + TReal a1, a2, a3, a4; + TReal b1, b2, b3, b4; + TReal c1, c2, c3, c4; + TReal d1, d2, d3, d4; + }; + TReal m[ 4 ][ 4 ]; + TReal mData[ 16 ]; + }; } PACK_STRUCT; typedef aiMatrix4x4t aiMatrix4x4; @@ -235,11 +239,17 @@ typedef aiMatrix4x4t aiMatrix4x4; #else struct aiMatrix4x4 { - float a1, a2, a3, a4; - float b1, b2, b3, b4; - float c1, c2, c3, c4; - float d1, d2, d3, d4; -}; + union { + struct { + float a1, a2, a3, a4; + float b1, b2, b3, b4; + float c1, c2, c3, c4; + float d1, d2, d3, d4; + }; + float m[ 4 ][ 4 ]; + float mData[ 16 ]; + }; +} PACK_STRUCT; #endif // __cplusplus From 59ece7b9fa10d5e437434099b43230e1dbc06b48 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Tue, 2 Feb 2016 00:59:47 +0100 Subject: [PATCH 12/45] Datatypes: add missing unions for vector + color types. --- include/assimp/color4.h | 14 ++++++++++++-- include/assimp/vector2.h | 15 +++++++++++++-- include/assimp/vector3.h | 15 ++++++++++++--- 3 files changed, 37 insertions(+), 7 deletions(-) diff --git a/include/assimp/color4.h b/include/assimp/color4.h index 6bcab45df..2a2c338c8 100644 --- a/include/assimp/color4.h +++ b/include/assimp/color4.h @@ -86,7 +86,12 @@ public: public: // Red, green, blue and alpha color values - TReal r, g, b, a; + union { + struct { + TReal r, g, b, a; + }; + TReal c[ 4 ]; + }; } PACK_STRUCT; // !struct aiColor4D typedef aiColor4t aiColor4D; @@ -94,7 +99,12 @@ typedef aiColor4t aiColor4D; #else struct aiColor4D { - float r, g, b, a; + union { + struct { + float r, g, b, a; + }; + float c[ 4 ]; + }; } PACK_STRUCT; #endif // __cplusplus diff --git a/include/assimp/vector2.h b/include/assimp/vector2.h index d9901a390..2342f1ebd 100644 --- a/include/assimp/vector2.h +++ b/include/assimp/vector2.h @@ -95,7 +95,13 @@ public: template operator aiVector2t () const; - TReal x, y; + union { + struct { + TReal x, y; + }; + TReal v[ 2 ]; + }; + } PACK_STRUCT; typedef aiVector2t aiVector2D; @@ -103,7 +109,12 @@ typedef aiVector2t aiVector2D; #else struct aiVector2D { - float x,y; + union { + struct { + float x, y; + }; + float v[ 2 ]; + }; }; #endif // __cplusplus diff --git a/include/assimp/vector3.h b/include/assimp/vector3.h index d255d8ff0..0358045e3 100644 --- a/include/assimp/vector3.h +++ b/include/assimp/vector3.h @@ -125,7 +125,12 @@ public: * @param o Second factor */ const aiVector3t SymMul(const aiVector3t& o); - TReal x, y, z; + union { + struct { + TReal x, y, z; + }; + TReal v[ 3 ]; + }; } PACK_STRUCT; @@ -134,8 +139,12 @@ typedef aiVector3t aiVector3D; #else struct aiVector3D { - - float x,y,z; + union { + struct { + float x, y, z; + }; + float v[ 3 ]; + }; } PACK_STRUCT; #endif // __cplusplus From 72d720ecfb677af3050571917e40cc08072fede8 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Tue, 2 Feb 2016 10:52:28 +0100 Subject: [PATCH 13/45] Doc: use markup format for android build instructions. --- port/AndroidJNI/README.txt | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/port/AndroidJNI/README.txt b/port/AndroidJNI/README.txt index 337772025..c9ce27b5b 100644 --- a/port/AndroidJNI/README.txt +++ b/port/AndroidJNI/README.txt @@ -1,11 +1,11 @@ ---- Description --- - -This module provides a facade to io stream access to files -behind android asset manager within Android native application. +Build Asset Importer Lib for Android +==================================== +This module provides a fascade for the io-stream-access to files behind the +android-asset-management within an Android native application. - It is built as a static library - It requires Android NDK with android API > 9 support. ---- Building --- +### Building ### To use this module please provide following cmake defines: @@ -14,14 +14,14 @@ To use this module please provide following cmake defines: "SOME_PATH" is a path to your cmake android toolchain script. ---- Code --- +### Code ### +A small example how to wrap assimp for Android: +```cpp #include -... - Assimp::Importer* importer = new Assimp::Importer(); Assimp::AndroidJNIIOSystem* ioSystem = new Assimp::AndroidJNIIOSystem(app->activity); importer->SetIOHandler(ioSystem); -... +``` From 7233aedac37f463bdf837f67ba3dc4a169c16ddd Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Tue, 2 Feb 2016 10:58:15 +0100 Subject: [PATCH 14/45] DOC: add link to ports in global readme. --- Readme.md | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/Readme.md b/Readme.md index 091e0a09b..55e7ce65c 100644 --- a/Readme.md +++ b/Readme.md @@ -1,6 +1,5 @@ Open Asset Import Library (assimp) -======== - +================================== Open Asset Import Library is a library to load various 3d file formats into a shared, in-memory format. It supports more than __40 file formats__ for import and a growing selection of file formats for export. APIs are provided for C and C++. There are various bindings to other languages (C#, Java, Python, Delphi, D). Assimp also runs on Android and iOS. @@ -80,14 +79,12 @@ __Exporters__: - glTF ### Building ### - - Take a look into the `INSTALL` file. Our build system is CMake, if you used CMake before there is a good chance you know what to do. +### Ports ### +* [Android](port/AndroidJNI/README.md) #### Repository structure #### - - Open Asset Import Library is implemented in C++. The directory structure is: /code Source code @@ -105,8 +102,6 @@ Open Asset Import Library is implemented in C++. The directory structure is: ### Where to get help ### - - For more information, visit [our website](http://assimp.sourceforge.net/). Or check out the `./doc`- folder, which contains the official documentation in HTML format. (CHMs for Windows are included in some release packages and should be located right here in the root folder). @@ -119,12 +114,10 @@ And we also have an IRC-channel at freenode: #assetimporterlib . You can easily > /join #assetimporterlib ### Contributing ### - Contributions to assimp are highly appreciated. The easiest way to get involved is to submit a pull request with your changes against the main repository's `master` branch. ### License ### - Our license is based on the modified, __3-clause BSD__-License. An _informal_ summary is: do whatever you want, but include Assimp's license text with your product - @@ -132,5 +125,4 @@ and don't sue us if our code doesn't work. Note that, unlike LGPLed code, you ma For the legal details, see the `LICENSE` file. ### Why this name ### - Sorry, we're germans :-), no english native speakers ... From 219bf32efe116ca788c34843c0d2f6a2318ffd8c Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Tue, 2 Feb 2016 10:59:07 +0100 Subject: [PATCH 15/45] Rename android renameRename android rename. --- port/AndroidJNI/{README.txt => README.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename port/AndroidJNI/{README.txt => README.md} (100%) diff --git a/port/AndroidJNI/README.txt b/port/AndroidJNI/README.md similarity index 100% rename from port/AndroidJNI/README.txt rename to port/AndroidJNI/README.md From b77228c7eadaef25b6ef06cc99f4f51f76cedfde Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Tue, 2 Feb 2016 11:00:28 +0100 Subject: [PATCH 16/45] Android build doc: reformatting. --- port/AndroidJNI/README.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/port/AndroidJNI/README.md b/port/AndroidJNI/README.md index c9ce27b5b..570ca4fb3 100644 --- a/port/AndroidJNI/README.md +++ b/port/AndroidJNI/README.md @@ -6,16 +6,15 @@ android-asset-management within an Android native application. - It requires Android NDK with android API > 9 support. ### Building ### - To use this module please provide following cmake defines: - +``` -DASSIMP_ANDROID_JNIIOSYSTEM=ON -DCMAKE_TOOLCHAIN_FILE=$SOME_PATH/android.toolchain.cmake +``` "SOME_PATH" is a path to your cmake android toolchain script. ### Code ### - A small example how to wrap assimp for Android: ```cpp #include @@ -23,5 +22,4 @@ A small example how to wrap assimp for Android: Assimp::Importer* importer = new Assimp::Importer(); Assimp::AndroidJNIIOSystem* ioSystem = new Assimp::AndroidJNIIOSystem(app->activity); importer->SetIOHandler(ioSystem); - ``` From d9f133edec16940f0caae872d01499d19ffe5ffe Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Tue, 2 Feb 2016 17:48:23 +0100 Subject: [PATCH 17/45] Doc: add missing ports to start README page. --- Readme.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Readme.md b/Readme.md index 55e7ce65c..0564e4eda 100644 --- a/Readme.md +++ b/Readme.md @@ -83,6 +83,9 @@ Take a look into the `INSTALL` file. Our build system is CMake, if you used CMak ### Ports ### * [Android](port/AndroidJNI/README.md) +* [Python](port/PyAssimp/README.md) +* [.NET](port/AssimpNET/Readme.md) +* [Pascal](port/AssimpPascal/Readme.md) #### Repository structure #### Open Asset Import Library is implemented in C++. The directory structure is: From 0e06404ec1fd1a5f3d45897e517d519ee5566544 Mon Sep 17 00:00:00 2001 From: Turo Lamminen Date: Tue, 2 Feb 2016 20:23:46 +0200 Subject: [PATCH 18/45] SIBImporter: Properly fix C++11 issues for Clang C-style cast has a higher precedence than & -operator so this was getting parsed differently than Kim assumed. Thou shalt not use C-style casts. --- code/SIBImporter.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/code/SIBImporter.cpp b/code/SIBImporter.cpp index 4a124a4ae..4bd145c60 100644 --- a/code/SIBImporter.cpp +++ b/code/SIBImporter.cpp @@ -164,10 +164,10 @@ static aiColor3D ReadColor(StreamReaderLE* stream) static void UnknownChunk(StreamReaderLE* stream, const SIBChunk& chunk) { char temp[5] = { - ( char ) ( chunk.Tag>>24 ) & 0xff, - ( char ) ( chunk.Tag>>16 ) & 0xff, - ( char ) ( chunk.Tag>>8 ) & 0xff, - ( char ) chunk.Tag & 0xff, '\0' + static_cast(( chunk.Tag>>24 ) & 0xff), + static_cast(( chunk.Tag>>16 ) & 0xff), + static_cast(( chunk.Tag>>8 ) & 0xff), + static_cast(chunk.Tag & 0xff), '\0' }; DefaultLogger::get()->warn((Formatter::format(), "SIB: Skipping unknown '",temp,"' chunk.")); From aff932cd9c51d9d43463eb0b9d5690a4c6bdaa3e Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Wed, 3 Feb 2016 20:19:59 +0100 Subject: [PATCH 19/45] Fix license date. --- port/AndroidJNI/AndroidJNIIOSystem.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/port/AndroidJNI/AndroidJNIIOSystem.cpp b/port/AndroidJNI/AndroidJNIIOSystem.cpp index f9ba94cb1..43bb9213d 100644 --- a/port/AndroidJNI/AndroidJNIIOSystem.cpp +++ b/port/AndroidJNI/AndroidJNIIOSystem.cpp @@ -3,12 +3,12 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2012, assimp team +Copyright (c) 2006-2016, assimp team All rights reserved. -Redistribution and use of this software in source and binary forms, -with or without modification, are permitted provided that the following +Redistribution and use of this software in source and binary forms, +with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above @@ -25,16 +25,16 @@ conditions are met: derived from this software without specific prior written permission of the assimp team. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------- */ @@ -59,14 +59,14 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. using namespace Assimp; // ------------------------------------------------------------------------------------------------ -// Constructor. +// Constructor. AndroidJNIIOSystem::AndroidJNIIOSystem(ANativeActivity* activity) { AndroidActivityInit(activity); } // ------------------------------------------------------------------------------------------------ -// Destructor. +// Destructor. AndroidJNIIOSystem::~AndroidJNIIOSystem() { // nothing to do here From 699aa9c5834acd65304ef77f6dfe3ae100bed2f1 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Wed, 3 Feb 2016 21:09:20 +0100 Subject: [PATCH 20/45] Closes https://github.com/assimp/assimp/issues/754: use correct index token. --- code/FBXMeshGeometry.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/code/FBXMeshGeometry.cpp b/code/FBXMeshGeometry.cpp index d482ab833..28ce924cb 100644 --- a/code/FBXMeshGeometry.cpp +++ b/code/FBXMeshGeometry.cpp @@ -471,32 +471,38 @@ void MeshGeometry::ReadVertexDataColors(std::vector& colors_out, cons mappings); } - // ------------------------------------------------------------------------------------------------ +static const std::string TangentIndexToken = "TangentIndex"; +static const std::string TangentsIndexToken = "TangentsIndex"; + void MeshGeometry::ReadVertexDataTangents(std::vector& tangents_out, const Scope& source, const std::string& MappingInformationType, const std::string& ReferenceInformationType) { const char * str = source.Elements().count( "Tangents" ) > 0 ? "Tangents" : "Tangent"; + const char * strIdx = source.Elements().count( "Tangents" ) > 0 ? TangentsIndexToken.c_str() : TangentIndexToken.c_str(); ResolveVertexDataArray(tangents_out,source,MappingInformationType,ReferenceInformationType, str, - "TangentIndex", + strIdx, vertices.size(), mapping_counts, mapping_offsets, mappings); } - // ------------------------------------------------------------------------------------------------ +static const std::string BinormalIndexToken = "BinormalIndex"; +static const std::string BinormalsIndexToken = "BinormalsIndex"; + void MeshGeometry::ReadVertexDataBinormals(std::vector& binormals_out, const Scope& source, const std::string& MappingInformationType, const std::string& ReferenceInformationType) { const char * str = source.Elements().count( "Binormals" ) > 0 ? "Binormals" : "Binormal"; + const char * strIdx = source.Elements().count( "Binormals" ) > 0 ? BinormalsIndexToken.c_str() : BinormalIndexToken.c_str(); ResolveVertexDataArray(binormals_out,source,MappingInformationType,ReferenceInformationType, str, - "BinormalIndex", + strIdx, vertices.size(), mapping_counts, mapping_offsets, From a74b321ed181b72ce5b07eab2c5b5f3824c58a3f Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Thu, 4 Feb 2016 20:43:02 +0100 Subject: [PATCH 21/45] Add unittests for defect reproduction. --- code/Assimp.cpp | 8 +++- test/CMakeLists.txt | 1 + test/unit/utIssues.cpp | 105 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 113 insertions(+), 1 deletion(-) create mode 100644 test/unit/utIssues.cpp diff --git a/code/Assimp.cpp b/code/Assimp.cpp index b8252be99..d46ebe537 100644 --- a/code/Assimp.cpp +++ b/code/Assimp.cpp @@ -429,12 +429,18 @@ ASSIMP_API void aiDetachAllLogStreams(void) #ifndef ASSIMP_BUILD_SINGLETHREADED boost::mutex::scoped_lock lock(gLogStreamMutex); #endif + Logger *logger( DefaultLogger::get() ); + if ( NULL == logger ) { + return; + } + for (LogStreamMap::iterator it = gActiveLogStreams.begin(); it != gActiveLogStreams.end(); ++it) { - DefaultLogger::get()->detatchStream( it->second ); + logger->detatchStream( it->second ); delete it->second; } gActiveLogStreams.clear(); DefaultLogger::kill(); + ASSIMP_END_EXCEPTION_REGION(void); } diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index cbb1f7c77..956aae8e0 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -44,6 +44,7 @@ SET( TEST_SRCS unit/utNoBoostTest.cpp unit/utColladaExportCamera.cpp unit/utColladaExportLight.cpp + unit/utIssues.cpp ) SOURCE_GROUP( tests FILES ${TEST_SRCS} ) diff --git a/test/unit/utIssues.cpp b/test/unit/utIssues.cpp new file mode 100644 index 000000000..b59532918 --- /dev/null +++ b/test/unit/utIssues.cpp @@ -0,0 +1,105 @@ +/* +--------------------------------------------------------------------------- +Open Asset Import Library (assimp) +--------------------------------------------------------------------------- + +Copyright (c) 2006-2014, assimp team + +All rights reserved. + +Redistribution and use of this software in source and binary forms, +with or without modification, are permitted provided that the following +conditions are met: + +* Redistributions of source code must retain the above +copyright notice, this list of conditions and the +following disclaimer. + +* Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the +following disclaimer in the documentation and/or other +materials provided with the distribution. + +* Neither the name of the assimp team, nor the names of its +contributors may be used to endorse or promote products +derived from this software without specific prior +written permission of the assimp team. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +--------------------------------------------------------------------------- +*/ +#include "UnitTestPCH.h" + +#include +#include +#include + +using namespace Assimp; + +class utIssues : public ::testing::Test { + +}; + +TEST_F( utIssues, OpacityBugWhenExporting_727 ) { + aiScene *scene( new aiScene ); + + scene->mNumMaterials = 1; + scene->mMaterials = new aiMaterial*; + scene->mMaterials[ 0 ] = new aiMaterial; + aiColor3D color( 1, 0, 0 ); + EXPECT_EQ( AI_SUCCESS, scene->mMaterials[ 0 ]->AddProperty( &color, 1, AI_MATKEY_COLOR_DIFFUSE ) ); + + ::srand( static_cast( ::time( NULL ) ) ); + float opacity( float( rand() ) / float( RAND_MAX ) ); + EXPECT_EQ( AI_SUCCESS, scene->mMaterials[ 0 ]->AddProperty( &opacity, 1, AI_MATKEY_OPACITY ) ); + + scene->mNumMeshes = 1; + scene->mMeshes = new aiMesh*; + scene->mMeshes[ 0 ] = new aiMesh; + scene->mMeshes[ 0 ]->mMaterialIndex = 0; + scene->mMeshes[ 0 ]->mPrimitiveTypes = aiPrimitiveType_TRIANGLE; + scene->mMeshes[ 0 ]->mNumVertices = 3; + scene->mMeshes[ 0 ]->mVertices = new aiVector3D[ 3 ]; + scene->mMeshes[ 0 ]->mVertices[ 0 ] = aiVector3D( 1, 0, 0 ); + scene->mMeshes[ 0 ]->mVertices[ 1 ] = aiVector3D( 0, 1, 0 ); + scene->mMeshes[ 0 ]->mVertices[ 2 ] = aiVector3D( 0, 0, 1 ); + scene->mMeshes[ 0 ]->mNumFaces = 1; + scene->mMeshes[ 0 ]->mFaces = new aiFace; + scene->mMeshes[ 0 ]->mFaces[ 0 ].mNumIndices = 3; + scene->mMeshes[ 0 ]->mFaces[ 0 ].mIndices = new unsigned int[ 3 ]; + scene->mMeshes[ 0 ]->mFaces[ 0 ].mIndices[ 0 ] = 0; + scene->mMeshes[ 0 ]->mFaces[ 0 ].mIndices[ 1 ] = 1; + scene->mMeshes[ 0 ]->mFaces[ 0 ].mIndices[ 2 ] = 2; + + scene->mRootNode = new aiNode; + scene->mRootNode->mNumMeshes = 1; + scene->mRootNode->mMeshes = new unsigned int( 0 ); + + Assimp::Importer importer; + Assimp::Exporter exporter; + for ( std::size_t i( 0 ); i < exporter.GetExportFormatCount(); ++i ) { + /*const aiExportFormatDesc *desc( exporter.GetExportFormatDescription( i ) ); + std::cout << "[" << desc->id << "] "; + std::string path( "scene." ); + path.append( desc->fileExtension ); + + ASSERT_EQ( AI_SUCCESS, exporter.Export( scene, desc->id, path ) ); + const aiScene *newScene( importer.ReadFile( path, 0 ) ); + ASSERT_TRUE( NULL != newScene ); + float newOpacity; + if ( newScene->mNumMaterials > 0 ) { + //ASSERT_EQ( AI_SUCCESS, newScene->mMaterials[ 0 ]->Get( AI_MATKEY_OPACITY, newOpacity ) ); + //EXPECT_EQ( opacity, newOpacity ); + }*/ + } +} From 982d597acf3a8ae8ed6da21e83d930b547d2893a Mon Sep 17 00:00:00 2001 From: Sergei Nikulov Date: Fri, 5 Feb 2016 13:11:40 +0300 Subject: [PATCH 22/45] updated gtest to github --- cmake-modules/AddGTest.cmake | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/cmake-modules/AddGTest.cmake b/cmake-modules/AddGTest.cmake index 4f4bf70c6..275587600 100644 --- a/cmake-modules/AddGTest.cmake +++ b/cmake-modules/AddGTest.cmake @@ -21,7 +21,8 @@ endif() set(GTEST_CMAKE_ARGS "-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}" "-Dgtest_force_shared_crt=ON" - "-Dgtest_disable_pthreads:BOOL=${DISABLE_PTHREADS}") + "-Dgtest_disable_pthreads:BOOL=${DISABLE_PTHREADS}" + "-DBUILD_GTEST=ON") set(GTEST_RELEASE_LIB_DIR "") set(GTEST_DEBUGLIB_DIR "") if (MSVC) @@ -41,7 +42,7 @@ else(NOT GIT_FOUND) set(AddGTest_FOUND true CACHE BOOL "Was gtest setup correctly?") ExternalProject_Add(gtest - GIT_REPOSITORY https://chromium.googlesource.com/external/googletest + GIT_REPOSITORY https://github.com/google/googletest.git TIMEOUT 10 PREFIX "${GTEST_PREFIX}" CMAKE_ARGS "${GTEST_CMAKE_ARGS}" @@ -56,10 +57,10 @@ else(NOT GIT_FOUND) set(LIB_SUFFIX "${CMAKE_STATIC_LIBRARY_SUFFIX}") set(GTEST_LOCATION "${GTEST_PREFIX}/src/gtest-build") set(GTEST_DEBUG_LIBRARIES - "${GTEST_LOCATION}/${DEBUG_LIB_DIR}/${LIB_PREFIX}gtest${LIB_SUFFIX}" + "${LIB_PREFIX}gtest${LIB_SUFFIX}" "${CMAKE_THREAD_LIBS_INIT}") SET(GTEST_RELEASE_LIBRARIES - "${GTEST_LOCATION}/${RELEASE_LIB_DIR}/${LIB_PREFIX}gtest${LIB_SUFFIX}" + "${LIB_PREFIX}gtest${LIB_SUFFIX}" "${CMAKE_THREAD_LIBS_INIT}") if(MSVC_VERSION EQUAL 1700) @@ -67,9 +68,11 @@ else(NOT GIT_FOUND) endif() ExternalProject_Get_Property(gtest source_dir) - include_directories(${source_dir}/include) + include_directories(${source_dir}/googletest/include) include_directories(${source_dir}/gtest/include) ExternalProject_Get_Property(gtest binary_dir) - link_directories(${binary_dir}) + link_directories(${binary_dir}/googlemock/gtest) + link_directories(${binary_dir}/googlemock/gtest/${RELEASE_LIB_DIR}) + link_directories(${binary_dir}/googlemock/gtest/${DEBUG_LIB_DIR}) endif(NOT GIT_FOUND) From 51c9a9f80cb01711126485507deeeea2916da0f8 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Fri, 5 Feb 2016 18:31:19 +0100 Subject: [PATCH 23/45] Unittests: add test if export is disabled. --- test/CMakeLists.txt | 26 +++++++++++++------------- test/unit/utIssues.cpp | 6 +++++- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 956aae8e0..f30172a30 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -50,21 +50,21 @@ SET( TEST_SRCS SOURCE_GROUP( tests FILES ${TEST_SRCS} ) if(AddGTest_FOUND) -add_executable( unit - unit/CCompilerTest.c - unit/Main.cpp - ../code/Version.cpp - ${TEST_SRCS} -) + add_executable( unit + unit/CCompilerTest.c + unit/Main.cpp + ../code/Version.cpp + ${TEST_SRCS} + ) -add_definitions(-DASSIMP_TEST_MODELS_DIR="${CMAKE_CURRENT_LIST_DIR}/models") + add_definitions(-DASSIMP_TEST_MODELS_DIR="${CMAKE_CURRENT_LIST_DIR}/models") -SET_PROPERTY( TARGET assimp PROPERTY DEBUG_POSTFIX ${CMAKE_DEBUG_POSTFIX} ) + SET_PROPERTY( TARGET assimp PROPERTY DEBUG_POSTFIX ${CMAKE_DEBUG_POSTFIX} ) -add_dependencies( unit gtest ) -target_link_libraries( unit assimp - debug ${GTEST_DEBUG_LIBRARIES} - optimized ${GTEST_RELEASE_LIBRARIES} -) + add_dependencies( unit gtest ) + target_link_libraries( unit assimp + debug ${GTEST_DEBUG_LIBRARIES} + optimized ${GTEST_RELEASE_LIBRARIES} + ) endif(AddGTest_FOUND) add_subdirectory(headercheck) diff --git a/test/unit/utIssues.cpp b/test/unit/utIssues.cpp index b59532918..7346009ba 100644 --- a/test/unit/utIssues.cpp +++ b/test/unit/utIssues.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2014, assimp team +Copyright (c) 2006-2016, assimp team All rights reserved. @@ -50,6 +50,8 @@ class utIssues : public ::testing::Test { }; +#ifndef ASSIMP_BUILD_NO_EXPORT + TEST_F( utIssues, OpacityBugWhenExporting_727 ) { aiScene *scene( new aiScene ); @@ -103,3 +105,5 @@ TEST_F( utIssues, OpacityBugWhenExporting_727 ) { }*/ } } + +#endif // ASSIMP_BUILD_NO_EXPORT From dfbae1294fa568145ccb7ebafa4f88b99e039ed9 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Fri, 5 Feb 2016 18:53:23 +0100 Subject: [PATCH 24/45] JoinVerticesProcess: iAdd test for possible null pointer access. --- code/JoinVerticesProcess.cpp | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/code/JoinVerticesProcess.cpp b/code/JoinVerticesProcess.cpp index 4952a27b3..7874d97e7 100644 --- a/code/JoinVerticesProcess.cpp +++ b/code/JoinVerticesProcess.cpp @@ -357,23 +357,24 @@ int JoinVerticesProcess::ProcessMesh( aiMesh* pMesh, unsigned int meshIndex) } // adjust bone vertex weights. - for( int a = 0; a < (int)pMesh->mNumBones; a++) - { + for( int a = 0; a < (int)pMesh->mNumBones; a++) { aiBone* bone = pMesh->mBones[a]; std::vector newWeights; newWeights.reserve( bone->mNumWeights); - for( unsigned int b = 0; b < bone->mNumWeights; b++) - { - const aiVertexWeight& ow = bone->mWeights[b]; - // if the vertex is a unique one, translate it - if( !(replaceIndex[ow.mVertexId] & 0x80000000)) - { - aiVertexWeight nw; - nw.mVertexId = replaceIndex[ow.mVertexId]; - nw.mWeight = ow.mWeight; - newWeights.push_back( nw); + if ( NULL != bone->mWeights ) { + for ( unsigned int b = 0; b < bone->mNumWeights; b++ ) { + const aiVertexWeight& ow = bone->mWeights[ b ]; + // if the vertex is a unique one, translate it + if ( !( replaceIndex[ ow.mVertexId ] & 0x80000000 ) ) { + aiVertexWeight nw; + nw.mVertexId = replaceIndex[ ow.mVertexId ]; + nw.mWeight = ow.mWeight; + newWeights.push_back( nw ); + } } + } else { + DefaultLogger::get()->error( "X-Export: aiBone shall contain weights, but pointer to them is NULL." ); } if (newWeights.size() > 0) { From 7961c22c55522650255056a0afb9efe22214ffe1 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Sat, 6 Feb 2016 20:54:47 +0100 Subject: [PATCH 25/45] Closes https://github.com/assimp/assimp/issues/787: Update CHANGES. --- CHANGES | 42 ++++++++++++++++++++++++++++++------------ 1 file changed, 30 insertions(+), 12 deletions(-) diff --git a/CHANGES b/CHANGES index b26103bf2..0ff79cbe1 100644 --- a/CHANGES +++ b/CHANGES @@ -2,6 +2,24 @@ CHANGELOG ---------------------------------------------------------------------- +3.2.0 (2015-11-03) + +FEATURES: + - OpenDDL-Parser is part of contrib-source. + - Experimental OpenGEX-support + - CI-check for linux and windows + - Coverity check added + - New regression testsuite. + +FIXES/HOUSEKEEPING: + - Hundreds of bugfixes in all parts of the library + - Unified line endings + + +API COMPATIBILITY: + - Removed precompiled header to increase build speed for linux + + 3.1.1 (2014-06-15) FEATURES: @@ -18,18 +36,18 @@ FEATURES: FIXES/HOUSEKEEPING: - Hundreds of bugfixes in all parts of the library - CMake is now the primary build system - + API COMPATIBILITY: - 3.1.1 is not binary compatible to 3.0 due to aiNode::mMetaData and aiMesh::mName - Export interface has been cleaned up and unified - Other than that no relevant changes - + 3.0 (2012-07-07) FEATURES: - - new export interface similar to the import API. + - new export interface similar to the import API. - Supported export formats: Collada, OBJ, PLY and STL - added new import formats: XGL/ZGL, M3 (experimental) - new postprocessing steps: Debone @@ -46,11 +64,11 @@ FIXES/HOUSEKEEPING: - improved CMake build system - templatized math library - reduce dependency on boost.thread, only remaining spot - is synchronization for the C logging API + is synchronization for the C logging API API COMPATIBILITY: - renamed headers, export interface, C API properties and meta data - prevent compatibility with code written for 2.0, but in + prevent compatibility with code written for 2.0, but in most cases these can be easily resolved - Note: 3.0 is not binary compatible with 2.0 @@ -68,9 +86,9 @@ FEATURES: spatial structure) in some expensive postprocessing steps - AssimpView now uses a reworked layout which leaves more space to the scene hierarchy window - + - Add C# bindings ('Assimp.NET') - - Keep BSD-licensed and otherwise free test files in separate + - Keep BSD-licensed and otherwise free test files in separate folders (./test/models and ./test/models-nonbsd). FIXES: @@ -80,20 +98,20 @@ FIXES: - OpenGL-sample now works with MinGW - Fix Importer::FindLoader failing on uppercase file extensions - Fix flawed path handling when locating external files - - Limit the maximum number of vertices, faces, face indices and + - Limit the maximum number of vertices, faces, face indices and weights that Assimp is able to handle. This is to avoid crashes due to overflowing counters. - + - Updated XCode project files - Further CMAKE build improvements - + API CHANGES: - Add data structures for vertex-based animations (These are not currently used, however ...) - Some Assimp::Importer methods are const now. - - + + From 522f4e08827945e46c255744fd77437b66b6ebb4 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Sun, 7 Feb 2016 17:58:28 +0100 Subject: [PATCH 26/45] Closes https://github.com/assimp/assimp/issues/786: - fix invalid value get for index data. - update OpenDDL-library --- code/OpenGEXExporter.cpp | 2 +- code/OpenGEXExporter.h | 2 +- code/OpenGEXImporter.cpp | 21 ++- code/OpenGEXImporter.h | 2 +- code/OpenGEXStructs.h | 2 +- contrib/openddlparser/README.md | 55 +++++-- contrib/openddlparser/code/DDLNode.cpp | 2 +- contrib/openddlparser/code/OpenDDLCommon.cpp | 53 +++---- contrib/openddlparser/code/OpenDDLExport.cpp | 2 +- contrib/openddlparser/code/OpenDDLParser.cpp | 141 +++++++++--------- contrib/openddlparser/code/Value.cpp | 136 ++++++++++------- .../include/openddlparser/DDLNode.h | 4 +- .../include/openddlparser/OpenDDLCommon.h | 42 ++---- .../include/openddlparser/OpenDDLExport.h | 4 + .../include/openddlparser/OpenDDLParser.h | 13 +- .../openddlparser/OpenDDLParserUtils.h | 9 +- .../include/openddlparser/Value.h | 18 ++- 17 files changed, 280 insertions(+), 228 deletions(-) diff --git a/code/OpenGEXExporter.cpp b/code/OpenGEXExporter.cpp index b3b7cec97..77a60fdfb 100644 --- a/code/OpenGEXExporter.cpp +++ b/code/OpenGEXExporter.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2014, assimp team +Copyright (c) 2006-2016, assimp team All rights reserved. Redistribution and use of this software in source and binary forms, diff --git a/code/OpenGEXExporter.h b/code/OpenGEXExporter.h index 787f4b335..ac9d9c860 100644 --- a/code/OpenGEXExporter.h +++ b/code/OpenGEXExporter.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2014, assimp team +Copyright (c) 2006-2016, assimp team All rights reserved. Redistribution and use of this software in source and binary forms, diff --git a/code/OpenGEXImporter.cpp b/code/OpenGEXImporter.cpp index f63fbebfd..0a6d510fc 100644 --- a/code/OpenGEXImporter.cpp +++ b/code/OpenGEXImporter.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2014, assimp team +Copyright (c) 2006-2016, assimp team All rights reserved. Redistribution and use of this software in source and binary forms, @@ -225,6 +225,7 @@ OpenGEXImporter::OpenGEXImporter() , m_tokenType( Grammar::NoneType ) , m_nodeStack() , m_unresolvedRefStack() { + // empty } //------------------------------------------------------------------------------------------------ @@ -423,7 +424,7 @@ static void getRefNames( DDLNode *node, std::vector &names ) { for( size_t i = 0; i < ref->m_numRefs; i++ ) { Name *currentName( ref->m_referencedName[ i ] ); if( NULL != currentName && NULL != currentName->m_id ) { - const std::string name( currentName->m_id->m_text.m_buffer ); + const std::string name( currentName->m_id->m_buffer ); if( !name.empty() ) { names.push_back( name ); } @@ -541,7 +542,7 @@ static void propId2StdString( Property *prop, std::string &name, std::string &ke } if( NULL != prop->m_key ) { - name = prop->m_key->m_text.m_buffer; + name = prop->m_key->m_buffer; if( Value::ddl_string == prop->m_value->m_type ) { key = prop->m_value->getString(); } @@ -714,7 +715,7 @@ void OpenGEXImporter::handleIndexArrayNode( ODDLParser::DDLNode *node, aiScene * current.mIndices = new unsigned int[ current.mNumIndices ]; Value *next( vaList->m_dataList ); for( size_t indices = 0; indices < current.mNumIndices; indices++ ) { - const int idx = next->getInt32(); + const int idx( next->getUnsignedInt32() ); ai_assert( static_cast( idx ) <= m_currentVertices.m_numVerts ); aiVector3D &pos = ( m_currentVertices.m_vertices[ idx ] ); @@ -758,12 +759,16 @@ enum ColorType { }; //------------------------------------------------------------------------------------------------ -static ColorType getColorType( Identifier *id ) { - if( id->m_text == Grammar::DiffuseColorToken ) { +static ColorType getColorType( Text *id ) { + if ( NULL == id ) { + return NoneColor; + } + + if( *id == Grammar::DiffuseColorToken ) { return DiffuseColor; - } else if( id->m_text == Grammar::SpecularColorToken ) { + } else if( *id == Grammar::SpecularColorToken ) { return SpecularColor; - } else if( id->m_text == Grammar::EmissionColorToken ) { + } else if( *id == Grammar::EmissionColorToken ) { return EmissionColor; } diff --git a/code/OpenGEXImporter.h b/code/OpenGEXImporter.h index d187c4ac4..bcb87b7e0 100644 --- a/code/OpenGEXImporter.h +++ b/code/OpenGEXImporter.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2014, assimp team +Copyright (c) 2006-2016, assimp team All rights reserved. Redistribution and use of this software in source and binary forms, diff --git a/code/OpenGEXStructs.h b/code/OpenGEXStructs.h index 62520df20..837597975 100644 --- a/code/OpenGEXStructs.h +++ b/code/OpenGEXStructs.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2014, assimp team +Copyright (c) 2006-2016, assimp team All rights reserved. Redistribution and use of this software in source and binary forms, diff --git a/contrib/openddlparser/README.md b/contrib/openddlparser/README.md index 195de6932..619747d23 100644 --- a/contrib/openddlparser/README.md +++ b/contrib/openddlparser/README.md @@ -1,29 +1,39 @@ The OpenDDL-Parser ================== -A simple and fast OpenDDL Parser -Current build status: [![Build Status](https://travis-ci.org/kimkulling/openddl-parser.png)](https://travis-ci.org/kimkulling/openddl-parser) +The OpenDDL-Parser is a small and easy to use library for OpenDDL-file-format-parsing. OpenDDL is the shortcut for Open Data Description Language, a data-declaration language introduced by Eric Lengyel. Please check http://openddl.org/ if you want to learn more about it. + +Build status +============ +Linux build status: [![Build Status](https://travis-ci.org/kimkulling/openddl-parser.png)](https://travis-ci.org/kimkulling/openddl-parser) +Current coverity check status: + + Coverity Scan Build Status + Get the source code =================== -You can get the code from our git repository, which is located at GitHub. You can clone the repository like: +You can get the code from our git repository, which is located at GitHub. You can clone the repository with the following command: > git clone https://github.com/kimkulling/openddl-parser.git -Build from repo -=============== -To build the library you need to install cmake first ( see http://www.cmake.org/ for more information ). Make also sure that a compiler toolchain is installed on your machine. -After installing it you can open a console and type: +Building the source from the GitHub-Repo +======================================== +To build the library you need to install cmake first ( see http://www.cmake.org/ for more information ). Make also sure that a compiler tool-chain is installed on your machine. +After installing it you can open a console and enter: > cmake CMakeLists.txt -This command will generate a build environment for your installed build enrironment ( for Visual Studio the project files will be generated, for gcc the makefiles will be generated ). +This command will generate a build environment for your installed build enrironment ( for Visual-Studio-users the project files will be generated, for gcc-users the makefiles will be generated ). When using an IDE open the IDE and run the build. When using GNU-make type in your console: > make and that's all. +When using Visual Studio CMake will generate you a solution for ythe library. Just build it there. + Use the library =============== To use the OpenDDL-parser you need to build the lib first. Now add the @@ -88,24 +98,39 @@ int main( int argc, char *argv[] ) { How to access the imported data =============================== -The data is organized as a tree. You can get the root tree with the following code: +The data is organized as a tree. You can get the root-node of the tree with the following code: -``` +```cpp OpenDDLParser theParser; theParser.setBuffer( buffer, size ); const bool result( theParser.parse() ); if ( result ) { DDLNode *root = theParser.getRoot(); - DDLNode::DllNodeList childs = root->getChildNodeList(); for ( size_t i=0; igetProperty(); // to get properties - std:.string type = child->getType(); // to get the node type - Value *values = child->getValue(); // to get the data; + Property *prop = child->getProperty(); // to get properties + std::string type = child->getType(); // to get the node type + Value *values = child->getValue(); // to get the data; + + // to loop through all values + while ( values != ddl_nullptr ) { + int current = values->getInt32(); + values = value->getNext(); + } } } ``` -The instance called root contains the data. +The node instance called root contains the data. + +All data lists are organized as linked lists. + +Reference documentation +======================= +Please check http://kimkulling.github.io/openddl-parser/doxygen_html/index.html. + +Projects using OpenDDL-Parser +============================= +- Asset Importer Lib: https://github.com/assimp/assimp . diff --git a/contrib/openddlparser/code/DDLNode.cpp b/contrib/openddlparser/code/DDLNode.cpp index e39634cdc..0cc95bdfc 100644 --- a/contrib/openddlparser/code/DDLNode.cpp +++ b/contrib/openddlparser/code/DDLNode.cpp @@ -153,7 +153,7 @@ Property *DDLNode::findPropertyByName( const std::string &name ) { Property *current( m_properties ); while( ddl_nullptr != current ) { - int res = strncmp( current->m_key->m_text.m_buffer, name.c_str(), name.size() ); + int res = strncmp( current->m_key->m_buffer, name.c_str(), name.size() ); if( 0 == res ) { return current; } diff --git a/contrib/openddlparser/code/OpenDDLCommon.cpp b/contrib/openddlparser/code/OpenDDLCommon.cpp index 27a264541..c0a2b0318 100644 --- a/contrib/openddlparser/code/OpenDDLCommon.cpp +++ b/contrib/openddlparser/code/OpenDDLCommon.cpp @@ -73,31 +73,14 @@ bool Text::operator == ( const Text &rhs ) const { return ( 0 == res ); } -Identifier::Identifier( const char buffer[], size_t len ) -: m_text( buffer, len ) { - // empty -} - -Identifier::Identifier( const char buffer[] ) -: m_text( buffer, strlen( buffer ) ) { - // empty -} - -Identifier::~Identifier() { - // empty -} - -bool Identifier::operator == ( const Identifier &rhs ) const { - return m_text == rhs.m_text; -} - -Name::Name( NameType type, Identifier *id ) +Name::Name( NameType type, Text *id ) : m_type( type ) , m_id( id ) { // empty } Name::~Name() { + delete m_id; m_id = ddl_nullptr; } @@ -110,10 +93,12 @@ Reference::Reference() Reference::Reference( size_t numrefs, Name **names ) : m_numRefs( numrefs ) , m_referencedName( ddl_nullptr ) { - m_referencedName = new Name *[ numrefs ]; - for( size_t i = 0; i < numrefs; i++ ) { - Name *name = new Name( names[ i ]->m_type, names[ i ]->m_id ); - m_referencedName[ i ] = name; + if ( numrefs > 0 ) { + m_referencedName = new Name *[ numrefs ]; + for ( size_t i = 0; i < numrefs; i++ ) { + Name *name = new Name( names[ i ]->m_type, names[ i ]->m_id ); + m_referencedName[ i ] = name; + } } } @@ -125,7 +110,23 @@ Reference::~Reference() { m_referencedName = ddl_nullptr; } -Property::Property( Identifier *id ) +size_t Reference::sizeInBytes() { + if ( 0 == m_numRefs ) { + return 0; + } + + size_t size( 0 ); + for ( size_t i = 0; i < m_numRefs; i++ ) { + Name *name( m_referencedName[ i ] ); + if ( ddl_nullptr != name ) { + size += name->m_id->m_len; + } + } + + return size; +} + +Property::Property( Text *id ) : m_key( id ) , m_value( ddl_nullptr ) , m_ref( ddl_nullptr ) @@ -152,7 +153,7 @@ DataArrayList::~DataArrayList() { } size_t DataArrayList::size() { - size_t result=1; + size_t result( 0 ); DataArrayList *n=m_next; while( n!=ddl_nullptr ) { result++; @@ -167,7 +168,7 @@ Context::Context() } Context::~Context() { - m_root = ddl_nullptr; + clear(); } void Context::clear() { diff --git a/contrib/openddlparser/code/OpenDDLExport.cpp b/contrib/openddlparser/code/OpenDDLExport.cpp index 212bfa66a..43e3bcb02 100644 --- a/contrib/openddlparser/code/OpenDDLExport.cpp +++ b/contrib/openddlparser/code/OpenDDLExport.cpp @@ -256,7 +256,7 @@ bool OpenDDLExport::writeProperties( DDLNode *node, std::string &statement ) { } else { first = false; } - statement += std::string( prop->m_key->m_text.m_buffer ); + statement += std::string( prop->m_key->m_buffer ); statement += " = "; writeValue( prop->m_value, statement ); prop = prop->m_next; diff --git a/contrib/openddlparser/code/OpenDDLParser.cpp b/contrib/openddlparser/code/OpenDDLParser.cpp index 7b86b70f0..921f67aa4 100644 --- a/contrib/openddlparser/code/OpenDDLParser.cpp +++ b/contrib/openddlparser/code/OpenDDLParser.cpp @@ -97,12 +97,12 @@ static bool isUnsignedIntegerType( Value::ValueType integerType ) { return true; } -static DDLNode *createDDLNode( Identifier *id, OpenDDLParser *parser ) { +static DDLNode *createDDLNode( Text *id, OpenDDLParser *parser ) { if( ddl_nullptr == id || ddl_nullptr == parser ) { return ddl_nullptr; } - const std::string type( id->m_text.m_buffer ); + const std::string type( id->m_buffer ); DDLNode *parent( parser->top() ); DDLNode *node = DDLNode::create( type, "", parent ); @@ -135,7 +135,7 @@ OpenDDLParser::OpenDDLParser() // empty } -OpenDDLParser::OpenDDLParser( char *buffer, size_t len ) +OpenDDLParser::OpenDDLParser( const char *buffer, size_t len ) : m_logCallback( &logMessage ) , m_buffer() , m_context( ddl_nullptr ) { @@ -162,7 +162,7 @@ OpenDDLParser::logCallback OpenDDLParser::getLogCallback() const { return m_logCallback; } -void OpenDDLParser::setBuffer( char *buffer, size_t len ) { +void OpenDDLParser::setBuffer( const char *buffer, size_t len ) { clear(); if( 0 == len ) { return; @@ -192,7 +192,7 @@ size_t OpenDDLParser::getBufferSize() const { void OpenDDLParser::clear() { m_buffer.resize( 0 ); - if( m_context ) { + if( ddl_nullptr != m_context ) { m_context->m_root = ddl_nullptr; } @@ -255,7 +255,7 @@ char *OpenDDLParser::parseHeader( char *in, char *end ) { return in; } - Identifier *id( ddl_nullptr ); + Text *id( ddl_nullptr ); in = OpenDDLParser::parseIdentifier( in, end, &id ); #ifdef DEBUG_HEADER_NAME @@ -263,33 +263,7 @@ char *OpenDDLParser::parseHeader( char *in, char *end ) { #endif // DEBUG_HEADER_NAME in = lookForNextToken( in, end ); - Property *first( ddl_nullptr ); if( ddl_nullptr != id ) { - if( *in == Grammar::OpenPropertyToken[ 0 ] ) { - in++; - Property *prop( ddl_nullptr ), *prev( ddl_nullptr ); - while( *in != Grammar::ClosePropertyToken[ 0 ] && in != end ) { - in = OpenDDLParser::parseProperty( in, end, &prop ); - in = lookForNextToken( in, end ); - - if( *in != Grammar::CommaSeparator[ 0 ] && *in != Grammar::ClosePropertyToken[ 0 ] ) { - logInvalidTokenError( in, Grammar::ClosePropertyToken, m_logCallback ); - return ddl_nullptr; - } - - if( ddl_nullptr != prop && *in != Grammar::CommaSeparator[ 0 ] ) { - if( ddl_nullptr == first ) { - first = prop; - } - if( ddl_nullptr != prev ) { - prev->m_next = prop; - } - prev = prop; - } - } - in++; - } - // store the node DDLNode *node( createDDLNode( id, this ) ); if( ddl_nullptr != node ) { @@ -298,17 +272,44 @@ char *OpenDDLParser::parseHeader( char *in, char *end ) { std::cerr << "nullptr returned by creating DDLNode." << std::endl; } - // set the properties - if( ddl_nullptr != first && ddl_nullptr != node ) { - node->setProperties( first ); - } - - Name *name( ddl_nullptr ); - in = OpenDDLParser::parseName( in, end, &name ); + Name *name(ddl_nullptr); + in = OpenDDLParser::parseName(in, end, &name); if( ddl_nullptr != name && ddl_nullptr != node ) { - const std::string nodeName( name->m_id->m_text.m_buffer ); + const std::string nodeName( name->m_id->m_buffer ); node->setName( nodeName ); } + + Property *first(ddl_nullptr); + in = lookForNextToken(in, end); + if (*in == Grammar::OpenPropertyToken[0]) { + in++; + Property *prop(ddl_nullptr), *prev(ddl_nullptr); + while (*in != Grammar::ClosePropertyToken[0] && in != end) { + in = OpenDDLParser::parseProperty(in, end, &prop); + in = lookForNextToken(in, end); + + if (*in != Grammar::CommaSeparator[0] && *in != Grammar::ClosePropertyToken[0]) { + logInvalidTokenError(in, Grammar::ClosePropertyToken, m_logCallback); + return ddl_nullptr; + } + + if (ddl_nullptr != prop && *in != Grammar::CommaSeparator[0]) { + if (ddl_nullptr == first) { + first = prop; + } + if (ddl_nullptr != prev) { + prev->m_next = prop; + } + prev = prop; + } + } + in++; + } + + // set the properties + if (ddl_nullptr != first && ddl_nullptr != node) { + node->setProperties(first); + } } return in; @@ -499,7 +500,7 @@ char *OpenDDLParser::parseName( char *in, char *end, Name **name ) { } in++; Name *currentName( ddl_nullptr ); - Identifier *id( ddl_nullptr ); + Text *id( ddl_nullptr ); in = parseIdentifier( in, end, &id ); if( id ) { currentName = new Name( ntype, id ); @@ -511,7 +512,7 @@ char *OpenDDLParser::parseName( char *in, char *end, Name **name ) { return in; } -char *OpenDDLParser::parseIdentifier( char *in, char *end, Identifier **id ) { +char *OpenDDLParser::parseIdentifier( char *in, char *end, Text **id ) { *id = ddl_nullptr; if( ddl_nullptr == in || in == end ) { return in; @@ -534,7 +535,7 @@ char *OpenDDLParser::parseIdentifier( char *in, char *end, Identifier **id ) { } const size_t len( idLen ); - Identifier *newId = new Identifier( start, len ); + Text *newId = new Text( start, len ); *id = newId; return in; @@ -715,6 +716,11 @@ char *OpenDDLParser::parseFloatingLiteral( char *in, char *end, Value **floating // parse the float value bool ok( false ); + if ( isHexLiteral( start, end ) ) { + parseHexaLiteral( start, end, floating ); + return in; + } + if( isNumeric( *start ) ) { ok = true; } else { @@ -767,7 +773,7 @@ char *OpenDDLParser::parseStringLiteral( char *in, char *end, Value **stringData return in; } -static void createPropertyWithData( Identifier *id, Value *primData, Property **prop ) { +static void createPropertyWithData( Text *id, Value *primData, Property **prop ) { if( ddl_nullptr != primData ) { ( *prop ) = new Property( id ); ( *prop )->m_value = primData; @@ -830,7 +836,7 @@ char *OpenDDLParser::parseProperty( char *in, char *end, Property **prop ) { } in = lookForNextToken( in, end ); - Identifier *id( ddl_nullptr ); + Text *id( ddl_nullptr ); in = parseIdentifier( in, end, &id ); if( ddl_nullptr != id ) { in = lookForNextToken( in, end ); @@ -847,7 +853,7 @@ char *OpenDDLParser::parseProperty( char *in, char *end, Property **prop ) { } else if( isStringLiteral( *in ) ) { // string data in = parseStringLiteral( in, end, &primData ); createPropertyWithData( id, primData, prop ); - } else { // reference data + } else { // reference data std::vector names; in = parseReference( in, end, names ); if( !names.empty() ) { @@ -862,7 +868,8 @@ char *OpenDDLParser::parseProperty( char *in, char *end, Property **prop ) { return in; } -char *OpenDDLParser::parseDataList( char *in, char *end, Value::ValueType type, Value **data, size_t &numValues, Reference **refs, size_t &numRefs ) { +char *OpenDDLParser::parseDataList( char *in, char *end, Value::ValueType type, Value **data, + size_t &numValues, Reference **refs, size_t &numRefs ) { *data = ddl_nullptr; numValues = numRefs = 0; if( ddl_nullptr == in || in == end ) { @@ -876,28 +883,24 @@ char *OpenDDLParser::parseDataList( char *in, char *end, Value::ValueType type, while( '}' != *in ) { current = ddl_nullptr; in = lookForNextToken( in, end ); - if (Value::ddl_none == type) { + if ( Value::ddl_ref == type ) { + std::vector names; + in = parseReference( in, end, names ); + if ( !names.empty() ) { + Reference *ref = new Reference( names.size(), &names[ 0 ] ); + *refs = ref; + numRefs = names.size(); + } + } else if ( Value::ddl_none == type ) { if (isInteger( in, end )) { in = parseIntegerLiteral( in, end, ¤t ); - } - else if (isFloat( in, end )) { + } else if (isFloat( in, end )) { in = parseFloatingLiteral( in, end, ¤t ); - } - else if (isStringLiteral( *in )) { + } else if (isStringLiteral( *in )) { in = parseStringLiteral( in, end, ¤t ); - } - else if (isHexLiteral( in, end )) { + } else if (isHexLiteral( in, end )) { in = parseHexaLiteral( in, end, ¤t ); } - else { // reference data - std::vector names; - in = parseReference( in, end, names ); - if (!names.empty()) { - Reference *ref = new Reference( names.size(), &names[ 0 ] ); - *refs = ref; - numRefs = names.size(); - } - } } else { switch(type){ case Value::ddl_int8: @@ -951,10 +954,10 @@ static DataArrayList *createDataArrayList( Value *currentValue, size_t numValues dataList->m_numItems = numValues; return dataList; - } -char *OpenDDLParser::parseDataArrayList( char *in, char *end,Value::ValueType type, DataArrayList **dataList ) { - *dataList = ddl_nullptr; + +char *OpenDDLParser::parseDataArrayList( char *in, char *end,Value::ValueType type, DataArrayList **dataArrayList ) { + *dataArrayList = ddl_nullptr; if( ddl_nullptr == in || in == end ) { return in; } @@ -970,10 +973,10 @@ char *OpenDDLParser::parseDataArrayList( char *in, char *end,Value::ValueType ty currentValue = ddl_nullptr; in = parseDataList( in, end, type, ¤tValue, numValues, &refs, numRefs ); - if( ddl_nullptr != currentValue ) { + if( ddl_nullptr != currentValue || 0 != numRefs ) { if( ddl_nullptr == prev ) { - *dataList = createDataArrayList( currentValue, numValues ); - prev = *dataList; + *dataArrayList = createDataArrayList( currentValue, numValues ); + prev = *dataArrayList; } else { currentDataList = createDataArrayList( currentValue, numValues ); if( ddl_nullptr != prev ) { diff --git a/contrib/openddlparser/code/Value.cpp b/contrib/openddlparser/code/Value.cpp index 8dc27817e..3e251c508 100644 --- a/contrib/openddlparser/code/Value.cpp +++ b/contrib/openddlparser/code/Value.cpp @@ -240,10 +240,16 @@ void Value::setDouble( double value ) { } double Value::getDouble() const { - assert( ddl_double == m_type ); - double v; - ::memcpy( &v, m_data, m_size ); - return v; + if ( m_type == ddl_double ) { + double v; + ::memcpy( &v, m_data, m_size ); + return ( float ) v; + } + else { + double tmp; + ::memcpy( &tmp, m_data, 4 ); + return ( double ) tmp; + } } void Value::setString( const std::string &str ) { @@ -251,60 +257,88 @@ void Value::setString( const std::string &str ) { ::memcpy( m_data, str.c_str(), str.size() ); m_data[ str.size() ] = '\0'; } + const char *Value::getString() const { assert( ddl_string == m_type ); return (const char*) m_data; } +void Value::setRef( Reference *ref ) { + assert( ddl_ref == m_type ); + + if ( ddl_nullptr != ref ) { + const size_t sizeInBytes( ref->sizeInBytes() ); + if ( sizeInBytes > 0 ) { + if ( ddl_nullptr != m_data ) { + delete [] m_data; + } + + m_data = new unsigned char[ sizeof( Reference ) ]; + Reference *myRef = ( Reference * ) m_data; + myRef->m_numRefs = ref->m_numRefs; + myRef->m_referencedName = new Name *[ myRef->m_numRefs ]; + for ( size_t i = 0; i < myRef->m_numRefs; i++ ) { + myRef->m_referencedName[ i ] = new Name( ref->m_referencedName[ i ]->m_type, ref->m_referencedName[ i ]->m_id ); + } + } + } +} + +Reference *Value::getRef() const { + assert( ddl_ref == m_type ); + + return (Reference*) m_data; +} + void Value::dump() { switch( m_type ) { - case ddl_none: - std::cout << "None" << std::endl; - break; - case ddl_bool: - std::cout << getBool() << std::endl; - break; - case ddl_int8: - std::cout << getInt8() << std::endl; - break; - case ddl_int16: - std::cout << getInt16() << std::endl; - break; - case ddl_int32: - std::cout << getInt32() << std::endl; - break; - case ddl_int64: - std::cout << getInt64() << std::endl; - break; - case ddl_unsigned_int8: - std::cout << "Not supported" << std::endl; - break; - case ddl_unsigned_int16: - std::cout << "Not supported" << std::endl; - break; - case ddl_unsigned_int32: - std::cout << "Not supported" << std::endl; - break; - case ddl_unsigned_int64: - std::cout << "Not supported" << std::endl; - break; - case ddl_half: - std::cout << "Not supported" << std::endl; - break; - case ddl_float: - std::cout << getFloat() << std::endl; - break; - case ddl_double: - std::cout << getDouble() << std::endl; - break; - case ddl_string: - std::cout << "Not supported" << std::endl; - break; - case ddl_ref: - std::cout << "Not supported" << std::endl; - break; - default: - break; + case ddl_none: + std::cout << "None" << std::endl; + break; + case ddl_bool: + std::cout << getBool() << std::endl; + break; + case ddl_int8: + std::cout << getInt8() << std::endl; + break; + case ddl_int16: + std::cout << getInt16() << std::endl; + break; + case ddl_int32: + std::cout << getInt32() << std::endl; + break; + case ddl_int64: + std::cout << getInt64() << std::endl; + break; + case ddl_unsigned_int8: + std::cout << "Not supported" << std::endl; + break; + case ddl_unsigned_int16: + std::cout << "Not supported" << std::endl; + break; + case ddl_unsigned_int32: + std::cout << "Not supported" << std::endl; + break; + case ddl_unsigned_int64: + std::cout << "Not supported" << std::endl; + break; + case ddl_half: + std::cout << "Not supported" << std::endl; + break; + case ddl_float: + std::cout << getFloat() << std::endl; + break; + case ddl_double: + std::cout << getDouble() << std::endl; + break; + case ddl_string: + std::cout << getString() << std::endl; + break; + case ddl_ref: + std::cout << "Not supported" << std::endl; + break; + default: + break; } } diff --git a/contrib/openddlparser/include/openddlparser/DDLNode.h b/contrib/openddlparser/include/openddlparser/DDLNode.h index 8cef469d0..137135604 100644 --- a/contrib/openddlparser/include/openddlparser/DDLNode.h +++ b/contrib/openddlparser/include/openddlparser/DDLNode.h @@ -144,8 +144,8 @@ public: private: DDLNode( const std::string &type, const std::string &name, size_t idx, DDLNode *parent = ddl_nullptr ); DDLNode(); - DDLNode( const DDLNode & ); - DDLNode &operator = ( const DDLNode & ); + DDLNode( const DDLNode & ) ddl_no_copy; + DDLNode &operator = ( const DDLNode & ) ddl_no_copy; static void releaseNodes(); private: diff --git a/contrib/openddlparser/include/openddlparser/OpenDDLCommon.h b/contrib/openddlparser/include/openddlparser/OpenDDLCommon.h index 04007fc74..ddf36df31 100644 --- a/contrib/openddlparser/include/openddlparser/OpenDDLCommon.h +++ b/contrib/openddlparser/include/openddlparser/OpenDDLCommon.h @@ -32,7 +32,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # include #endif -#ifdef _MSC_VER +#if defined(_MSC_VER) && !defined( OPENDDL_STATIC_LIBARY ) + # define TAG_DLL_EXPORT __declspec(dllexport) # define TAG_DLL_IMPORT __declspec(dllimport ) # ifdef OPENDDLPARSER_BUILD @@ -132,31 +133,6 @@ private: Text &operator = ( const Text & ) ddl_no_copy; }; -/// @brief Stores an OpenDDL-specific identifier type. -struct DLL_ODDLPARSER_EXPORT Identifier { - Text m_text; ///< The text element. - - /// @brief The constructor with a sized buffer full of characters. - /// @param buffer [in] The identifier buffer. - /// @param len [in] The length of the buffer - Identifier( const char buffer[], size_t len ); - - /// @brief The constructor with a buffer full of characters. - /// @param buffer [in] The identifier buffer. - /// @remark Buffer must be null-terminated. - Identifier( const char buffer[] ); - - /// @brief The destructor. - ~Identifier(); - - /// @brief The compare operator. - bool operator == ( const Identifier &rhs ) const; - -private: - Identifier( const Identifier & ) ddl_no_copy; - Identifier &operator = ( const Identifier & ) ddl_no_copy; -}; - /// @brief Description of the type of a name. enum NameType { GlobalName, ///< Name is global. @@ -166,12 +142,12 @@ enum NameType { /// @brief Stores an OpenDDL-specific name struct DLL_ODDLPARSER_EXPORT Name { NameType m_type; ///< The type of the name ( @see NameType ). - Identifier *m_id; ///< The id. + Text *m_id; ///< The id. /// @brief The constructor with the type and the id. /// @param type [in] The name type. /// @param id [in] The id. - Name( NameType type, Identifier *id ); + Name( NameType type, Text *id ); /// @brief The destructor. ~Name(); @@ -197,6 +173,10 @@ struct DLL_ODDLPARSER_EXPORT Reference { /// @brief The destructor. ~Reference(); + /// @brief Returns the size in bytes to store one deep reference copy. + /// @return The size on bytes. + size_t sizeInBytes(); + private: Reference( const Reference & ) ddl_no_copy; Reference &operator = ( const Reference & ) ddl_no_copy; @@ -204,7 +184,7 @@ private: /// @brief Stores a property list. struct DLL_ODDLPARSER_EXPORT Property { - Identifier *m_key; ///< The identifier / key of the property. + Text *m_key; ///< The identifier / key of the property. Value *m_value; ///< The value assigned to its key / id ( ddl_nullptr if none ). Reference *m_ref; ///< References assigned to its key / id ( ddl_nullptr if none ). Property *m_next; ///< The next property ( ddl_nullptr if none ). @@ -214,7 +194,7 @@ struct DLL_ODDLPARSER_EXPORT Property { /// @brief The constructor for initialization. /// @param id [in] The identifier - Property( Identifier *id ); + Property( Text *id ); /// @brief The destructor. ~Property(); @@ -227,7 +207,7 @@ private: /// @brief Stores a data array list. struct DLL_ODDLPARSER_EXPORT DataArrayList { size_t m_numItems; ///< The number of items in the list. - Value *m_dataList; ///< The data list ( ee Value ). + Value *m_dataList; ///< The data list ( a Value ). DataArrayList *m_next; ///< The next data array list ( ddl_nullptr if last ). /// @brief The default constructor for initialization. diff --git a/contrib/openddlparser/include/openddlparser/OpenDDLExport.h b/contrib/openddlparser/include/openddlparser/OpenDDLExport.h index 4fa347140..8ede537d9 100644 --- a/contrib/openddlparser/include/openddlparser/OpenDDLExport.h +++ b/contrib/openddlparser/include/openddlparser/OpenDDLExport.h @@ -93,6 +93,10 @@ protected: bool writeValue( Value *val, std::string &statement ); bool writeValueArray( DataArrayList *al, std::string &statement ); +private: + OpenDDLExport( const OpenDDLExport & ) ddl_no_copy; + OpenDDLExport &operator = ( const OpenDDLExport & ) ddl_no_copy; + private: IOStreamBase *m_stream; }; diff --git a/contrib/openddlparser/include/openddlparser/OpenDDLParser.h b/contrib/openddlparser/include/openddlparser/OpenDDLParser.h index e3fed893b..efeab6026 100644 --- a/contrib/openddlparser/include/openddlparser/OpenDDLParser.h +++ b/contrib/openddlparser/include/openddlparser/OpenDDLParser.h @@ -63,9 +63,6 @@ inline T *getNextToken( T *in, T *end ) { T *tmp( in ); in = lookForNextToken( in, end ); - /*while( ( isSpace( *in ) || isNewLine( *in ) || ',' == *in ) && ( in != end ) ) { - in++; - }*/ if( tmp == in ) { in++; } @@ -103,7 +100,7 @@ public: /// @brief The class constructor. /// @param buffer [in] The buffer /// @param len [in] Size of the buffer - OpenDDLParser( char *buffer, size_t len ); + OpenDDLParser( const char *buffer, size_t len ); /// @brief The class destructor. ~OpenDDLParser(); @@ -119,7 +116,7 @@ public: /// @brief Assigns a new buffer to parse. /// @param buffer [in] The buffer /// @param len [in] Size of the buffer - void setBuffer( char *buffer, size_t len ); + void setBuffer( const char *buffer, size_t len ); /// @brief Assigns a new buffer to parse. /// @param buffer [in] The buffer as a std::vector. @@ -161,7 +158,7 @@ public: // parser helpers DDLNode *top(); static void normalizeBuffer( std::vector &buffer ); static char *parseName( char *in, char *end, Name **name ); - static char *parseIdentifier( char *in, char *end, Identifier **id ); + static char *parseIdentifier( char *in, char *end, Text **id ); static char *parsePrimitiveDataType( char *in, char *end, Value::ValueType &type, size_t &len ); static char *parseReference( char *in, char *end, std::vector &names ); static char *parseBooleanLiteral( char *in, char *end, Value **boolean ); @@ -175,8 +172,8 @@ public: // parser helpers static const char *getVersion(); private: - OpenDDLParser( const OpenDDLParser & ); - OpenDDLParser &operator = ( const OpenDDLParser & ); + OpenDDLParser( const OpenDDLParser & ) ddl_no_copy; + OpenDDLParser &operator = ( const OpenDDLParser & ) ddl_no_copy; private: logCallback m_logCallback; diff --git a/contrib/openddlparser/include/openddlparser/OpenDDLParserUtils.h b/contrib/openddlparser/include/openddlparser/OpenDDLParserUtils.h index 635dfd8f7..880e4c0b3 100644 --- a/contrib/openddlparser/include/openddlparser/OpenDDLParserUtils.h +++ b/contrib/openddlparser/include/openddlparser/OpenDDLParserUtils.h @@ -84,12 +84,7 @@ static const unsigned char chartype_table[ 256 ] = { template inline bool isNumeric( const T in ) { - return ( in >= '0' && in <= '9' ); - //return ( chartype_table[in] ); - /*if (in >= '0' && in <= '9' ) - return true; - - return false;*/ + return ( chartype_table[ in ] == 1 ); } template @@ -243,7 +238,7 @@ bool isComment( T *in, T *end ) { if ( in+1!=end ) { if ( *( in+1 )=='/' ) { char *drive( ( in+2 ) ); - if ( isUpperCase( *drive )||isLowerCase( *drive )&&*( drive+1 )=='/' ) { + if ( (isUpperCase( *drive )||isLowerCase( *drive ))&&*( drive+1 )=='/' ) { return false; } else { return true; diff --git a/contrib/openddlparser/include/openddlparser/Value.h b/contrib/openddlparser/include/openddlparser/Value.h index 3a6191391..242ec8781 100644 --- a/contrib/openddlparser/include/openddlparser/Value.h +++ b/contrib/openddlparser/include/openddlparser/Value.h @@ -220,6 +220,14 @@ public: /// @return The std::string value. const char *getString() const; + /// @brief Set the reference. + /// @param ref [in] Pointer showing to the reference. + void setRef( Reference *ref ); + + /// @brief Returns the pointer showing to the reference. + /// @return Pointer showing to the reference. + Reference *getRef() const; + /// @brief Dumps the value. void dump(); @@ -241,8 +249,8 @@ public: Value *m_next; private: - Value &operator =( const Value & ); - Value( const Value & ); + Value &operator =( const Value & ) ddl_no_copy; + Value( const Value & ) ddl_no_copy; }; ///------------------------------------------------------------------------------------------------ @@ -253,9 +261,9 @@ struct DLL_ODDLPARSER_EXPORT ValueAllocator { static void releasePrimData( Value **data ); private: - ValueAllocator(); - ValueAllocator( const ValueAllocator & ); - ValueAllocator &operator = ( const ValueAllocator & ); + ValueAllocator() ddl_no_copy; + ValueAllocator( const ValueAllocator & ) ddl_no_copy; + ValueAllocator &operator = ( const ValueAllocator & ) ddl_no_copy; }; END_ODDLPARSER_NS From a998055cbdd0716187321ca4f5905ff31b9e7b0c Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Sun, 7 Feb 2016 17:59:56 +0100 Subject: [PATCH 27/45] OpenDDLParser: add missing files. --- contrib/openddlparser/CREDITS | 16 ++++++++++++++++ contrib/openddlparser/LICENSE | 22 ++++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 contrib/openddlparser/CREDITS create mode 100644 contrib/openddlparser/LICENSE diff --git a/contrib/openddlparser/CREDITS b/contrib/openddlparser/CREDITS new file mode 100644 index 000000000..a2b01eb13 --- /dev/null +++ b/contrib/openddlparser/CREDITS @@ -0,0 +1,16 @@ +=============================================================== +OpenDDL-Parser +Developers and Contributors +=============================================================== + +- Kim Kulling ( kimmi ): +Founder + +- Fredrik Hansson ( FredrikHson ): +Improvements value interface, serveral bugfixes. + +- Henry Read ( henrya2 ): +Static build option, Interface improvements + +- Paul Holland ( pkholland ): +Bugfixes. diff --git a/contrib/openddlparser/LICENSE b/contrib/openddlparser/LICENSE new file mode 100644 index 000000000..4c1476bc4 --- /dev/null +++ b/contrib/openddlparser/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2014 Kim Kulling + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + From 37a3976b30e6b8081c662b455a203eda66250ad8 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Sun, 7 Feb 2016 20:03:24 +0100 Subject: [PATCH 28/45] Revert "Fix issue: OBJ import takes forever (#759) (attempt 2)" --- code/ObjFileImporter.cpp | 32 ++++ code/ObjFileParser.cpp | 350 +++++++++++++++++++++------------------ code/ObjFileParser.h | 35 ++-- code/ObjTools.h | 6 +- 4 files changed, 245 insertions(+), 178 deletions(-) diff --git a/code/ObjFileImporter.cpp b/code/ObjFileImporter.cpp index 82e7fad1c..9ea93c93c 100644 --- a/code/ObjFileImporter.cpp +++ b/code/ObjFileImporter.cpp @@ -145,6 +145,38 @@ void ObjFileImporter::InternReadFile( const std::string& pFile, aiScene* pScene, modelName = pFile; } + // This next stage takes ~ 1/3th of the total readFile task + // so should amount for 1/3th of the progress + // only update every 100KB or it'll be too slow + unsigned int progress = 0; + unsigned int progressCounter = 0; + const unsigned int updateProgressEveryBytes = 100 * 1024; + const unsigned int progressTotal = (3*m_Buffer.size()/updateProgressEveryBytes); + // process all '\' + std::vector ::iterator iter = m_Buffer.begin(); + while (iter != m_Buffer.end()) + { + if (*iter == '\\') + { + // remove '\' + iter = m_Buffer.erase(iter); + // remove next character + while (*iter == '\r' || *iter == '\n') + iter = m_Buffer.erase(iter); + } + else + ++iter; + + if (++progressCounter >= updateProgressEveryBytes) + { + m_progress->UpdateFileRead(++progress, progressTotal); + progressCounter = 0; + } + } + + // 1/3rd progress + m_progress->UpdateFileRead(1, 3); + // parse the file into a temporary representation ObjFileParser parser(m_Buffer, modelName, pIOHandler, m_progress); diff --git a/code/ObjFileParser.cpp b/code/ObjFileParser.cpp index 211888113..29cca5952 100644 --- a/code/ObjFileParser.cpp +++ b/code/ObjFileParser.cpp @@ -61,13 +61,16 @@ const std::string ObjFileParser::DEFAULT_MATERIAL = AI_DEFAULT_MATERIAL_NAME; // ------------------------------------------------------------------- // Constructor with loaded data and directories. -ObjFileParser::ObjFileParser(const std::vector &data,const std::string &modelName, IOSystem *io, ProgressHandler* progress ) : - m_DataBuffer(data), +ObjFileParser::ObjFileParser(std::vector &data,const std::string &modelName, IOSystem *io, ProgressHandler* progress ) : + m_DataIt(data.begin()), + m_DataItEnd(data.end()), m_pModel(NULL), m_uiLine(0), m_pIO( io ), m_progress(progress) { + std::fill_n(m_buffer,Buffersize,0); + // Create the model instance to store all the data m_pModel = new ObjFile::Model(); m_pModel->m_ModelName = modelName; @@ -101,77 +104,48 @@ ObjFile::Model *ObjFileParser::GetModel() const // File parsing method. void ObjFileParser::parseFile() { - //! Iterator to current position in buffer - ConstDataArrayIt dataIt = m_DataBuffer.begin(); - //! Iterator to end position of buffer - const ConstDataArrayIt dataItEnd = m_DataBuffer.end(); - - if (dataIt == dataItEnd) + if (m_DataIt == m_DataItEnd) return; - //! Helper buffer - std::vector helperBuffer; - // only update every 100KB or it'll be too slow const unsigned int updateProgressEveryBytes = 100 * 1024; unsigned int progressCounter = 0; - const unsigned int bytesToProcess = std::distance(dataIt, dataItEnd); - const unsigned int progressTotal = bytesToProcess; + const unsigned int bytesToProcess = std::distance(m_DataIt, m_DataItEnd); + const unsigned int progressTotal = 3 * bytesToProcess; + const unsigned int progressOffset = bytesToProcess; unsigned int processed = 0; - ConstDataArrayIt lastDataIt = dataIt; + DataArrayIt lastDataIt = m_DataIt; - while (dataIt != dataItEnd) + while (m_DataIt != m_DataItEnd) { // Handle progress reporting - processed += std::distance(lastDataIt, dataIt); - lastDataIt = dataIt; + processed += std::distance(lastDataIt, m_DataIt); + lastDataIt = m_DataIt; if (processed > (progressCounter * updateProgressEveryBytes)) { progressCounter++; - m_progress->UpdateFileRead(processed, progressTotal); + m_progress->UpdateFileRead(progressOffset + processed*2, progressTotal); } - // take the next line and copy it into a helper buffer - // all subsequant parsing should use the helper buffer - copyNextLine(helperBuffer, dataIt, dataItEnd); - - if (helperBuffer[0] == '\0') - { - // either empty line, or end of file - if (dataIt == dataItEnd) - { - // end of file - return; - } - // else empty line, so skip - continue; - } - - //! Iterator to current position in helper buffer - ConstDataArrayIt helperIt = helperBuffer.begin(); - //! Iterator to end of helper buffer - const ConstDataArrayIt helperItEnd = helperBuffer.end(); - // parse line - switch (*helperIt) + switch (*m_DataIt) { case 'v': // Parse a vertex texture coordinate { - if (++helperIt != helperItEnd) { - if (*helperIt == ' ' || *helperIt == '\t') { - // read in vertex definition - getVector3(m_pModel->m_Vertices, ++helperIt, helperItEnd); - } else if (*helperIt == 't') { - // read in texture coordinate ( 2D or 3D ) - getVector( m_pModel->m_TextureCoord, ++helperIt, helperItEnd); - } else if (*helperIt == 'n') { - // Read in normal vector definition - getVector3( m_pModel->m_Normals, ++helperIt, helperItEnd); - } - // else unknown line + ++m_DataIt; + if (*m_DataIt == ' ' || *m_DataIt == '\t') { + // read in vertex definition + getVector3(m_pModel->m_Vertices); + } else if (*m_DataIt == 't') { + // read in texture coordinate ( 2D or 3D ) + ++m_DataIt; + getVector( m_pModel->m_TextureCoord ); + } else if (*m_DataIt == 'n') { + // Read in normal vector definition + ++m_DataIt; + getVector3( m_pModel->m_Normals ); } - // else no more data } break; @@ -179,38 +153,35 @@ void ObjFileParser::parseFile() case 'l': case 'f': { - aiPrimitiveType primType = (*helperIt == 'f') ? aiPrimitiveType_POLYGON : - (*helperIt == 'l') ? aiPrimitiveType_LINE : - aiPrimitiveType_POINT; - getFace(primType, ++helperIt, helperItEnd); + getFace(*m_DataIt == 'f' ? aiPrimitiveType_POLYGON : (*m_DataIt == 'l' + ? aiPrimitiveType_LINE : aiPrimitiveType_POINT)); } break; case '#': // Parse a comment { - // just ignore it + getComment(); } break; case 'u': // Parse a material desc. setter { - getMaterialDesc(++helperIt, helperItEnd); + getMaterialDesc(); } break; case 'm': // Parse a material library or merging group ('mg') { - if (*(helperIt + 1) == 'g') + if (*(m_DataIt + 1) == 'g') getGroupNumberAndResolution(); - else { - getMaterialLib(++helperIt, helperItEnd); - } + else + getMaterialLib(); } break; case 'g': // Parse group name { - getGroupName(++helperIt, helperItEnd); + getGroupName(); } break; @@ -222,12 +193,13 @@ void ObjFileParser::parseFile() case 'o': // Parse object name { - getObjectName(++helperIt, helperItEnd); + getObjectName(); } break; + default: { - // unknown line, skip + m_DataIt = skipLine( m_DataIt, m_DataItEnd, m_uiLine ); } break; } @@ -236,37 +208,34 @@ void ObjFileParser::parseFile() // ------------------------------------------------------------------- // Copy the next word in a temporary buffer -bool ObjFileParser::getNextFloat(ConstDataArrayIt &dataIt, const ConstDataArrayIt dataItEnd, float &result) +void ObjFileParser::copyNextWord(char *pBuffer, size_t length) { - std::vector tmpBuffer; - dataIt = getNextWord(dataIt, dataItEnd); - while( dataIt != dataItEnd && !IsSpaceOrNewLine( *dataIt ) ) { - tmpBuffer.push_back(*dataIt); - ++dataIt; + size_t index = 0; + m_DataIt = getNextWord(m_DataIt, m_DataItEnd); + while( m_DataIt != m_DataItEnd && !IsSpaceOrNewLine( *m_DataIt ) ) { + pBuffer[index] = *m_DataIt; + index++; + if( index == length - 1 ) { + break; + } + ++m_DataIt; } - if (tmpBuffer.size() == 0) - { - return false; - } - - tmpBuffer.push_back('\0'); - - result = fast_atof(&tmpBuffer[0]); - return true; + ai_assert(index < length); + pBuffer[index] = '\0'; } // ------------------------------------------------------------------- // Copy the next line into a temporary buffer -void ObjFileParser::copyNextLine(std::vector &buffer, ConstDataArrayIt &dataIt, const ConstDataArrayIt dataItEnd) +void ObjFileParser::copyNextLine(char *pBuffer, size_t length) { - // clear old data out. This is O(1) since a char is a "trivially-destructable type" - buffer.clear(); + size_t index = 0u; + // some OBJ files have line continuations using \ (such as in C++ et al) bool continuation = false; - for (;dataIt != dataItEnd; ++dataIt) + for (;m_DataIt != m_DataItEnd && index < length-1; ++m_DataIt) { - const char c = *dataIt; + const char c = *m_DataIt; if (c == '\\') { continuation = true; continue; @@ -274,84 +243,98 @@ void ObjFileParser::copyNextLine(std::vector &buffer, ConstDataArrayIt &da if (c == '\n' || c == '\r') { if(continuation) { - buffer.push_back(' '); + pBuffer[ index++ ] = ' '; continue; } - // end of line, update dataIt to point to the start of the next - dataIt = skipLine(dataIt, dataItEnd, m_uiLine ); break; } continuation = false; - buffer.push_back(c); + pBuffer[ index++ ] = c; } - // add a NULL terminator - buffer.push_back('\0'); + ai_assert(index < length); + pBuffer[ index ] = '\0'; } // ------------------------------------------------------------------- -void ObjFileParser::getVector( std::vector &point3d_array, ConstDataArrayIt &dataIt, const ConstDataArrayIt dataItEnd) { +void ObjFileParser::getVector( std::vector &point3d_array ) { size_t numComponents( 0 ); - float components[3]; - while( dataIt != dataItEnd ) { - if (!getNextFloat(dataIt, dataItEnd, components[numComponents])) - { - // failed - break; - } - numComponents++; - if (numComponents == 3) - { - // 3 is the max + const char* tmp( &m_DataIt[0] ); + while( !IsLineEnd( *tmp ) ) { + if ( !SkipSpaces( &tmp ) ) { break; } + SkipToken( tmp ); + ++numComponents; } - + float x, y, z; if( 2 == numComponents ) { - components[2] = 0.0f; - } else if( 3 != numComponents ) { + copyNextWord( m_buffer, Buffersize ); + x = ( float ) fast_atof( m_buffer ); + + copyNextWord( m_buffer, Buffersize ); + y = ( float ) fast_atof( m_buffer ); + z = 0.0; + } else if( 3 == numComponents ) { + copyNextWord( m_buffer, Buffersize ); + x = ( float ) fast_atof( m_buffer ); + + copyNextWord( m_buffer, Buffersize ); + y = ( float ) fast_atof( m_buffer ); + + copyNextWord( m_buffer, Buffersize ); + z = ( float ) fast_atof( m_buffer ); + } else { throw DeadlyImportError( "OBJ: Invalid number of components" ); } - point3d_array.push_back( aiVector3D( components[0], components[1], components[2] ) ); + point3d_array.push_back( aiVector3D( x, y, z ) ); + m_DataIt = skipLine( m_DataIt, m_DataItEnd, m_uiLine ); } // ------------------------------------------------------------------- // Get values for a new 3D vector instance -void ObjFileParser::getVector3(std::vector &point3d_array, ConstDataArrayIt &dataIt, const ConstDataArrayIt dataItEnd) { +void ObjFileParser::getVector3(std::vector &point3d_array) { float x, y, z; - if (!getNextFloat(dataIt, dataItEnd, x) || - !getNextFloat(dataIt, dataItEnd, y) || - !getNextFloat(dataIt, dataItEnd, z)) - { - throw DeadlyImportError( "OBJ: Invalid number of components" ); - } - else - { - point3d_array.push_back( aiVector3D( x, y, z ) ); - } + copyNextWord(m_buffer, Buffersize); + x = (float) fast_atof(m_buffer); + + copyNextWord(m_buffer, Buffersize); + y = (float) fast_atof(m_buffer); + + copyNextWord( m_buffer, Buffersize ); + z = ( float ) fast_atof( m_buffer ); + + point3d_array.push_back( aiVector3D( x, y, z ) ); + m_DataIt = skipLine( m_DataIt, m_DataItEnd, m_uiLine ); } // ------------------------------------------------------------------- // Get values for a new 2D vector instance -void ObjFileParser::getVector2( std::vector &point2d_array, ConstDataArrayIt &dataIt, const ConstDataArrayIt dataItEnd) { +void ObjFileParser::getVector2( std::vector &point2d_array ) { float x, y; - if (!getNextFloat(dataIt, dataItEnd, x) || - !getNextFloat(dataIt, dataItEnd, y)) - { - throw DeadlyImportError( "OBJ: Invalid number of components" ); - } - else - { - point2d_array.push_back( aiVector2D( x, y ) ); - } + copyNextWord(m_buffer, Buffersize); + x = (float) fast_atof(m_buffer); + + copyNextWord(m_buffer, Buffersize); + y = (float) fast_atof(m_buffer); + + point2d_array.push_back(aiVector2D(x, y)); + + m_DataIt = skipLine( m_DataIt, m_DataItEnd, m_uiLine ); } // ------------------------------------------------------------------- // Get values for a new face instance -void ObjFileParser::getFace(aiPrimitiveType type, ConstDataArrayIt &dataIt, const ConstDataArrayIt dataItEnd) +void ObjFileParser::getFace(aiPrimitiveType type) { - ConstDataArrayIt pPtr = getNextToken(dataIt, dataItEnd); - if (pPtr == dataItEnd || *pPtr == '\0') + copyNextLine(m_buffer, Buffersize); + if (m_DataIt == m_DataItEnd) + return; + + char *pPtr = m_buffer; + char *pEnd = &pPtr[Buffersize]; + pPtr = getNextToken(pPtr, pEnd); + if (pPtr == pEnd || *pPtr == '\0') return; std::vector *pIndices = new std::vector; @@ -366,7 +349,7 @@ void ObjFileParser::getFace(aiPrimitiveType type, ConstDataArrayIt &dataIt, cons const bool vt = (!m_pModel->m_TextureCoord.empty()); const bool vn = (!m_pModel->m_Normals.empty()); int iStep = 0, iPos = 0; - while (pPtr != dataItEnd) + while (pPtr != pEnd) { iStep = 1; @@ -395,7 +378,7 @@ void ObjFileParser::getFace(aiPrimitiveType type, ConstDataArrayIt &dataIt, cons else { //OBJ USES 1 Base ARRAYS!!!! - const int iVal = atoi( &pPtr[0] ); + const int iVal = atoi( pPtr ); // increment iStep position based off of the sign and # of digits int tmp = iVal; @@ -452,8 +435,8 @@ void ObjFileParser::getFace(aiPrimitiveType type, ConstDataArrayIt &dataIt, cons if ( pIndices->empty() ) { DefaultLogger::get()->error("Obj: Ignoring empty face"); - - // clean up + // skip line and clean up + m_DataIt = skipLine( m_DataIt, m_DataItEnd, m_uiLine ); delete pNormalID; delete pTexID; delete pIndices; @@ -487,25 +470,31 @@ void ObjFileParser::getFace(aiPrimitiveType type, ConstDataArrayIt &dataIt, cons if( !m_pModel->m_pCurrentMesh->m_hasNormals && hasNormal ) { m_pModel->m_pCurrentMesh->m_hasNormals = true; } + // Skip the rest of the line + m_DataIt = skipLine( m_DataIt, m_DataItEnd, m_uiLine ); } // ------------------------------------------------------------------- // Get values for a new material description -void ObjFileParser::getMaterialDesc(ConstDataArrayIt &dataIt, const ConstDataArrayIt dataItEnd) +void ObjFileParser::getMaterialDesc() { // Get next data for material data - dataIt = getNextToken(dataIt, dataItEnd); - if (dataIt == dataItEnd) { + m_DataIt = getNextToken(m_DataIt, m_DataItEnd); + if (m_DataIt == m_DataItEnd) { return; } + char *pStart = &(*m_DataIt); + while( m_DataIt != m_DataItEnd && !IsLineEnd( *m_DataIt ) ) { + ++m_DataIt; + } + // In some cases we should ignore this 'usemtl' command, this variable helps us to do so bool skip = false; // Get name - std::string strName(dataIt, dataItEnd); + std::string strName(pStart, &(*m_DataIt)); strName = trim_whitespaces(strName); - if (strName.empty()) skip = true; @@ -536,20 +525,46 @@ void ObjFileParser::getMaterialDesc(ConstDataArrayIt &dataIt, const ConstDataArr m_pModel->m_pCurrentMesh->m_uiMaterialIndex = getMaterialIndex(strName); } + + // Skip rest of line + m_DataIt = skipLine( m_DataIt, m_DataItEnd, m_uiLine ); +} + +// ------------------------------------------------------------------- +// Get a comment, values will be skipped +void ObjFileParser::getComment() +{ + while (m_DataIt != m_DataItEnd) + { + if ( '\n' == (*m_DataIt)) + { + ++m_DataIt; + break; + } + else + { + ++m_DataIt; + } + } } // ------------------------------------------------------------------- // Get material library from file. -void ObjFileParser::getMaterialLib(ConstDataArrayIt &dataIt, const ConstDataArrayIt dataItEnd) +void ObjFileParser::getMaterialLib() { // Translate tuple - dataIt = getNextToken(dataIt, dataItEnd); - if( dataIt == dataItEnd ) { + m_DataIt = getNextToken(m_DataIt, m_DataItEnd); + if( m_DataIt == m_DataItEnd ) { return; } + char *pStart = &(*m_DataIt); + while( m_DataIt != m_DataItEnd && !IsLineEnd( *m_DataIt ) ) { + ++m_DataIt; + } + // Check for existence - const std::string strMatName(dataIt, dataItEnd); + const std::string strMatName(pStart, &(*m_DataIt)); std::string absName; if ( m_pIO->StackSize() > 0 ) { std::string path = m_pIO->CurrentDirectory(); @@ -564,6 +579,7 @@ void ObjFileParser::getMaterialLib(ConstDataArrayIt &dataIt, const ConstDataArra if (!pFile ) { DefaultLogger::get()->error( "OBJ: Unable to locate material file " + strMatName ); + m_DataIt = skipLine( m_DataIt, m_DataItEnd, m_uiLine ); return; } @@ -581,19 +597,19 @@ void ObjFileParser::getMaterialLib(ConstDataArrayIt &dataIt, const ConstDataArra // ------------------------------------------------------------------- // Set a new material definition as the current material. -void ObjFileParser::getNewMaterial(ConstDataArrayIt &dataIt, const ConstDataArrayIt dataItEnd) +void ObjFileParser::getNewMaterial() { - dataIt = getNextToken(dataIt, dataItEnd); - dataIt = getNextWord(dataIt, dataItEnd); - if( dataIt == dataItEnd ) { + m_DataIt = getNextToken(m_DataIt, m_DataItEnd); + m_DataIt = getNextWord(m_DataIt, m_DataItEnd); + if( m_DataIt == m_DataItEnd ) { return; } - const char *pStart = &(*dataIt); - while( dataIt != dataItEnd && IsSpaceOrNewLine( *dataIt ) ) { - ++dataIt; + char *pStart = &(*m_DataIt); + std::string strMat( pStart, *m_DataIt ); + while( m_DataIt != m_DataItEnd && IsSpaceOrNewLine( *m_DataIt ) ) { + ++m_DataIt; } - std::string strMat( pStart, *dataIt ); std::map::iterator it = m_pModel->m_MaterialMap.find( strMat ); if ( it == m_pModel->m_MaterialMap.end() ) { @@ -610,6 +626,8 @@ void ObjFileParser::getNewMaterial(ConstDataArrayIt &dataIt, const ConstDataArra } m_pModel->m_pCurrentMesh->m_uiMaterialIndex = getMaterialIndex( strMat ); } + + m_DataIt = skipLine( m_DataIt, m_DataItEnd, m_uiLine ); } // ------------------------------------------------------------------- @@ -632,13 +650,12 @@ int ObjFileParser::getMaterialIndex( const std::string &strMaterialName ) // ------------------------------------------------------------------- // Getter for a group name. -void ObjFileParser::getGroupName(ConstDataArrayIt &dataIt, const ConstDataArrayIt dataItEnd) +void ObjFileParser::getGroupName() { std::string strGroupName; - dataIt = getNextToken(dataIt, dataItEnd); - dataIt = getName(dataIt, dataItEnd, strGroupName); - if( isEndOfBuffer( dataIt, dataItEnd ) ) { + m_DataIt = getName(m_DataIt, m_DataItEnd, strGroupName); + if( isEndOfBuffer( m_DataIt, m_DataItEnd ) ) { return; } @@ -664,6 +681,7 @@ void ObjFileParser::getGroupName(ConstDataArrayIt &dataIt, const ConstDataArrayI } m_pModel->m_strActiveGroup = strGroupName; } + m_DataIt = skipLine( m_DataIt, m_DataItEnd, m_uiLine ); } // ------------------------------------------------------------------- @@ -671,6 +689,8 @@ void ObjFileParser::getGroupName(ConstDataArrayIt &dataIt, const ConstDataArrayI void ObjFileParser::getGroupNumber() { // Not used + + m_DataIt = skipLine( m_DataIt, m_DataItEnd, m_uiLine ); } // ------------------------------------------------------------------- @@ -678,19 +698,25 @@ void ObjFileParser::getGroupNumber() void ObjFileParser::getGroupNumberAndResolution() { // Not used + + m_DataIt = skipLine( m_DataIt, m_DataItEnd, m_uiLine ); } // ------------------------------------------------------------------- // Stores values for a new object instance, name will be used to // identify it. -void ObjFileParser::getObjectName(ConstDataArrayIt &dataIt, const ConstDataArrayIt dataItEnd) +void ObjFileParser::getObjectName() { - dataIt = getNextToken(dataIt, dataItEnd); - if( dataIt == dataItEnd ) { + m_DataIt = getNextToken(m_DataIt, m_DataItEnd); + if( m_DataIt == m_DataItEnd ) { return; } + char *pStart = &(*m_DataIt); + while( m_DataIt != m_DataItEnd && !IsSpaceOrNewLine( *m_DataIt ) ) { + ++m_DataIt; + } - std::string strObjectName(dataIt, dataItEnd); + std::string strObjectName(pStart, &(*m_DataIt)); if (!strObjectName.empty()) { // Reset current object @@ -713,6 +739,7 @@ void ObjFileParser::getObjectName(ConstDataArrayIt &dataIt, const ConstDataArray createObject( strObjectName ); } } + m_DataIt = skipLine( m_DataIt, m_DataItEnd, m_uiLine ); } // ------------------------------------------------------------------- // Creates a new object instance @@ -776,6 +803,7 @@ bool ObjFileParser::needsNewMesh( const std::string &rMaterialName ) // Shows an error in parsing process. void ObjFileParser::reportErrorTokenInFace() { + m_DataIt = skipLine( m_DataIt, m_DataItEnd, m_uiLine ); DefaultLogger::get()->error("OBJ: Not supported token in face description detected"); } diff --git a/code/ObjFileParser.h b/code/ObjFileParser.h index 52fbe5540..e16de49a8 100644 --- a/code/ObjFileParser.h +++ b/code/ObjFileParser.h @@ -65,13 +65,14 @@ class ProgressHandler; /// \brief Parser for a obj waveform file class ObjFileParser { public: + static const size_t Buffersize = 4096; typedef std::vector DataArray; typedef std::vector::iterator DataArrayIt; typedef std::vector::const_iterator ConstDataArrayIt; public: /// \brief Constructor with data array. - ObjFileParser(const std::vector &Data,const std::string &strModelName, IOSystem* io, ProgressHandler* progress); + ObjFileParser(std::vector &Data,const std::string &strModelName, IOSystem* io, ProgressHandler* progress); /// \brief Destructor ~ObjFileParser(); /// \brief Model getter. @@ -81,25 +82,27 @@ private: /// Parse the loaded file void parseFile(); /// Method to copy the new delimited word in the current line. - bool getNextFloat(ConstDataArrayIt &dataIt, const ConstDataArrayIt dataItEnd, float &result); + void copyNextWord(char *pBuffer, size_t length); /// Method to copy the new line. - void copyNextLine(std::vector &buffer, ConstDataArrayIt &dataIt, const ConstDataArrayIt dataItEnd); + void copyNextLine(char *pBuffer, size_t length); /// Stores the vector - void getVector( std::vector &point3d_array, ConstDataArrayIt &dataIt, const ConstDataArrayIt dataItEnd); + void getVector( std::vector &point3d_array ); /// Stores the following 3d vector. - void getVector3(std::vector &point3d_array, ConstDataArrayIt &dataIt, const ConstDataArrayIt dataItEnd); + void getVector3( std::vector &point3d_array ); /// Stores the following 3d vector. - void getVector2(std::vector &point2d_array, ConstDataArrayIt &dataIt, const ConstDataArrayIt dataItEnd); + void getVector2(std::vector &point2d_array); /// Stores the following face. - void getFace(aiPrimitiveType type, ConstDataArrayIt &dataIt, const ConstDataArrayIt dataItEnd); + void getFace(aiPrimitiveType type); /// Reads the material description. - void getMaterialDesc(ConstDataArrayIt &dataIt, const ConstDataArrayIt dataItEnd); + void getMaterialDesc(); + /// Gets a comment. + void getComment(); /// Gets a a material library. - void getMaterialLib(ConstDataArrayIt &dataIt, const ConstDataArrayIt dataItEnd); + void getMaterialLib(); /// Creates a new material. - void getNewMaterial(ConstDataArrayIt &dataIt, const ConstDataArrayIt dataItEnd); + void getNewMaterial(); /// Gets the group name from file. - void getGroupName(ConstDataArrayIt &dataIt, const ConstDataArrayIt dataItEnd); + void getGroupName(); /// Gets the group number from file. void getGroupNumber(); /// Gets the group number and resolution from file. @@ -107,7 +110,7 @@ private: /// Returns the index of the material. Is -1 if not material was found. int getMaterialIndex( const std::string &strMaterialName ); /// Parse object name - void getObjectName(ConstDataArrayIt &dataIt, const ConstDataArrayIt dataItEnd); + void getObjectName(); /// Creates a new object. void createObject( const std::string &strObjectName ); /// Creates a new mesh. @@ -125,12 +128,16 @@ private: /// Default material name static const std::string DEFAULT_MATERIAL; - //! Data buffer - const std::vector &m_DataBuffer; + //! Iterator to current position in buffer + DataArrayIt m_DataIt; + //! Iterator to end position of buffer + DataArrayIt m_DataItEnd; //! Pointer to model instance ObjFile::Model *m_pModel; //! Current line (for debugging) unsigned int m_uiLine; + //! Helper buffer + char m_buffer[Buffersize]; /// Pointer to IO system instance. IOSystem *m_pIO; //! Pointer to progress handler diff --git a/code/ObjTools.h b/code/ObjTools.h index 5406acd6d..311965ce3 100644 --- a/code/ObjTools.h +++ b/code/ObjTools.h @@ -141,7 +141,7 @@ inline char_t getName( char_t it, char_t end, std::string &name ) return end; } - char_t pStart = it; + char *pStart = &( *it ); while( !isEndOfBuffer( it, end ) && !IsLineEnd( *it ) ) { ++it; } @@ -153,10 +153,10 @@ inline char_t getName( char_t it, char_t end, std::string &name ) // Get name // if there is no name, and the previous char is a separator, come back to start - while (it < pStart) { + while (&(*it) < pStart) { ++it; } - std::string strName( pStart, it ); + std::string strName( pStart, &(*it) ); if ( strName.empty() ) return it; else From 72b5ed50e933c521a02fee1cf46cfff3e02e3cb3 Mon Sep 17 00:00:00 2001 From: rmitton Date: Sun, 7 Feb 2016 13:21:58 -0800 Subject: [PATCH 29/45] Bump just to get AppVeyor to re-test it. --- code/SIBImporter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/SIBImporter.cpp b/code/SIBImporter.cpp index 8fce2234e..1b3602124 100644 --- a/code/SIBImporter.cpp +++ b/code/SIBImporter.cpp @@ -40,7 +40,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** @file SIBImporter.cpp - * @brief Implementation of the SIB importer class + * @brief Implementation of the SIB importer class. * * The Nevercenter Silo SIB format is undocumented. * All details here have been reverse engineered from From c34717639ecb7c99e136bce9952e32b7be330c2a Mon Sep 17 00:00:00 2001 From: Trond Abusdal Date: Sun, 7 Feb 2016 23:36:49 +0100 Subject: [PATCH 30/45] Collada: Importer generates animations from , if the node is present. --- code/ColladaHelper.h | 12 ++++ code/ColladaParser.cpp | 145 ++++++++++++++++++++++++++++++++++++++++- code/ColladaParser.h | 14 ++++ 3 files changed, 170 insertions(+), 1 deletion(-) diff --git a/code/ColladaHelper.h b/code/ColladaHelper.h index ae9b45bb0..a741ef705 100644 --- a/code/ColladaHelper.h +++ b/code/ColladaHelper.h @@ -597,6 +597,18 @@ struct Animation for( std::vector::iterator it = mSubAnims.begin(); it != mSubAnims.end(); ++it) delete *it; } + + void CollectChannelsRecursively(std::vector &channels) + { + channels.insert(channels.end(), mChannels.begin(), mChannels.end()); + + for (std::vector::iterator it = mSubAnims.begin(); it != mSubAnims.end(); ++it) + { + Animation *pAnim = (*it); + + pAnim->CollectChannelsRecursively(channels); + } + } }; /** Description of a collada animation channel which has been determined to affect the current node */ diff --git a/code/ColladaParser.cpp b/code/ColladaParser.cpp index 7778103bd..915947504 100644 --- a/code/ColladaParser.cpp +++ b/code/ColladaParser.cpp @@ -187,6 +187,8 @@ void ColladaParser::ReadStructure() ReadAssetInfo(); else if( IsElement( "library_animations")) ReadAnimationLibrary(); + else if (IsElement("library_animation_clips")) + ReadAnimationClipLibrary(); else if( IsElement( "library_controllers")) ReadControllerLibrary(); else if( IsElement( "library_images")) @@ -271,6 +273,131 @@ void ColladaParser::ReadAssetInfo() } } +// ------------------------------------------------------------------------------------------------ +// Reads the animation clips +void ColladaParser::ReadAnimationClipLibrary() +{ + if (mReader->isEmptyElement()) + return; + + while (mReader->read()) + { + if (mReader->getNodeType() == irr::io::EXN_ELEMENT) + { + if (IsElement("animation_clip")) + { + // optional name given as an attribute + std::string animName; + int indexName = TestAttribute("name"); + int indexID = TestAttribute("id"); + if (indexName >= 0) + animName = mReader->getAttributeValue(indexName); + else if (indexID >= 0) + animName = mReader->getAttributeValue(indexID); + else + animName = "animation_" + mAnimationClipLibrary.size(); + + std::pair> clip; + + clip.first = animName; + + while (mReader->read()) + { + if (mReader->getNodeType() == irr::io::EXN_ELEMENT) + { + if (IsElement("instance_animation")) + { + int indexUrl = TestAttribute("url"); + if (indexUrl >= 0) + { + const char* url = mReader->getAttributeValue(indexUrl); + if (url[0] != '#') + ThrowException("Unknown reference format"); + + url++; + + clip.second.push_back(url); + } + } + else + { + // ignore the rest + SkipElement(); + } + } + else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) + { + if (strcmp(mReader->getNodeName(), "animation_clip") != 0) + ThrowException("Expected end of element."); + + break; + } + } + + if (clip.second.size() > 0) + { + mAnimationClipLibrary.push_back(clip); + } + } + else + { + // ignore the rest + SkipElement(); + } + } + else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) + { + if (strcmp(mReader->getNodeName(), "library_animation_clips") != 0) + ThrowException("Expected end of element."); + + break; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// Re-build animations from animation clip library, if present. +void ColladaParser::RebuildRootAnimationsFromClips() +{ + if (mAnimationClipLibrary.size() > 0) + { + Animation temp; + + for (AnimationClipLibrary::iterator it = mAnimationClipLibrary.begin(); it != mAnimationClipLibrary.end(); ++it) + { + std::string clipName = it->first; + + printf("Clip: %s\n", clipName.c_str()); + + Animation *clip = new Animation(); + clip->mName = clipName; + + temp.mSubAnims.push_back(clip); + + for (std::vector::iterator a = it->second.begin(); a != it->second.end(); ++a) + { + std::string animationID = *a; + + printf(" Animation instance: %s\n", animationID.c_str()); + + AnimationLibrary::iterator animation = mAnimationLibrary.find(animationID); + + if (animation != mAnimationLibrary.end()) + { + Animation *pSourceAnimation = animation->second; + + pSourceAnimation->CollectChannelsRecursively(clip->mChannels); + } + } + } + + mAnims = temp; + + // Ensure no double deletes. + temp.mSubAnims.clear(); + } +} + // ------------------------------------------------------------------------------------------------ // Reads the animation library void ColladaParser::ReadAnimationLibrary() @@ -318,12 +445,17 @@ void ColladaParser::ReadAnimation( Collada::Animation* pParent) // optional name given as an attribute std::string animName; + std::string animID; int indexName = TestAttribute( "name"); int indexID = TestAttribute( "id"); + + if (indexID >= 0) + animID = mReader->getAttributeValue(indexID); + if( indexName >= 0) animName = mReader->getAttributeValue( indexName); else if( indexID >= 0) - animName = mReader->getAttributeValue( indexID); + animName = animID; else animName = "animation"; @@ -395,11 +527,17 @@ void ColladaParser::ReadAnimation( Collada::Animation* pParent) // it turned out to have channels - add them if( !channels.empty()) { + // FIXME: Is this essentially doing the same as "single-anim-node" codepath in + // ColladaLoader::StoreAnimations? If not, defer this to where animation + // clip instances are set up. Due to handling of + // this cannot be done here, as the channel owner is lost. +/* // special filtering for stupid exporters packing each channel into a separate animation if( channels.size() == 1) { pParent->mChannels.push_back( channels.begin()->second); } else +*/ { // else create the animation, if not done yet, and store the channels if( !anim) @@ -410,6 +548,11 @@ void ColladaParser::ReadAnimation( Collada::Animation* pParent) } for( ChannelMap::const_iterator it = channels.begin(); it != channels.end(); ++it) anim->mChannels.push_back( it->second); + + if (indexID >= 0) + { + mAnimationLibrary[animID] = anim; + } } } } diff --git a/code/ColladaParser.h b/code/ColladaParser.h index 6b8fe182e..1ea4a13d7 100644 --- a/code/ColladaParser.h +++ b/code/ColladaParser.h @@ -82,6 +82,12 @@ namespace Assimp /** Reads the animation library */ void ReadAnimationLibrary(); + + /** Reads the animation clip library */ + void ReadAnimationClipLibrary(); + + /** Re-build animations from animation clip library, if present */ + void RebuildRootAnimationsFromClips(); /** Reads an animation into the given parent structure */ void ReadAnimation( Collada::Animation* pParent); @@ -312,6 +318,14 @@ namespace Assimp /** Controller library: joint controllers by ID */ typedef std::map ControllerLibrary; ControllerLibrary mControllerLibrary; + + /** Animation library: animation references by ID */ + typedef std::map AnimationLibrary; + AnimationLibrary mAnimationLibrary; + + /** Animation clip library: clip animation references by ID */ + typedef std::vector>> AnimationClipLibrary; + AnimationClipLibrary mAnimationClipLibrary; /** Pointer to the root node. Don't delete, it just points to one of the nodes in the node library. */ From 15501912562f13cc77517110e01ba5755b0b9a81 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Mon, 8 Feb 2016 18:07:00 +0100 Subject: [PATCH 31/45] Closes https://github.com/assimp/assimp/issues/777: fix invalid skipping of line during face defintion parsing. --- code/ObjFileImporter.cpp | 23 +++++++++--------- code/ObjFileParser.cpp | 6 ++--- test/models/OBJ/box_without_lineending.obj | 28 ++++++++++++++++++++++ 3 files changed, 42 insertions(+), 15 deletions(-) create mode 100644 test/models/OBJ/box_without_lineending.obj diff --git a/code/ObjFileImporter.cpp b/code/ObjFileImporter.cpp index 9ea93c93c..c812baf23 100644 --- a/code/ObjFileImporter.cpp +++ b/code/ObjFileImporter.cpp @@ -114,35 +114,34 @@ const aiImporterDesc* ObjFileImporter::GetInfo () const // ------------------------------------------------------------------------------------------------ // Obj-file import implementation -void ObjFileImporter::InternReadFile( const std::string& pFile, aiScene* pScene, IOSystem* pIOHandler) -{ +void ObjFileImporter::InternReadFile( const std::string &file, aiScene* pScene, IOSystem* pIOHandler) { // Read file into memory - const std::string mode = "rb"; - boost::scoped_ptr file( pIOHandler->Open( pFile, mode)); - if( !file.get() ) { - throw DeadlyImportError( "Failed to open file " + pFile + "." ); + static const std::string mode = "rb"; + boost::scoped_ptr fileStream( pIOHandler->Open( file, mode)); + if( !fileStream.get() ) { + throw DeadlyImportError( "Failed to open file " + file + "." ); } // Get the file-size and validate it, throwing an exception when fails - size_t fileSize = file->FileSize(); + size_t fileSize = fileStream->FileSize(); if( fileSize < ObjMinSize ) { throw DeadlyImportError( "OBJ-file is too small."); } // Allocate buffer and read file into it - TextFileToBuffer(file.get(),m_Buffer); + TextFileToBuffer( fileStream.get(),m_Buffer); // Get the model name std::string modelName, folderName; - std::string::size_type pos = pFile.find_last_of( "\\/" ); + std::string::size_type pos = file.find_last_of( "\\/" ); if ( pos != std::string::npos ) { - modelName = pFile.substr(pos+1, pFile.size() - pos - 1); - folderName = pFile.substr( 0, pos ); + modelName = file.substr(pos+1, file.size() - pos - 1); + folderName = file.substr( 0, pos ); if ( !folderName.empty() ) { pIOHandler->PushDirectory( folderName ); } } else { - modelName = pFile; + modelName = file; } // This next stage takes ~ 1/3th of the total readFile task diff --git a/code/ObjFileParser.cpp b/code/ObjFileParser.cpp index 29cca5952..3f6748106 100644 --- a/code/ObjFileParser.cpp +++ b/code/ObjFileParser.cpp @@ -293,7 +293,7 @@ void ObjFileParser::getVector( std::vector &point3d_array ) { // ------------------------------------------------------------------- // Get values for a new 3D vector instance -void ObjFileParser::getVector3(std::vector &point3d_array) { +void ObjFileParser::getVector3( std::vector &point3d_array ) { float x, y, z; copyNextWord(m_buffer, Buffersize); x = (float) fast_atof(m_buffer); @@ -328,8 +328,8 @@ void ObjFileParser::getVector2( std::vector &point2d_array ) { void ObjFileParser::getFace(aiPrimitiveType type) { copyNextLine(m_buffer, Buffersize); - if (m_DataIt == m_DataItEnd) - return; + /*if (m_DataIt == m_DataItEnd) + return;*/ char *pPtr = m_buffer; char *pEnd = &pPtr[Buffersize]; diff --git a/test/models/OBJ/box_without_lineending.obj b/test/models/OBJ/box_without_lineending.obj new file mode 100644 index 000000000..80a201495 --- /dev/null +++ b/test/models/OBJ/box_without_lineending.obj @@ -0,0 +1,28 @@ +# Vertices: 8 +# Points: 0 +# Lines: 0 +# Faces: 6 +# Materials: 1 + +o 1 + +# Vertex list + +v -0.5 -0.5 0.5 +v -0.5 -0.5 -0.5 +v -0.5 0.5 -0.5 +v -0.5 0.5 0.5 +v 0.5 -0.5 0.5 +v 0.5 -0.5 -0.5 +v 0.5 0.5 -0.5 +v 0.5 0.5 0.5 + +# Point/Line/Face list + +usemtl Default +f 4 3 2 1 +f 2 6 5 1 +f 3 7 6 2 +f 8 7 3 4 +f 5 8 4 1 +f 6 7 8 5 \ No newline at end of file From 8681abe845f0a1cea21367b0544bdf12b183fbb3 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Tue, 9 Feb 2016 17:50:08 +0100 Subject: [PATCH 32/45] Obj_Importer: remove dead code. --- code/ObjFileParser.cpp | 45 +++++++++++++++++++----------------------- 1 file changed, 20 insertions(+), 25 deletions(-) diff --git a/code/ObjFileParser.cpp b/code/ObjFileParser.cpp index 3f6748106..bf9881d74 100644 --- a/code/ObjFileParser.cpp +++ b/code/ObjFileParser.cpp @@ -323,19 +323,18 @@ void ObjFileParser::getVector2( std::vector &point2d_array ) { m_DataIt = skipLine( m_DataIt, m_DataItEnd, m_uiLine ); } +static const std::string DefaultObjName = "defaultobject"; + // ------------------------------------------------------------------- // Get values for a new face instance -void ObjFileParser::getFace(aiPrimitiveType type) -{ +void ObjFileParser::getFace(aiPrimitiveType type) { copyNextLine(m_buffer, Buffersize); - /*if (m_DataIt == m_DataItEnd) - return;*/ - char *pPtr = m_buffer; char *pEnd = &pPtr[Buffersize]; pPtr = getNextToken(pPtr, pEnd); - if (pPtr == pEnd || *pPtr == '\0') + if ( pPtr == pEnd || *pPtr == '\0' ) { return; + } std::vector *pIndices = new std::vector; std::vector *pTexID = new std::vector; @@ -349,20 +348,18 @@ void ObjFileParser::getFace(aiPrimitiveType type) const bool vt = (!m_pModel->m_TextureCoord.empty()); const bool vn = (!m_pModel->m_Normals.empty()); int iStep = 0, iPos = 0; - while (pPtr != pEnd) - { + while (pPtr != pEnd) { iStep = 1; - if (IsLineEnd(*pPtr)) + if ( IsLineEnd( *pPtr ) ) { break; + } - if (*pPtr=='/' ) - { + if (*pPtr=='/' ) { if (type == aiPrimitiveType_POINT) { DefaultLogger::get()->error("Obj: Separator unexpected in point statement"); } - if (iPos == 0) - { + if (iPos == 0) { //if there are no texture coordinates in the file, but normals if (!vt && vn) { iPos = 1; @@ -370,22 +367,20 @@ void ObjFileParser::getFace(aiPrimitiveType type) } } iPos++; - } - else if( IsSpaceOrNewLine( *pPtr ) ) - { + } else if( IsSpaceOrNewLine( *pPtr ) ) { iPos = 0; - } - else - { + } else { //OBJ USES 1 Base ARRAYS!!!! - const int iVal = atoi( pPtr ); + const int iVal( ::atoi( pPtr ) ); // increment iStep position based off of the sign and # of digits int tmp = iVal; - if (iVal < 0) + if ( iVal < 0 ) { ++iStep; - while ( ( tmp = tmp / 10 )!=0 ) + } + while ( ( tmp = tmp / 10 ) != 0 ) { ++iStep; + } if ( iVal > 0 ) { @@ -455,12 +450,12 @@ void ObjFileParser::getFace(aiPrimitiveType type) // Create a default object, if nothing is there if( NULL == m_pModel->m_pCurrent ) { - createObject( "defaultobject" ); + createObject( DefaultObjName ); } // Assign face to mesh if ( NULL == m_pModel->m_pCurrentMesh ) { - createMesh( "defaultobject" ); + createMesh( DefaultObjName ); } // Store the face @@ -782,9 +777,9 @@ void ObjFileParser::createMesh( const std::string &meshName ) // Returns true, if a new mesh must be created. bool ObjFileParser::needsNewMesh( const std::string &rMaterialName ) { + // If no mesh data yet if(m_pModel->m_pCurrentMesh == 0) { - // No mesh data yet return true; } bool newMat = false; From d9017299a8c2f0f28ccaa9cee822affea403a7a8 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Wed, 10 Feb 2016 10:40:39 +0100 Subject: [PATCH 33/45] iObjParser: refactorings. --- code/ObjFileParser.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/ObjFileParser.cpp b/code/ObjFileParser.cpp index bf9881d74..f23cea879 100644 --- a/code/ObjFileParser.cpp +++ b/code/ObjFileParser.cpp @@ -775,7 +775,7 @@ void ObjFileParser::createMesh( const std::string &meshName ) // ------------------------------------------------------------------- // Returns true, if a new mesh must be created. -bool ObjFileParser::needsNewMesh( const std::string &rMaterialName ) +bool ObjFileParser::needsNewMesh( const std::string &materialName ) { // If no mesh data yet if(m_pModel->m_pCurrentMesh == 0) @@ -783,7 +783,7 @@ bool ObjFileParser::needsNewMesh( const std::string &rMaterialName ) return true; } bool newMat = false; - int matIdx = getMaterialIndex( rMaterialName ); + int matIdx = getMaterialIndex( materialName ); int curMatIdx = m_pModel->m_pCurrentMesh->m_uiMaterialIndex; if ( curMatIdx != int(ObjFile::Mesh::NoMaterial) && curMatIdx != matIdx ) { From 7e58a47ba0f88758ba87dee453120b5e25dae1af Mon Sep 17 00:00:00 2001 From: Trond Abusdal Date: Wed, 10 Feb 2016 23:57:29 +0100 Subject: [PATCH 34/45] * Combining single-channel animations like the previous code did, except now it has been deferred until after all nodes have been read. This makes the regression tests pass for a database created before these code changes. * Changed name of ColladaParser::RebuildRootAnimationsFromClips to ColladaParser::PostProcessRootAnimations as it now does more than it did before. --- code/ColladaHelper.h | 30 ++++++++++++++++++++++++++++++ code/ColladaParser.cpp | 22 +++++++++++++--------- code/ColladaParser.h | 4 ++-- 3 files changed, 45 insertions(+), 11 deletions(-) diff --git a/code/ColladaHelper.h b/code/ColladaHelper.h index a741ef705..0a635a559 100644 --- a/code/ColladaHelper.h +++ b/code/ColladaHelper.h @@ -598,6 +598,7 @@ struct Animation delete *it; } + /** Collect all channels in the animation hierarchy into a single channel list. */ void CollectChannelsRecursively(std::vector &channels) { channels.insert(channels.end(), mChannels.begin(), mChannels.end()); @@ -609,6 +610,35 @@ struct Animation pAnim->CollectChannelsRecursively(channels); } } + + /** Combine all single-channel animations' channel into the same (parent) animation channel list. */ + void CombineSingleChannelAnimations() + { + CombineSingleChannelAnimationsRecursively(this); + } + + void CombineSingleChannelAnimationsRecursively(Animation *pParent) + { + for (std::vector::iterator it = pParent->mSubAnims.begin(); it != pParent->mSubAnims.end();) + { + Animation *anim = *it; + + CombineSingleChannelAnimationsRecursively(anim); + + if (anim->mChannels.size() == 1) + { + pParent->mChannels.push_back(anim->mChannels[0]); + + it = pParent->mSubAnims.erase(it); + + delete anim; + } + else + { + ++it; + } + } + } }; /** Description of a collada animation channel which has been determined to affect the current node */ diff --git a/code/ColladaParser.cpp b/code/ColladaParser.cpp index 915947504..41a56e24a 100644 --- a/code/ColladaParser.cpp +++ b/code/ColladaParser.cpp @@ -217,6 +217,8 @@ void ColladaParser::ReadStructure() break; } } + + PostProcessRootAnimations(); } // ------------------------------------------------------------------------------------------------ @@ -356,8 +358,8 @@ void ColladaParser::ReadAnimationClipLibrary() } // ------------------------------------------------------------------------------------------------ -// Re-build animations from animation clip library, if present. -void ColladaParser::RebuildRootAnimationsFromClips() +// Re-build animations from animation clip library, if present, otherwise combine single-channel animations +void ColladaParser::PostProcessRootAnimations() { if (mAnimationClipLibrary.size() > 0) { @@ -367,8 +369,6 @@ void ColladaParser::RebuildRootAnimationsFromClips() { std::string clipName = it->first; - printf("Clip: %s\n", clipName.c_str()); - Animation *clip = new Animation(); clip->mName = clipName; @@ -378,8 +378,6 @@ void ColladaParser::RebuildRootAnimationsFromClips() { std::string animationID = *a; - printf(" Animation instance: %s\n", animationID.c_str()); - AnimationLibrary::iterator animation = mAnimationLibrary.find(animationID); if (animation != mAnimationLibrary.end()) @@ -396,6 +394,10 @@ void ColladaParser::RebuildRootAnimationsFromClips() // Ensure no double deletes. temp.mSubAnims.clear(); } + else + { + mAnims.CombineSingleChannelAnimations(); + } } // ------------------------------------------------------------------------------------------------ @@ -528,9 +530,11 @@ void ColladaParser::ReadAnimation( Collada::Animation* pParent) if( !channels.empty()) { // FIXME: Is this essentially doing the same as "single-anim-node" codepath in - // ColladaLoader::StoreAnimations? If not, defer this to where animation - // clip instances are set up. Due to handling of - // this cannot be done here, as the channel owner is lost. + // ColladaLoader::StoreAnimations? For now, this has been deferred to after + // all animations and all clips have been read. Due to handling of + // this cannot be done here, as the channel owner + // is lost, and some exporters make up animations by referring to multiple + // single-channel animations from an . /* // special filtering for stupid exporters packing each channel into a separate animation if( channels.size() == 1) diff --git a/code/ColladaParser.h b/code/ColladaParser.h index 1ea4a13d7..b2ff92701 100644 --- a/code/ColladaParser.h +++ b/code/ColladaParser.h @@ -86,8 +86,8 @@ namespace Assimp /** Reads the animation clip library */ void ReadAnimationClipLibrary(); - /** Re-build animations from animation clip library, if present */ - void RebuildRootAnimationsFromClips(); + /** Re-build animations from animation clip library, if present, otherwise combine single-channel animations */ + void PostProcessRootAnimations(); /** Reads an animation into the given parent structure */ void ReadAnimation( Collada::Animation* pParent); From 4d5df6dc9a220ba4754ac1ee0ed04afd7f7402fd Mon Sep 17 00:00:00 2001 From: Vitaly Ovchinnikov Date: Thu, 11 Feb 2016 12:19:06 +1300 Subject: [PATCH 35/45] use NormalizeSafe to prevent NaN when normalizing zero vectors --- code/SmoothingGroups.inl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/SmoothingGroups.inl b/code/SmoothingGroups.inl index 4f072ad1a..42c500070 100644 --- a/code/SmoothingGroups.inl +++ b/code/SmoothingGroups.inl @@ -119,7 +119,7 @@ void ComputeNormalsWithSmoothingsGroups(MeshWithSmoothingGroups& sMesh) { vNormals += sMesh.mNormals[(*a)]; } - vNormals.Normalize(); + vNormals.NormalizeSafe(); // write back into all affected normals for (std::vector::const_iterator From 14e5cf380c5611759c8f0f5a018f6b97e084c805 Mon Sep 17 00:00:00 2001 From: Trond Abusdal Date: Thu, 11 Feb 2016 00:14:23 +0100 Subject: [PATCH 36/45] Added regression test file for support. Generated from Blender using 'Better Collada Exporter' from Godot team. --- .../Collada/library_animation_clips.dae | 623 ++++++++++++++++++ 1 file changed, 623 insertions(+) create mode 100644 test/models/Collada/library_animation_clips.dae diff --git a/test/models/Collada/library_animation_clips.dae b/test/models/Collada/library_animation_clips.dae new file mode 100644 index 000000000..ee793389b --- /dev/null +++ b/test/models/Collada/library_animation_clips.dae @@ -0,0 +1,623 @@ + + + + + Anonymous + Collada Exporter for Blender 2.6+, by Juan Linietsky (juan@codenix.com) + + 2016-02-04T00:44:39Z + 2016-02-04T00:44:39Z + + Z_UP + + + + + + + + + + 0.0 0.0 0.0 1.0 + + + 0.0 0.0 0.0 1.0 + + + 0.6400000190734865 0.6400000190734865 0.6400000190734865 1.0 + + + 0.5 0.5 0.5 1.0 + + + 50 + + + 1.0 1.0 1.0 1.0 + + + 4.0 + + + + + + + 0 + + + + + + + + + + + + + + + + 1.0 0.9999999403953552 -1.0 1.0 -1.0 -1.0 -1.0000001192092896 -0.9999998211860657 -1.0 -0.9999996423721313 1.0000003576278687 -1.0 -0.9999999403953552 1.0 1.0 -1.0000003576278687 -0.9999996423721313 1.0 -1.0000003576278687 -0.9999996423721313 3.0 -0.9999999403953552 1.0 3.0 1.0 0.9999999403953552 -1.0 1.0000004768371582 0.999999463558197 1.0 0.9999993443489075 -1.0000005960464478 1.0 1.0 -1.0 -1.0 1.0 -1.0 -1.0 0.9999993443489075 -1.0000005960464478 1.0 -1.0000003576278687 -0.9999996423721313 1.0 -1.0000001192092896 -0.9999998211860657 -1.0 -1.0000001192092896 -0.9999998211860657 -1.0 -0.9999996423721313 1.0000003576278687 -1.0 1.0000004768371582 0.999999463558197 1.0 1.0 0.9999999403953552 -1.0 -0.9999996423721313 1.0000003576278687 -1.0 -0.9999999403953552 1.0 1.0 -0.9545343518257141 -0.9545336365699768 4.598935604095459 -0.9545339345932007 0.9545340538024902 4.598935604095459 0.9999993443489075 -1.0000005960464478 3.0 -1.0000003576278687 -0.9999996423721313 3.0 -0.9999999403953552 1.0 3.0 1.0000004768371582 0.999999463558197 3.0 1.0000004768371582 0.999999463558197 3.0 0.9999993443489075 -1.0000005960464478 3.0 -0.9025039672851562 0.9025040864944458 6.0 -0.9025043845176697 -0.9025037288665771 6.0 -0.8504744172096252 -0.8504738211631775 7.0 -0.8504740595817566 0.8504741191864014 7.0 0.9545333385467529 -0.954534649848938 4.598935604095459 -0.9545343518257141 -0.9545336365699768 4.598935604095459 -0.9545339345932007 0.9545340538024902 4.598935604095459 0.9545344710350037 0.9545334577560425 4.598935604095459 0.9545344710350037 0.9545334577560425 4.598935604095459 0.9545333385467529 -0.954534649848938 4.598935604095459 0.8504745364189148 0.8504736423492432 7.0 -0.8504740595817566 0.8504741191864014 7.0 -0.8504744172096252 -0.8504738211631775 7.0 0.8504735231399536 -0.8504747152328491 7.0 -0.9025043845176697 -0.9025037288665771 6.0 0.9025034308433533 -0.9025046825408936 6.0 0.8504735231399536 -0.8504747152328491 7.0 -0.8504744172096252 -0.8504738211631775 7.0 0.9025045037269592 0.9025035500526428 6.0 -0.9025039672851562 0.9025040864944458 6.0 -0.8504740595817566 0.8504741191864014 7.0 0.8504745364189148 0.8504736423492432 7.0 0.9025034308433533 -0.9025046825408936 6.0 0.9025045037269592 0.9025035500526428 6.0 0.8504745364189148 0.8504736423492432 7.0 0.8504735231399536 -0.8504747152328491 7.0 -0.9025039672851562 0.9025040864944458 6.0 0.9025045037269592 0.9025035500526428 6.0 0.9025050401687622 2.9289722442626953 6.009448051452637 -0.9025033712387085 2.9289727210998535 6.009448051452637 0.9545350074768066 2.925309658050537 4.607422351837158 -0.9545333385467529 2.9253101348876953 4.607422351837158 -0.9025033712387085 2.9289727210998535 6.009448051452637 0.9025050401687622 2.9289722442626953 6.009448051452637 -0.9025033712387085 2.9289727210998535 6.009448051452637 -0.9545333385467529 2.9253101348876953 4.607422351837158 0.9545344710350037 0.9545334577560425 4.598935604095459 -0.9545339345932007 0.9545340538024902 4.598935604095459 -0.9545333385467529 2.9253101348876953 4.607422351837158 0.9545350074768066 2.925309658050537 4.607422351837158 0.9545350074768066 2.925309658050537 4.607422351837158 0.9025050401687622 2.9289722442626953 6.009448051452637 + + + + + + + + + + 0.0 0.0 -1.0 0.0 0.0 -1.0 0.0 0.0 -1.0 0.0 0.0 -1.0 -0.9999999403953552 2.2351740369686013e-07 -6.70552182668871e-08 -1.0 2.2351743211856956e-07 -6.70552182668871e-08 -0.9999008774757385 2.1862656751636678e-07 0.01408354565501213 -0.9999008774757385 2.1862656751636678e-07 0.01408354565501213 1.0 -2.980232238769531e-07 4.470339831641468e-08 0.9999999403953552 -4.321336461998726e-07 2.2351700934564178e-08 1.0 -4.3213370304329146e-07 2.235169560549366e-08 1.0 -2.980232238769531e-07 4.470339831641468e-08 -2.831220911048149e-07 -1.0 -1.7881397695873602e-07 -3.7997961044311523e-07 -0.9999999403953552 -8.940698847936801e-08 -3.799796957082435e-07 -1.0 -8.940698847936801e-08 -2.831220911048149e-07 -1.0 -1.7881397695873602e-07 -1.0 2.384185791015625e-07 -1.341104365337742e-07 -1.0 2.384185791015625e-07 -1.341104365337742e-07 2.533197118737007e-07 1.0 8.195638656616211e-08 2.384185791015625e-07 1.0 1.6391278734317893e-07 2.384185791015625e-07 1.0 1.6391278734317893e-07 2.533197118737007e-07 1.0 8.195638656616211e-08 -0.9994659423828125 2.2885373596182035e-07 0.03267655521631241 -0.9994159936904907 -5.6084059906424955e-05 0.03417250141501427 -4.903030230707373e-07 -0.999900758266449 0.014083554036915302 -4.903030230707373e-07 -0.999900758266449 0.014083554036915302 2.793038049730967e-07 0.9999008774757385 0.014083568938076496 2.793038049730967e-07 0.9999008774757385 0.014083568938076496 0.9999008774757385 -5.880169169358851e-07 0.014083541929721832 0.9999008774757385 -5.880169169358851e-07 0.014083541929721832 -0.9991201162338257 -5.4629024816676974e-05 0.041940946131944656 -0.9990172386169434 2.1669733030194038e-07 0.044324908405542374 -0.9986491799354553 2.0373587972244422e-07 0.05195961520075798 -0.9986491799354553 2.0373587972244422e-07 0.05195961520075798 -5.205995421420084e-07 -0.9994659423828125 0.0326765701174736 -5.205994852985896e-07 -0.9994659423828125 0.032676566392183304 2.9053398975520395e-07 0.9995959997177124 0.02842373587191105 2.9053398975520395e-07 0.9995959997177124 0.02842373587191105 0.9994159936904907 -5.6835739087546244e-05 0.03417249023914337 0.9994659423828125 -6.028049028827809e-07 0.032676540315151215 5.150363904249389e-07 0.0 1.0 5.150363904249389e-07 0.0 1.0 5.150363904249389e-07 0.0 1.0 5.150363904249389e-07 0.0 1.0 -5.323321374817169e-07 -0.9990172386169434 0.04432494565844536 -5.323321374817169e-07 -0.9990172386169434 0.04432494565844536 -5.263181037662434e-07 -0.9986491203308105 0.05195968598127365 -5.263181037662434e-07 -0.9986491203308105 0.05195968598127365 2.886259267143032e-07 0.9986491203308105 0.05195966362953186 2.886259267143032e-07 0.9986491203308105 0.05195966362953186 2.886259267143032e-07 0.9986491203308105 0.05195966362953186 2.886259267143032e-07 0.9986491203308105 0.05195966362953186 0.9990172386169434 -6.030014674252016e-07 0.04432491585612297 0.9991201162338257 -5.53747704543639e-05 0.04194095358252525 0.9986491799354553 -6.112079518061364e-07 0.051959652453660965 0.9986491799354553 -6.112079518061364e-07 0.051959652453660965 -1.2316533348766256e-09 -0.0046622720547020435 0.9999890923500061 -1.2316533348766256e-09 -0.0046622720547020435 0.9999890923500061 -1.2316533348766256e-09 -0.0046622720547020435 0.9999890923500061 -1.2316533348766256e-09 -0.0046622720547020435 0.9999890923500061 2.564144381267397e-07 0.9999966025352478 -0.0026121772825717926 2.564144381267397e-07 0.9999966025352478 -0.0026121772825717926 2.564144381267397e-07 0.9999966025352478 -0.0026121772825717926 2.564144381267397e-07 0.9999966025352478 -0.0026121772825717926 -0.9993117451667786 -0.00016610079910606146 0.03709486126899719 -0.9993117451667786 -0.00016610079910606146 0.03709486126899719 7.69835608593894e-08 0.004306257236748934 -0.999990701675415 7.69835608593894e-08 0.004306257236748934 -0.999990701675415 7.69835608593894e-08 0.004306257236748934 -0.999990701675415 7.69835608593894e-08 0.004306257236748934 -0.999990701675415 0.9993118047714233 -0.00016669620526954532 0.03709486499428749 0.9993118047714233 -0.00016669620526954532 0.03709486499428749 + + + + + + + + + + 0.853708028793335 0.1462918519973755 0.853708028793335 0.00016813237743917853 0.9998317956924438 0.00016813237743917853 0.9998317360877991 0.1462918221950531 0.41687875986099243 0.15038259327411652 0.5629437565803528 0.14623311161994934 0.5670932531356812 0.29229798913002014 0.42102837562561035 0.29644766449928284 0.1580430120229721 0.005586783867329359 0.15262427926063538 0.1516100913286209 0.006601004861295223 0.14619146287441254 0.012019664980471134 0.00016813237743917853 0.7135531306266785 0.00016813237743917853 0.7135540843009949 0.14629174768924713 0.5674304366111755 0.1462927609682083 0.5674294829368591 0.0001691012439550832 0.5587943196296692 0.00016813237743917853 0.4127293825149536 0.0043175434693694115 0.853708028793335 0.2924155592918396 0.853708028793335 0.1462918519973755 0.9998317360877991 0.1462918221950531 0.9998318552970886 0.2924154996871948 0.5670915842056274 0.4092135429382324 0.42766785621643066 0.41317465901374817 0.713555097579956 0.2924153804779053 0.5674314498901367 0.29241642355918884 0.9998318552970886 0.43853920698165894 0.8537081480026245 0.4385392665863037 0.14720562100410461 0.29763343930244446 0.0011823981767520308 0.29221469163894653 0.43437695503234863 0.5154602527618408 0.5662007331848145 0.5117148756980896 0.5644786357879639 0.5849537253379822 0.44025471806526184 0.5884833335876465 0.7102342247962952 0.4092837870121002 0.5707541108131409 0.4092848598957062 0.9965101480484009 0.5554076433181763 0.8570300936698914 0.555407702922821 0.13955222070217133 0.4142983853816986 0.00016813237743917853 0.40912580490112305 0.7214940786361694 0.46781307458877563 0.8457685708999634 0.46781307458877563 0.8457684516906738 0.5920873880386353 0.7214942574501038 0.5920873880386353 0.5745562314987183 0.5117197632789612 0.7064335942268372 0.51171875 0.7026327252388 0.5848795175552368 0.5783581733703613 0.584880530834198 0.7176926732063293 0.39465245604515076 0.8495699167251587 0.39465245604515076 0.8457685708999634 0.46781307458877563 0.7214940786361694 0.46781307458877563 0.00016824003250803798 0.5116311311721802 0.13195458054542542 0.5165219306945801 0.12544254958629608 0.5894912481307983 0.0012538435403257608 0.5848821997642517 0.8495699167251587 0.39465245604515076 0.7176926732063293 0.39465245604515076 0.7176927328109741 0.24659334123134613 0.8495699763298035 0.2465934455394745 0.7138913869857788 0.1441582441329956 0.8533715605735779 0.14415842294692993 0.8495699763298035 0.2465934455394745 0.7176927328109741 0.24659334123134613 0.28639882802963257 0.520354688167572 0.2837550938129425 0.4178834557533264 0.7138914465904236 0.00016813237743917853 0.8533717393875122 0.00016831178800202906 0.8533715605735779 0.14415842294692993 0.7138913869857788 0.1441582441329956 0.28341880440711975 0.4202575087547302 0.2798847556114197 0.5227020382881165 + + + + + + + + + 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 + + + + + + + + + + + + + + + + +

0 1 2 3

+

4 5 6 7

+

8 9 10 11

+

12 13 14 15

+

16 5 4 17

+

18 19 20 21

+

7 6 22 23

+

14 13 24 25

+

18 21 26 27

+

10 9 28 29

+

30 31 32 33

+

25 24 34 35

+

27 26 36 37

+

29 28 38 39

+

40 41 42 43

+

44 45 46 47

+

48 49 50 51

+

52 53 54 55

+

23 22 31 30

+

35 34 45 44

+

56 57 58 59

+

39 38 53 52

+

60 61 62 63

+

23 30 64 65

+

66 67 68 69

+

53 38 70 71

+
+
+
+
+ + + + 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 + + id-skelbones-2-0 id-skelbones-2-1 id-skelbones-2-2 id-skelbones-2-3 id-skelbones-2-4 + + + + + + + + 1.0 -0.0 0.0 -0.0 -0.0 7.549790126404332e-08 1.0 1.0 0.0 -1.0 7.549790126404332e-08 7.549790126404332e-08 -0.0 0.0 -0.0 1.0 1.0 -0.0 0.0 -0.0 -0.0 7.549790126404332e-08 1.0 -1.0 0.0 -1.0 7.549790126404332e-08 7.549790126404332e-08 -0.0 0.0 -0.0 1.0 1.0 3.019916050561733e-07 0.0 -9.11989328999073e-14 -2.2799733224976824e-14 7.549790126404332e-08 1.0 -3.0 3.019916050561733e-07 -1.0 7.549790126404332e-08 7.549789415861596e-08 -0.0 0.0 -0.0 1.0 1.0 -0.0 -0.0 4.559946644995365e-14 -0.0 7.549790126404332e-08 1.0 -5.0 0.0 -1.0 7.549790126404332e-08 7.54979225803254e-08 -0.0 0.0 -0.0 1.0 1.0 -0.0 1.6940658945086007e-21 4.559945628555828e-14 -0.0 1.0 -0.0 -4.5298742179511464e-07 5.621949100372871e-15 -0.0 1.0 -5.0 -0.0 0.0 -0.0 1.0 + + + + + + + + 1.0 1.0 1.0 1.0 0.9710749387741089 1.0 0.5 0.5 0.4995494484901428 0.5004505515098572 1.0 0.9998676180839539 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 0.9998676180839539 1.0 1.0 0.9710749387741089 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.4995494484901428 0.5004505515098572 0.5 0.5 0.5 0.5 0.5 0.5 0.3333333432674408 0.6666666865348816 0.6666666865348816 0.3333333432674408 1.0 1.0 0.4999999403953552 0.5000000596046448 0.5 0.5 0.5 0.5 0.49981489777565 0.5001850128173828 0.49981489777565 0.5001850128173828 0.4999999403953552 0.5000000596046448 0.999976634979248 1.0 1.0 1.0 0.6666666865348816 0.3333333432674408 0.6666667461395264 0.333333283662796 1.0 1.0 0.33317145705223083 0.6668285131454468 0.3333333432674408 0.6666666865348816 1.0 0.999976634979248 0.6666667461395264 0.333333283662796 0.33317145705223083 0.6668285131454468 0.999976634979248 1.0 0.3333333432674408 0.6666666865348816 0.33317145705223083 0.6668285131454468 0.33317145705223083 0.6668285131454468 0.3333333432674408 0.6666666865348816 0.49981483817100525 0.5001851320266724 0.5 0.5 0.3333333432674408 0.6666666865348816 0.33317145705223083 0.6668285131454468 0.3333333432674408 0.6666666865348816 0.5 0.5 0.49981489777565 0.5001850128173828 0.5 0.5 0.5 0.5 0.49981483817100525 0.5001851320266724 0.49981483817100525 0.5001851320266724 0.33317145705223083 0.6668285131454468 + + + + + + + + + + + + + + 1 1 1 1 1 1 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 1 1 2 2 2 2 2 2 1 1 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 + 0 0 0 1 0 2 0 3 1 4 1 5 1 6 2 7 1 8 2 9 0 10 1 11 1 12 0 13 0 14 1 15 1 16 0 17 0 18 0 19 1 20 0 21 0 22 1 23 2 24 3 25 2 26 3 27 1 28 2 29 1 30 2 31 1 32 2 33 1 34 2 35 1 36 2 37 1 38 2 39 2 40 3 41 3 42 2 43 3 44 3 45 2 46 3 47 2 48 3 49 2 50 3 51 2 52 3 53 2 54 3 55 2 56 3 57 3 58 3 59 3 60 3 61 3 62 2 63 3 64 2 65 3 66 3 67 2 68 3 69 2 70 3 71 3 72 3 73 3 74 2 75 2 76 3 77 3 78 3 79 2 80 3 81 2 82 3 83 2 84 3 85 2 86 3 87 2 88 3 89 2 90 3 91 2 92 3 93 2 94 3 95 2 96 3 97 2 98 3 99 2 100 3 101 2 102 3 103 2 104 3 105 2 106 3 107 2 108 3 109 2 110 3 111 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 + + 1.0 0.0 0.0 0.0 0.0 7.549790126404332e-08 -1.0 0.0 0.0 1.0 7.549790126404332e-08 -1.0 0.0 0.0 0.0 1.0 + + 1.0 0.0 0.0 0.0 0.0 1.0 0.0 2.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 + + 1.0 -2.2799733224976824e-14 3.019916050561733e-07 0.0 2.2799733224976824e-14 1.0 0.0 2.0 -3.019916050561733e-07 0.0 1.0 7.105427357601002e-15 0.0 0.0 0.0 1.0 + + 1.0 2.2799733224976824e-14 -3.019916050561733e-07 -3.3881317890172014e-21 -2.2799733224976824e-14 1.0 0.0 2.0 3.019916050561733e-07 0.0 1.0 -2.8421722982931164e-14 0.0 0.0 0.0 1.0 + + + 1.0 3.019916050561733e-07 -1.6940658945086007e-21 -3.3881317890172014e-21 -2.8421682325349695e-14 7.549790126404332e-08 1.0 2.0 3.019916050561733e-07 -1.0 7.549790126404332e-08 -2.8421722982931164e-14 0.0 0.0 0.0 1.0 + + + + + + 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 + + #id-bone-3 + + + + + + + + + + + + + + 0.0 0.041666666666666664 0.08333333333333334 0.125 0.16666666666666666 0.20833333333333334 0.24999999999999997 0.29166666666666663 0.3333333333333333 0.37499999999999994 0.41666666666666663 0.4583333333333333 0.49999999999999994 0.5416666666666666 0.5833333333333334 + + + + + + + + 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 + + + + + + + + LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR + + + + + + + + + + + + + + + + 0.0 0.041666666666666664 0.08333333333333334 0.125 0.16666666666666666 0.20833333333333334 0.24999999999999997 0.29166666666666663 0.3333333333333333 0.37499999999999994 0.41666666666666663 0.4583333333333333 0.49999999999999994 0.5416666666666666 0.5833333333333334 + + + + + + + + 1.0 3.019916050561733e-07 -1.6940658945086007e-21 -3.3881317890172014e-21 -2.8421682325349695e-14 7.549790126404332e-08 1.0 2.0 3.019916050561733e-07 -1.0 7.549790126404332e-08 -2.8421722982931164e-14 0.0 0.0 0.0 1.0 1.0 3.0198953027138487e-07 -1.5963781407890565e-09 4.261721642251359e-09 -2.1282611228912174e-09 7.553694558737334e-08 1.0 1.9999998807907104 3.0198589229257777e-07 -1.0 7.570474735985044e-08 4.5565684558823705e-10 0.0 0.0 0.0 1.0 1.0 3.019813448190689e-07 -4.2969077185261995e-09 -2.3610937205376104e-08 -7.037897375994362e-09 7.6121068559587e-08 1.0 2.000000238418579 3.0177761800587177e-07 -1.0 7.702328730374575e-08 7.712515071034431e-09 0.0 0.0 0.0 1.0 1.0 3.0174851417541504e-07 -9.467839845456183e-09 4.011599230580032e-08 -1.7462298274040222e-10 7.724156603217125e-08 1.0000001192092896 2.000000238418579 3.019813448190689e-07 -1.0 7.700873538851738e-08 -1.6298145055770874e-09 0.0 0.0 0.0 1.0 0.9999998807907104 3.026798367500305e-07 8.192728273570538e-09 1.9393337424844503e-07 -3.0253431759774685e-08 7.59027898311615e-08 0.9999998807907104 1.9999990463256836 3.022141754627228e-07 -0.9999999403953552 7.613562047481537e-08 -1.7695128917694092e-08 0.0 0.0 0.0 1.0 1.0 3.012828528881073e-07 6.184563972055912e-09 2.486049197614193e-07 5.3958501666784286e-08 7.82310962677002e-08 1.0 1.9999995231628418 3.022141754627228e-07 -1.0 7.543712854385376e-08 -5.587935447692871e-09 0.0 0.0 0.0 1.0 1.0 3.050081431865692e-07 -1.2660166248679161e-08 -3.2654497772455215e-07 2.240994945168495e-09 7.264316082000732e-08 0.9999999403953552 1.999999761581421 3.012828528881073e-07 -0.9999999403953552 7.264316082000732e-08 1.1175870895385742e-08 0.0 0.0 0.0 1.0 1.0 3.026798367500305e-07 1.8044374883174896e-09 4.7672074288129807e-07 -4.5372871682047844e-08 6.891787052154541e-08 1.0000001192092896 2.000000238418579 3.0174851417541504e-07 -1.0 7.636845111846924e-08 0.0 0.0 0.0 0.0 1.0 1.0 3.0174851417541504e-07 -1.949956640601158e-08 -3.995373845100403e-07 -9.167706593871117e-09 7.82310962677002e-08 1.0 2.000000238418579 3.022141754627228e-07 -1.0 7.078051567077637e-08 -1.4901161193847656e-08 0.0 0.0 0.0 1.0 1.0 2.9546208679676056e-07 2.4141627363860607e-08 2.2811582311987877e-07 3.8853613659739494e-09 6.705522537231445e-08 1.0 2.000000238418579 3.0151568353176117e-07 -1.0000001192092896 7.450580596923828e-08 -1.4901161193847656e-08 0.0 0.0 0.0 1.0 1.0 3.0384398996829987e-07 -1.0943040251731873e-08 -2.1746382117271423e-07 -2.8172507882118225e-08 7.695052772760391e-08 1.000000238418579 2.000000476837158 2.9779039323329926e-07 -1.0000001192092896 7.566995918750763e-08 -1.862645149230957e-09 0.0 0.0 0.0 1.0 0.9999999403953552 3.0547380447387695e-07 -5.3551048040390015e-09 -3.5390257835388184e-08 -8.614733815193176e-09 8.009374141693115e-08 0.9999998807907104 1.9999996423721313 2.980232238769531e-07 -0.9999998807907104 8.195638656616211e-08 2.9802322387695312e-08 0.0 0.0 0.0 1.0 1.0 3.026798367500305e-07 9.19681042432785e-09 3.296881914138794e-07 -3.655441105365753e-08 7.729977369308472e-08 0.9999999403953552 1.999999761581421 3.129243850708008e-07 -0.9999999403953552 7.636845111846924e-08 1.4901161193847656e-08 0.0 0.0 0.0 1.0 1.0 2.975575625896454e-07 8.381903171539307e-09 1.1548399925231934e-07 1.1175870895385742e-08 7.636845111846924e-08 1.0 2.000000476837158 3.0314549803733826e-07 -1.0 7.636845111846924e-08 1.4901161193847656e-08 0.0 0.0 0.0 1.0 1.0 3.03611159324646e-07 -2.7939677238464355e-09 3.725290298461914e-09 8.381903171539307e-09 7.450580596923828e-08 1.0 2.000000476837158 2.905726432800293e-07 -1.0 7.450580596923828e-08 1.4901161193847656e-08 0.0 0.0 0.0 1.0 + + + + + + + + LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR + + + + + + + + + + + + + + + + 0.0 0.041666666666666664 0.08333333333333334 0.125 0.16666666666666666 0.20833333333333334 0.24999999999999997 0.29166666666666663 0.3333333333333333 0.37499999999999994 0.41666666666666663 0.4583333333333333 0.49999999999999994 0.5416666666666666 0.5833333333333334 + + + + + + + + 1.0 0.0 0.0 0.0 0.0 1.0 0.0 2.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.99998539686203 0.005406782031059265 2.0841630504753184e-11 0.0 -0.005406782031059265 0.99998539686203 -5.684341886080802e-14 2.0 -2.0841633974200136e-11 -5.684341886080802e-14 1.0 0.0 0.0 0.0 0.0 1.0 0.9996087551116943 0.02796982228755951 1.4218640154162188e-10 0.0 -0.02796982228755951 0.9996087551116943 -1.9895196601282805e-12 2.0 -1.4218648480834872e-10 -1.9895196601282805e-12 1.0 0.0 0.0 0.0 0.0 1.0 0.998104453086853 0.06154264137148857 4.495371852542007e-10 0.0 -0.06154264137148857 0.998104453086853 -1.3848477919964353e-11 2.0 -4.495372962765032e-10 -1.3848477919964353e-11 1.0 3.552713678800501e-15 0.0 0.0 0.0 1.0 0.9950810074806213 0.09906430542469025 1.1069893890436333e-09 0.0 -0.09906430542469025 0.9950810074806213 -5.496758603840135e-11 2.0 -1.1069891669990284e-09 -5.496758603840135e-11 1.0 1.1546319456101628e-14 0.0 0.0 0.0 1.0 0.9903477430343628 0.1386050283908844 2.387212427734653e-09 0.0 -0.1386050283908844 0.9903477430343628 -1.6624568388579064e-10 1.9999998807907104 -2.387212205690048e-09 -1.6623857845843304e-10 1.0 -1.4210854715202004e-14 0.0 0.0 0.0 1.0 0.9839622974395752 0.1783764809370041 4.3626333656732186e-09 0.0 -0.1783764809370041 0.9839622974395752 -3.922409064216481e-10 2.000000238418579 -4.362632921584009e-09 -3.922409064216481e-10 1.0 1.4210854715202004e-14 0.0 0.0 0.0 1.0 0.9762129187583923 0.21681401133537292 7.393061718374838e-09 0.0 -0.21681401133537292 0.9762129187583923 -8.111058491522272e-10 2.0 -7.393062162464048e-09 -8.111058491522272e-10 1.0 0.0 0.0 0.0 0.0 1.0 0.9676145911216736 0.2524321675300598 1.2406852434310167e-08 0.0 -0.2524321675300598 0.9676145911216736 -1.5917152040856308e-09 2.0 -1.2406852434310167e-08 -1.5917152040856308e-09 1.0 -1.4210854715202004e-14 0.0 0.0 0.0 1.0 0.9592233300209045 0.28264933824539185 2.133943155513407e-08 0.0 -0.28264933824539185 0.9592233300209045 -3.078554300373071e-09 2.0 -2.133943155513407e-08 -3.078554300373071e-09 1.0 -1.4210854715202004e-14 0.0 0.0 0.0 1.0 0.950993537902832 0.3092101812362671 0.0005914760404266417 4.874891601502895e-09 -0.30921056866645813 0.9509932994842529 0.000737061258405447 2.000000238418579 -0.0003345829900354147 -0.0008838316425681114 0.9999995827674866 -1.0477378964424133e-09 0.0 0.0 0.0 1.0 0.9428225159645081 0.333288311958313 0.002140357159078121 6.129266694188118e-08 -0.33329325914382935 0.9428195953369141 0.002598921302706003 2.0 -0.0011517815291881561 -0.003163686953485012 0.9999943375587463 -9.313225746154785e-10 0.0 0.0 0.0 1.0 0.9348953366279602 0.3548996150493622 0.00411301851272583 3.3527612686157227e-08 -0.35491713881492615 0.9348850250244141 0.004878699779510498 2.0 -0.00211375136859715 -0.006020858883857727 0.9999796152114868 -4.6566128730773926e-09 0.0 0.0 0.0 1.0 0.9280365705490112 0.37244030833244324 0.006034713238477707 1.1874362826347351e-08 -0.3724772334098816 0.9280148148536682 0.007022818550467491 2.0 -0.0029847193509340286 -0.008765213191509247 0.9999571442604065 1.4901161193847656e-08 0.0 0.0 0.0 1.0 0.9249669909477234 0.3799836039543152 0.006962517276406288 -5.052424967288971e-08 -0.38003233075141907 0.9249383211135864 0.008036060258746147 2.0 -0.003386327065527439 -0.010079077444970608 0.9999434947967529 7.450580596923828e-09 0.0 0.0 0.0 1.0 + + + + + + + + LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR + + + + + + + + + + + + + + + + 0.0 0.041666666666666664 0.08333333333333334 0.125 0.16666666666666666 0.20833333333333334 0.24999999999999997 0.29166666666666663 0.3333333333333333 0.37499999999999994 0.41666666666666663 0.4583333333333333 0.49999999999999994 0.5416666666666666 0.5833333333333334 + + + + + + + + 1.0 -2.2799733224976824e-14 3.019916050561733e-07 0.0 2.2799733224976824e-14 1.0 0.0 2.0 -3.019916050561733e-07 0.0 1.0 7.105427357601002e-15 0.0 0.0 0.0 1.0 0.9998303651809692 0.01841968111693859 4.1081955714616925e-05 -1.1622647289044608e-16 -0.018419725820422173 0.9998288154602051 0.0017628732603043318 2.0 -8.603356945968699e-06 -0.0017633308889344335 0.9999984502792358 -2.001030634593559e-15 0.0 0.0 0.0 1.0 0.9955697059631348 0.09402430802583694 0.0005926893791183829 -5.967448757360216e-16 -0.09402582794427872 0.9955291152000427 0.008997068740427494 2.0 0.0002559037529863417 -0.009012939408421516 0.9999593496322632 9.993741945102386e-15 0.0 0.0 0.0 1.0 0.9817259907722473 0.19028612971305847 0.0022829289082437754 7.4505792646561986e-09 -0.19029591977596283 0.9815584421157837 0.018178554251790047 1.9999998807907104 0.0012182984501123428 -0.018280791118741035 0.9998321533203125 1.5727003033205733e-14 0.0 0.0 0.0 1.0 0.957146942615509 0.2895524203777313 0.005411616992205381 -1.915134717478395e-15 -0.28958943486213684 0.9567543268203735 0.027551069855690002 1.9999998807907104 0.00279989093542099 -0.027937568724155426 0.9996057748794556 6.661338147750939e-16 0.0 0.0 0.0 1.0 0.9201236367225647 0.3914887011051178 0.010444517247378826 -2.4424906541753444e-15 -0.3915977478027344 0.9193943738937378 0.03694813698530197 1.9999996423721313 0.004862145520746708 -0.0380869023501873 0.9992626309394836 -2.248201624865942e-14 0.0 0.0 0.0 1.0 0.8738107681274414 0.48596465587615967 0.017122987657785416 -2.7200464103316335e-15 -0.4862149953842163 0.8726656436920166 0.0452730767428875 2.0 0.007058470044285059 -0.04788554832339287 0.9988278746604919 5.928590951498336e-14 0.0 0.0 0.0 1.0 0.8255134224891663 0.5638235807418823 0.025112418457865715 2.9802318834981634e-08 -0.5643211603164673 0.8239501118659973 0.05145721137523651 2.000000238418579 0.008321406319737434 -0.05665009096264839 0.9983594417572021 2.6423307986078726e-14 0.0 0.0 0.0 1.0 0.7873582243919373 0.6155419945716858 0.03428023308515549 -2.980232594040899e-08 -0.616461992263794 0.7855148911476135 0.054230671375989914 1.999999761581421 0.0064536212012171745 -0.06383142620325089 0.9979398250579834 4.4853010194856324e-14 0.0 0.0 0.0 1.0 0.7748236656188965 0.6305439472198486 0.04541659727692604 -1.1920928955078125e-07 -0.6321731805801392 0.7730801701545715 0.05200223997235298 2.000000238418579 -0.0023209722712635994 -0.06900371611118317 0.9976137280464172 1.9539925233402755e-14 0.0 0.0 0.0 1.0 0.8074691891670227 0.5863681435585022 0.06454403698444366 6.511982064694166e-08 -0.5886243581771851 0.8080913424491882 0.022573528811335564 1.999999761581421 -0.03892108052968979 -0.05621962994337082 0.9976595044136047 -1.3969838619232178e-09 0.0 0.0 0.0 1.0 0.8808358907699585 0.4656791687011719 0.08527038991451263 1.8748687580227852e-07 -0.46402132511138916 0.8849409818649292 -0.039543673396110535 1.9999998807907104 -0.09387392550706863 -0.0047357818111777306 0.9955728650093079 -1.30385160446167e-08 0.0 0.0 0.0 1.0 0.9460473656654358 0.3024177849292755 0.11635156720876694 7.392372936010361e-08 -0.29019874334335327 0.950512170791626 -0.11095613986253738 1.9999995231628418 -0.14414867758750916 0.07120470702648163 0.9869908094406128 -1.862645149230957e-09 0.0 0.0 0.0 1.0 0.9779367446899414 0.14079925417900085 0.15432208776474 2.561137080192566e-07 -0.11382761597633362 0.9785844683647156 -0.17151015996932983 1.9999998807907104 -0.17516569793224335 0.15015996992588043 0.9730204939842224 -1.30385160446167e-08 0.0 0.0 0.0 1.0 0.9825076460838318 0.06423753499984741 0.17479248344898224 3.725290298461914e-08 -0.029007764533162117 0.9799563884735107 -0.19708888232707977 1.9999998807907104 -0.1839495152235031 0.1885710060596466 0.9646779298782349 2.2351741790771484e-08 0.0 0.0 0.0 1.0 + + + + + + + + LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR + + + + + + + + + + + + + + + + 0.0 0.041666666666666664 0.08333333333333334 0.125 0.16666666666666666 0.20833333333333334 0.24999999999999997 0.29166666666666663 0.3333333333333333 0.37499999999999994 0.41666666666666663 0.4583333333333333 0.49999999999999994 0.5416666666666666 0.5833333333333334 + + + + + + + + 1.0 2.2799733224976824e-14 -3.019916050561733e-07 -3.3881317890172014e-21 -2.2799733224976824e-14 1.0 0.0 2.0 3.019916050561733e-07 0.0 1.0 -2.8421722982931164e-14 0.0 0.0 0.0 1.0 0.9998536109924316 0.01711064949631691 0.00039659717003814876 4.261721642251359e-09 -0.0171112772077322 0.9998522400856018 0.0016349750803783536 1.9999998807907104 -0.00036856307997368276 -0.001641521812416613 0.9999986290931702 4.5565684558823705e-10 0.0 0.0 0.0 1.0 0.99617999792099 0.08729173988103867 0.0023786951787769794 -2.3610937205376104e-08 -0.08730863034725189 0.9961469769477844 0.008274005725979805 2.000000238418579 -0.0016472784336656332 -0.00845007598400116 0.9999629259109497 7.712515071034431e-09 0.0 0.0 0.0 1.0 0.9842609167098999 0.17661483585834503 0.00612880103290081 4.011599230580032e-08 -0.17669369280338287 0.984127402305603 0.01651296205818653 2.000000238418579 -0.0031150872819125652 -0.017335979267954826 0.9998448491096497 -1.6298145055770874e-09 0.0 0.0 0.0 1.0 0.9631130695343018 0.2688666880130768 0.011120881885290146 1.9393337424844503e-07 -0.2690659761428833 0.9628040194511414 0.02473120391368866 1.9999990463256836 -0.0040578339248895645 -0.026811204850673676 0.9996322393417358 -1.7695128917694092e-08 0.0 0.0 0.0 1.0 0.931238055229187 0.36400336027145386 0.017243409529328346 2.486049197614193e-07 -0.36438867449760437 0.9306660890579224 0.032886967062950134 1.9999995231628418 -0.004076894372701645 -0.036908891052007675 0.999310314655304 -5.587935447692871e-09 0.0 0.0 0.0 1.0 0.8912754058837891 0.4528215229511261 0.02409932389855385 -3.2654497772455215e-07 -0.45345044136047363 0.8903771638870239 0.04014023765921593 1.999999761581421 -0.003281119279563427 -0.04670385271310806 0.9989033341407776 1.1175870895385742e-08 0.0 0.0 0.0 1.0 0.8494575619697571 0.5267446041107178 0.031019873917102814 4.7672074288129807e-07 -0.5276526808738708 0.8482257723808289 0.045782655477523804 2.000000238418579 -0.002196100540459156 -0.0552581250667572 0.9984697103500366 0.0 0.0 0.0 0.0 1.0 0.8163167238235474 0.5764156579971313 0.037040553987026215 -3.995373845100403e-07 -0.5776014924049377 0.8148404955863953 0.0491071380674839 2.000000238418579 -0.00187602115329355 -0.06148165464401245 0.9981064200401306 -1.4901161193847656e-08 0.0 0.0 0.0 1.0 0.8055055141448975 0.5911691188812256 0.040987249463796616 2.2811582311987877e-07 -0.592576265335083 0.8039996027946472 0.04937676340341568 2.000000238418579 -0.0037637173663824797 -0.06406132876873016 0.9979389309883118 -1.4901161193847656e-08 0.0 0.0 0.0 1.0 0.8542895317077637 0.5183570981025696 0.038668498396873474 -2.1746382117271423e-07 -0.5196048021316528 0.8536322116851807 0.03637533634901047 2.000000476837158 -0.014153261668980122 -0.05116738751530647 0.9985899329185486 -1.862645149230957e-09 0.0 0.0 0.0 1.0 0.9508073925971985 0.30806994438171387 0.03252604231238365 -3.5390257835388184e-08 -0.3083057403564453 0.9512842297554016 0.002376377582550049 1.9999996423721313 -0.030209438875317574 -0.012287446297705173 0.9994679689407349 2.9802322387695312e-08 0.0 0.0 0.0 1.0 0.9992246031761169 0.01764739491045475 0.03519628569483757 3.296881914138794e-07 -0.016185099259018898 0.999011218547821 -0.041407715529203415 1.999999761581421 -0.03589221462607384 0.04080595448613167 0.9985222220420837 1.4901161193847656e-08 0.0 0.0 0.0 1.0 0.9651545882225037 -0.25707417726516724 0.04888274520635605 1.1548399925231934e-07 0.26034310460090637 0.9621813893318176 -0.08017843961715698 2.000000476837158 -0.026422247290611267 0.09011086821556091 0.9955812096595764 1.4901161193847656e-08 0.0 0.0 0.0 1.0 0.9240012168884277 -0.37787526845932007 0.05858353525400162 3.725290298461914e-09 0.38199254870414734 0.919124186038971 -0.09639789164066315 2.000000476837158 -0.01741916500031948 0.11145025491714478 0.9936173558235168 1.4901161193847656e-08 0.0 0.0 0.0 1.0 + + + + + + + + LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR + + + + + + + + + + + + + + + + 0.0 0.041666666666666664 0.08333333333333334 0.125 0.16666666666666666 0.20833333333333334 0.24999999999999997 0.29166666666666663 0.3333333333333333 0.37499999999999994 0.41666666666666663 0.4583333333333333 0.49999999999999994 0.5416666666666666 0.5833333333333334 + + + + + + + + 1.0 0.0 0.0 0.0 0.0 7.549790126404332e-08 -1.0 0.0 0.0 1.0 7.549790126404332e-08 -1.0 0.0 0.0 0.0 1.0 1.0 0.0 0.0 0.0 0.0 7.549790126404332e-08 -1.0 0.0 0.0 1.0 7.549790126404332e-08 -0.9340413808822632 0.0 0.0 0.0 1.0 1.0 0.0 0.0 0.0 0.0 7.549790126404332e-08 -1.0 1.7763568394002505e-15 0.0 1.0 7.549790126404332e-08 -0.6646065711975098 0.0 0.0 0.0 1.0 1.0 0.0 0.0 0.0 0.0 7.549790126404332e-08 -1.0 -7.105427357601002e-15 0.0 1.0 7.549790126404332e-08 -0.3219858407974243 0.0 0.0 0.0 1.0 1.0 0.0 0.0 0.0 0.0 7.549790126404332e-08 -1.0 -7.105427357601002e-15 0.0 1.0 7.549790126404332e-08 0.03573417663574219 0.0 0.0 0.0 1.0 1.0 0.0 0.0 0.0 0.0 7.549790126404332e-08 -1.0 -1.4210854715202004e-14 0.0 1.0 7.549790126404332e-08 0.41436636447906494 0.0 0.0 0.0 1.0 1.0 0.0 0.0 0.0 0.0 7.549790126404332e-08 -1.0 -1.4210854715202004e-14 0.0 1.0 7.549790126404332e-08 0.7831066846847534 0.0 0.0 0.0 1.0 1.0 0.0 0.0 0.0 0.0 7.549790126404332e-08 -1.0 -2.842170943040401e-14 0.0 1.0 7.549790126404332e-08 1.107043743133545 0.0 0.0 0.0 1.0 1.0 0.0 0.0 0.0 0.0 7.549790126404332e-08 -1.0 0.0 0.0 1.0 7.549790126404332e-08 1.336852788925171 0.0 0.0 0.0 1.0 1.0 0.0 0.0 0.0 0.0 7.549790126404332e-08 -1.0 0.0 0.0 1.0 7.549790126404332e-08 1.407799482345581 0.0 0.0 0.0 1.0 0.9968345761299133 0.07932797819375992 0.005282554775476456 0.0 0.004770305939018726 0.006645471788942814 -0.999966561794281 -1.4210854715202004e-14 -0.07936043292284012 0.9968264102935791 0.006246017292141914 1.193772792816162 0.0 0.0 0.0 1.0 0.9586331844329834 0.2838432192802429 0.021341901272535324 0.0 0.014647725969552994 0.02568591572344303 -0.9995627403259277 0.0 -0.2842673063278198 0.958526611328125 0.02046571485698223 0.6453161239624023 0.0 0.0 0.0 1.0 0.8506482243537903 0.5237787365913391 0.04531409963965416 0.0 0.02114533632993698 0.05203593522310257 -0.998421311378479 -7.105427357601002e-15 -0.5253098607063293 0.8502635359764099 0.033188797533512115 -0.037257254123687744 0.0 0.0 0.0 1.0 0.6941251158714294 0.7164199352264404 0.0702333077788353 0.0 0.020735301077365875 0.07762672752141953 -0.9967668652534485 3.552713678800501e-15 -0.7195556163787842 0.6933372616767883 0.03902747482061386 -0.6890351176261902 0.0 0.0 0.0 1.0 0.6061614155769348 0.7910918593406677 0.08210963010787964 0.0 0.018376974388957024 0.08927963674068451 -0.9958370327949524 0.0 -0.7951292991638184 0.6051469445228577 0.039580002427101135 -1.0 0.0 0.0 0.0 1.0 + + + + + + + + LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR + + + + + + + + + + + + + + + + 0.0 0.041666666666666664 0.08333333333333333 0.125 0.16666666666666666 0.20833333333333331 0.25 0.29166666666666663 0.3333333333333333 0.375 0.41666666666666663 0.4583333333333333 0.5 0.5416666666666666 0.5833333333333333 0.625 0.6666666666666666 0.7083333333333333 0.75 0.7916666666666666 0.8333333333333333 + + + + + + + + 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 + + + + + + + + LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR + + + + + + + + + + + + + + + + 0.0 0.041666666666666664 0.08333333333333333 0.125 0.16666666666666666 0.20833333333333331 0.25 0.29166666666666663 0.3333333333333333 0.375 0.41666666666666663 0.4583333333333333 0.5 0.5416666666666666 0.5833333333333333 0.625 0.6666666666666666 0.7083333333333333 0.75 0.7916666666666666 0.8333333333333333 + + + + + + + + 1.0 3.019916050561733e-07 -1.6940658945086007e-21 -3.3881317890172014e-21 -2.8421682325349695e-14 7.549790126404332e-08 1.0 2.0 3.019916050561733e-07 -1.0 7.549790126404332e-08 -2.8421722982931164e-14 0.0 0.0 0.0 1.0 1.0 2.980232238769531e-07 2.740863092043355e-16 4.542739340078483e-15 -2.787898662197797e-14 7.549790126404332e-08 1.0 1.999999761581421 2.980232238769531e-07 -1.0 7.549790126404332e-08 -6.111760132276184e-14 0.0 0.0 0.0 1.0 1.0 2.980232238769531e-07 -4.440892098500626e-16 -3.693798874626966e-15 -2.509833839240208e-14 7.549790836947068e-08 1.0 2.0 2.980232238769531e-07 -1.0 7.549790836947068e-08 1.9710300828545274e-14 0.0 0.0 0.0 1.0 1.0 2.980232238769531e-07 0.0 -2.5217366850282044e-14 -2.7558835272970157e-14 7.549790126404332e-08 1.0 1.999999761581421 2.980232238769531e-07 -1.0 7.549790126404332e-08 1.2755667358412166e-14 0.0 0.0 0.0 1.0 1.0 2.980232238769531e-07 -1.7763568394002505e-15 -5.464224111704184e-14 -2.4811610963492922e-14 7.549790126404332e-08 1.0 2.0 2.980232238769531e-07 -1.0 7.549790126404332e-08 -8.798196444667356e-15 0.0 0.0 0.0 1.0 1.0 3.0199157663446385e-07 -7.111923615526905e-22 -2.0328790734103208e-20 -2.84216806312838e-14 7.549789415861596e-08 1.0 1.999999761581421 3.019916050561733e-07 -1.0 7.549789415861596e-08 -1.4210912313442417e-14 0.0 0.0 0.0 1.0 1.0 2.980232238769531e-07 -4.440892098500626e-16 1.5987211554602254e-14 -3.019806626980426e-14 7.549790126404332e-08 1.0 1.999999761581421 2.980232238769531e-07 -1.0 7.549790836947068e-08 -3.552713678800501e-15 0.0 0.0 0.0 1.0 1.0 2.980232238769531e-07 -8.881784197001252e-16 -4.440892098500626e-15 -2.842170943040401e-14 7.549789415861596e-08 1.0 2.000000238418579 2.980232238769531e-07 -0.9999999403953552 7.549789415861596e-08 2.1316282072803006e-14 0.0 0.0 0.0 1.0 1.0000001192092896 2.980232238769531e-07 -1.7763568394002505e-15 1.3322676295501878e-14 -2.842170943040401e-14 7.549790836947068e-08 1.0 1.999999761581421 2.980232238769531e-07 -1.0000001192092896 7.549790126404332e-08 -1.0658141036401503e-14 0.0 0.0 0.0 1.0 1.0 2.980232238769531e-07 -4.440892098500626e-16 1.3322676295501878e-15 -2.7977620220553945e-14 7.549790126404332e-08 1.0 2.000000238418579 2.980232238769531e-07 -1.0 7.549789415861596e-08 -2.3092638912203256e-14 0.0 0.0 0.0 1.0 1.0 3.019916050561733e-07 -7.9063885886186065e-22 -1.0164395367051604e-20 -2.8421682325349695e-14 7.549790126404332e-08 1.0 2.0 3.019916050561733e-07 -1.0 7.549790126404332e-08 2.842169587787685e-14 0.0 0.0 0.0 1.0 1.0 3.2782554626464844e-07 1.3322676295501878e-15 5.6066262743570405e-15 -2.693678613496786e-14 7.549790836947068e-08 1.0 2.0 3.2782554626464844e-07 -1.0 7.549789415861596e-08 -7.105427357601002e-15 0.0 0.0 0.0 1.0 1.0 2.980232238769531e-07 -1.6653345369377348e-15 9.325873406851315e-15 -2.3314683517128287e-14 7.549790836947068e-08 1.0 2.000000238418579 2.980232238769531e-07 -1.0000001192092896 7.549789415861596e-08 -7.105427357601002e-14 0.0 0.0 0.0 1.0 1.0 2.682209014892578e-07 1.3322676295501878e-15 -5.329070518200751e-15 -3.019806626980426e-14 7.549791547489804e-08 1.0 1.999999761581421 2.682209014892578e-07 -1.0000001192092896 7.549790126404332e-08 -3.552713678800501e-14 0.0 0.0 0.0 1.0 0.9999999403953552 2.980232238769531e-07 -3.1086244689504383e-15 3.552713678800501e-15 -2.842170943040401e-14 7.549789415861596e-08 1.0 2.0 2.980232238769531e-07 -0.9999999403953552 7.549789415861596e-08 -4.263256414560601e-14 0.0 0.0 0.0 1.0 1.0 3.0199157663446385e-07 -2.117582368135751e-21 -1.6940658945086007e-21 -2.84216806312838e-14 7.549789415861596e-08 1.0 1.999999761581421 3.0199157663446385e-07 -1.0 7.549789415861596e-08 -2.842170265414043e-14 0.0 0.0 0.0 1.0 0.9999999403953552 2.980232238769531e-07 -1.7763568394002505e-15 -1.4210854715202004e-14 -3.108624468950438e-14 7.549789415861596e-08 1.0 2.000000238418579 2.980232238769531e-07 -0.9999999403953552 7.549789415861596e-08 1.2434497875801753e-14 0.0 0.0 0.0 1.0 1.0000001192092896 2.980232238769531e-07 2.6645352591003757e-15 2.1316282072803006e-14 -3.197442310920451e-14 7.549790836947068e-08 1.0 2.0 2.980232238769531e-07 -1.0000001192092896 7.549790126404332e-08 -7.105427357601002e-14 0.0 0.0 0.0 1.0 0.9999999403953552 2.980232238769531e-07 4.884981308350689e-15 0.0 -2.4868995751603507e-14 7.549790126404332e-08 1.0 2.000000238418579 2.980232238769531e-07 -0.9999999403953552 7.549790126404332e-08 0.0 0.0 0.0 0.0 1.0 1.0 2.905726432800293e-07 -2.831068712794149e-15 7.105427357601002e-14 -2.9753977059954195e-14 7.549790836947068e-08 1.0 1.999999761581421 2.905726432800293e-07 -1.0 7.549790126404332e-08 2.1316282072803006e-14 0.0 0.0 0.0 1.0 1.0 3.019916050561733e-07 -4.5171351782337e-22 8.470329472543003e-21 -2.8421682325349695e-14 7.549790126404332e-08 1.0 2.0 3.019916050561733e-07 -1.0 7.549790126404332e-08 -4.658681209898652e-21 0.0 0.0 0.0 1.0 + + + + + + + + LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR + + + + + + + + + + + + + + + + 0.0 0.041666666666666664 0.08333333333333333 0.125 0.16666666666666666 0.20833333333333331 0.25 0.29166666666666663 0.3333333333333333 0.375 0.41666666666666663 0.4583333333333333 0.5 0.5416666666666666 0.5833333333333333 0.625 0.6666666666666666 0.7083333333333333 0.75 0.7916666666666666 0.8333333333333333 + + + + + + + + 1.0 0.0 0.0 0.0 0.0 1.0 0.0 2.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 1.0 0.0 -5.342710077992151e-16 0.0 8.862057858450884e-16 1.0 -7.0636156937421615e-15 2.0 -5.342710607387743e-16 0.0 1.0 0.0 0.0 0.0 0.0 1.0 1.0000001192092896 0.0 -1.9771030126248092e-15 0.0 3.552713678800501e-15 1.0 -7.105427357601002e-15 2.0 -1.9771030126248092e-15 0.0 1.0000001192092896 0.0 0.0 0.0 0.0 1.0 1.0 0.0 -2.8464326199079213e-15 0.0 0.0 1.0 0.0 2.0 -2.8464326199079213e-15 0.0 1.0 0.0 0.0 0.0 0.0 1.0 1.0 0.0 -1.7659080527211582e-15 0.0 -5.825547445289072e-16 1.0 9.824089292580348e-17 2.0 -1.7659079468420398e-15 -1.7763568394002505e-15 1.0 -3.552713678800501e-15 0.0 0.0 0.0 1.0 1.0 8.470329472543003e-22 3.070531895223506e-22 1.6940658945086007e-21 0.0 1.0 7.105425240018634e-15 2.0 5.364448530829927e-22 -7.105429051666896e-15 1.0 -1.4210858103333793e-14 0.0 0.0 0.0 1.0 0.9999999403953552 -8.881784197001252e-16 -5.579573312571159e-16 -1.7763568394002505e-15 -8.881784197001252e-16 1.0 3.1086244689504383e-15 2.0 -5.579571194988791e-16 -3.774758283725532e-15 0.9999999403953552 -7.549516567451064e-15 0.0 0.0 0.0 1.0 0.9999999403953552 8.881784197001252e-16 -6.462154115039354e-16 1.7763568394002505e-15 1.7763568394002505e-15 1.0 1.7763568394002505e-15 2.0 -6.462157291412906e-16 8.881784197001252e-16 0.9999999403953552 1.7763568394002505e-15 0.0 0.0 0.0 1.0 1.0 8.881784197001252e-16 2.9802322387695312e-08 1.7763568394002505e-15 1.7763568394002505e-15 1.0 -3.552713678800501e-15 2.0 -2.9802322387695312e-08 -5.329070518200751e-15 1.0 -1.0658141036401503e-14 0.0 0.0 0.0 1.0 1.0 -8.881784197001252e-16 -2.101767204219329e-16 -1.7763568394002505e-15 0.0 1.0 4.440892098500626e-16 2.0 -2.101765748381451e-16 -4.440892098500626e-16 1.0 -8.881784197001252e-16 0.0 0.0 0.0 1.0 1.0 0.0 -3.81167065240496e-36 0.0 0.0 1.0 0.0 2.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 1.0 2.7755575615628914e-17 -1.699426852058557e-17 5.551115123125783e-17 0.0 1.0 -6.661338147750939e-15 2.0 -1.699427182930802e-17 7.549516567451064e-15 1.0 1.509903313490213e-14 0.0 0.0 0.0 1.0 1.0 3.9968028886505635e-15 -2.9802322387695312e-08 7.993605777301127e-15 3.552713678800501e-15 1.0 -7.105427357601002e-15 2.0 2.9802322387695312e-08 -5.329070518200751e-15 1.0 -1.0658141036401503e-14 0.0 0.0 0.0 1.0 1.0 -1.7763568394002505e-15 -6.745567104025907e-16 -3.552713678800501e-15 0.0 1.0 -7.105427357601002e-15 2.0 -6.745576103750971e-16 -3.552713678800501e-15 1.0000001192092896 -7.105427357601002e-15 0.0 0.0 0.0 1.0 1.0 -1.7763568394002505e-15 -1.7359223452345271e-15 -3.552713678800501e-15 -1.7763568394002505e-15 1.0 -1.7763568394002505e-15 2.0 -1.7359214982015799e-15 -2.6645352591003757e-15 1.0 -5.329070518200751e-15 0.0 0.0 0.0 1.0 1.0 -8.470329472543003e-22 -3.0705321476589955e-22 -1.6940658945086007e-21 8.470329472543003e-22 1.0 7.105425240018634e-15 2.0 -5.364448025958947e-22 -7.105429051666896e-15 1.0 -1.4210858103333793e-14 0.0 0.0 0.0 1.0 0.9999999403953552 -1.7763568394002505e-15 -1.4652425907858116e-15 -3.552713678800501e-15 8.881784197001252e-16 1.0 1.7763568394002505e-15 2.0 -1.4652424849066932e-15 2.220446049250313e-15 0.9999999403953552 4.440892098500626e-15 0.0 0.0 0.0 1.0 1.0 1.7763568394002505e-15 -4.434845130290178e-15 3.552713678800501e-15 1.7763568394002505e-15 1.0 1.7763568394002505e-15 2.0 -4.434845553806651e-15 -7.105427357601002e-15 1.0 -1.4210854715202004e-14 0.0 0.0 0.0 1.0 1.0 0.0 2.9802315282267955e-08 0.0 -1.7763568394002505e-15 1.0 0.0 2.0 -2.980232949312267e-08 0.0 1.0 0.0 0.0 0.0 0.0 1.0 1.0 -8.881784197001252e-16 -8.063171746226176e-15 -1.7763568394002505e-15 -1.3322676295501878e-15 1.0 -6.217248937900877e-15 2.0 -8.063172593259123e-15 7.105427357601002e-15 1.0 1.4210854715202004e-14 0.0 0.0 0.0 1.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 2.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 + + + + + + + + LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR + + + + + + + + + + + + + + + + 0.0 0.041666666666666664 0.08333333333333333 0.125 0.16666666666666666 0.20833333333333331 0.25 0.29166666666666663 0.3333333333333333 0.375 0.41666666666666663 0.4583333333333333 0.5 0.5416666666666666 0.5833333333333333 0.625 0.6666666666666666 0.7083333333333333 0.75 0.7916666666666666 0.8333333333333333 + + + + + + + + 1.0 -2.2799733224976824e-14 3.019916050561733e-07 0.0 2.2799733224976824e-14 1.0 0.0 2.0 -3.019916050561733e-07 0.0 1.0 7.105427357601002e-15 0.0 0.0 0.0 1.0 1.0 -2.259762777563016e-14 2.980232238769531e-07 -4.440892098500626e-16 2.353475622935211e-14 1.0 -7.0636156937421615e-15 2.0 -2.980232238769531e-07 -2.137084242955097e-15 1.0 -7.105427357601002e-15 0.0 0.0 0.0 1.0 1.0 -2.1386826364782133e-14 2.980232238769531e-07 -3.552713678800501e-15 2.4868995751603507e-14 1.0 -7.105427357601002e-15 2.0 -2.980232238769531e-07 -8.02984692898235e-16 1.0 -7.105427357601002e-15 0.0 0.0 0.0 1.0 1.0 -2.149046931620817e-14 2.980232238769531e-07 -7.105427357601002e-15 2.1316282072803006e-14 1.0 0.0 2.0 -2.980232238769531e-07 -7.275902902631297e-16 1.0 -3.552713678800501e-15 0.0 0.0 0.0 1.0 1.0 -2.3768408573786315e-14 3.2782554626464844e-07 7.105427357601002e-15 2.0733728387065282e-14 1.0 1.8745974146886987e-15 2.0 -3.2782554626464844e-07 -1.7345621162003552e-15 1.0 -7.105427357601002e-15 0.0 0.0 0.0 1.0 1.0 -2.279973153091093e-14 3.019916050561733e-07 3.3881317890172014e-21 2.2799733224976824e-14 1.0 7.1054197343044766e-15 2.0 -3.0199157663446385e-07 -7.105432439798685e-15 1.0 -2.1316288849066584e-14 0.0 0.0 0.0 1.0 1.0 -2.398081733190338e-14 2.980232238769531e-07 -2.6645352591003757e-15 2.220446049250313e-14 1.0 0.0 2.0 -2.980232238769531e-07 -3.1086244689504383e-15 1.0 -1.509903313490213e-14 0.0 0.0 0.0 1.0 1.0 -2.398081733190338e-14 2.980232238769531e-07 2.6645352591003757e-15 2.220446049250313e-14 1.0 4.440892098500626e-15 2.0 -2.980232238769531e-07 1.7763568394002505e-15 1.0 0.0 0.0 0.0 0.0 1.0 1.0000001192092896 -2.042810365310288e-14 2.980232238769531e-07 2.6645352591003757e-15 2.3092638912203256e-14 1.0 -3.552713678800501e-15 2.0 -2.980232238769531e-07 -3.552713678800501e-15 1.0000001192092896 -1.7763568394002505e-14 0.0 0.0 0.0 1.0 0.9999999403953552 -2.220446049250313e-14 2.980232238769531e-07 -3.552713678800501e-15 2.1316282072803006e-14 1.0 0.0 2.0 -2.980232238769531e-07 8.881784197001252e-16 0.9999999403953552 -5.329070518200751e-15 0.0 0.0 0.0 1.0 1.0 -2.2799733224976824e-14 3.019916050561733e-07 0.0 2.2799733224976824e-14 1.0 0.0 2.0 -3.019916050561733e-07 0.0 1.0 -7.105427357601002e-15 0.0 0.0 0.0 1.0 1.0000001192092896 -2.1288526497187377e-14 2.980232238769531e-07 1.3877787807814457e-16 2.4424906541753444e-14 1.0 -6.217248937900877e-15 2.0 -2.980232238769531e-07 8.43769498715119e-15 1.0000001192092896 3.730349362740526e-14 0.0 0.0 0.0 1.0 1.0 -1.7319479184152442e-14 2.980232238769531e-07 1.5987211554602254e-14 2.3092638912203256e-14 1.0 -3.552713678800501e-15 2.0 -2.980232238769531e-07 -1.7763568394002505e-15 1.0000001192092896 -7.105427357601002e-15 0.0 0.0 0.0 1.0 1.0 -2.3092638912203256e-14 3.2782554626464844e-07 -7.105427357601002e-15 2.042810365310288e-14 1.0 -3.552713678800501e-15 2.0 -3.2782554626464844e-07 -3.552713678800501e-15 1.0000001192092896 -2.1316282072803006e-14 0.0 0.0 0.0 1.0 0.9999999403953552 -2.1316282072803006e-14 2.980232238769531e-07 -7.105427357601002e-15 1.7763568394002505e-14 1.0 -1.7763568394002505e-15 2.0 -2.980232238769531e-07 -3.552713678800501e-15 0.9999999403953552 -3.552713678800501e-15 0.0 0.0 0.0 1.0 1.0 -2.279973491904272e-14 3.019916050561733e-07 -3.3881317890172014e-21 2.279973153091093e-14 1.0 7.105429898699844e-15 2.0 -3.019916050561733e-07 -7.105426087051581e-15 1.0 -2.8421716206667585e-14 0.0 0.0 0.0 1.0 0.9999999403953552 -2.5757174171303632e-14 3.2782554626464844e-07 -7.105427357601002e-15 2.398081733190338e-14 1.0 -1.7763568394002505e-15 2.0 -3.2782554626464844e-07 2.220446049250313e-15 0.9999999403953552 1.5987211554602254e-14 0.0 0.0 0.0 1.0 1.0000001192092896 -1.7763568394002505e-14 2.980232238769531e-07 1.0658141036401503e-14 2.1316282072803006e-14 1.0 1.7763568394002505e-15 2.0 -2.980232238769531e-07 -5.329070518200751e-15 1.0000001192092896 -2.1316282072803006e-14 0.0 0.0 0.0 1.0 1.0 -1.7763568394002505e-14 2.980232238769531e-07 7.105427357601002e-15 1.9539925233402755e-14 1.0 0.0 2.0 -2.980232238769531e-07 0.0 1.0 0.0 0.0 0.0 0.0 1.0 1.0 -2.220446049250313e-14 2.980232238769531e-07 -3.552713678800501e-15 1.9984014443252818e-14 1.0 -2.6645352591003757e-15 2.0 -2.980232238769531e-07 8.881784197001252e-15 1.0 2.1316282072803006e-14 0.0 0.0 0.0 1.0 1.0 -2.2799733224976824e-14 3.019916050561733e-07 -4.235164736271502e-22 2.2799733224976824e-14 1.0 1.522012327097571e-21 2.0 -3.019916050561733e-07 0.0 1.0 0.0 0.0 0.0 0.0 1.0 + + + + + + + + LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR + + + + + + + + + + + + + + + + 0.0 0.041666666666666664 0.08333333333333333 0.125 0.16666666666666666 0.20833333333333331 0.25 0.29166666666666663 0.3333333333333333 0.375 0.41666666666666663 0.4583333333333333 0.5 0.5416666666666666 0.5833333333333333 0.625 0.6666666666666666 0.7083333333333333 0.75 0.7916666666666666 0.8333333333333333 + + + + + + + + 1.0 2.2799733224976824e-14 -3.019916050561733e-07 -3.3881317890172014e-21 -2.2799733224976824e-14 1.0 0.0 2.0 3.019916050561733e-07 0.0 1.0 -2.8421722982931164e-14 0.0 0.0 0.0 1.0 1.0 2.2648549702353193e-14 -2.980232238769531e-07 4.542739340078483e-15 -2.2105826893927157e-14 1.0 -2.0905738755796002e-15 1.999999761581421 2.980232238769531e-07 0.0 1.0 -6.111760132276184e-14 0.0 0.0 0.0 1.0 1.0 2.309263721813736e-14 -2.980232238769531e-07 -3.693798874626966e-15 -1.976926787420133e-14 1.0 -7.972451129443451e-15 2.0 2.980232238769531e-07 -6.352747104407253e-22 1.0 1.9710300828545274e-14 0.0 0.0 0.0 1.0 1.0 2.1316276990605322e-14 -2.980232238769531e-07 -2.5217366850282044e-14 -2.0453407915369155e-14 1.0 3.6245386845958766e-16 1.999999761581421 2.980232238769531e-07 -4.910144116114772e-21 1.0 1.2755667358412166e-14 0.0 0.0 0.0 1.0 1.0 1.4210852174103162e-14 -2.980232238769531e-07 -5.464224111704184e-14 -1.770618360589192e-14 1.0 -2.963268533003917e-15 2.0 2.980232238769531e-07 -1.776363192147355e-15 1.0 -8.798196444667356e-15 0.0 0.0 0.0 1.0 1.0 2.279973491904272e-14 -3.0199157663446385e-07 -2.0328790734103208e-20 -2.279973153091093e-14 1.0 7.105421851886845e-15 1.999999761581421 3.019916050561733e-07 -7.105433286831633e-15 1.0 -1.4210912313442417e-14 0.0 0.0 0.0 1.0 1.0 2.4868995751603507e-14 -2.980232238769531e-07 1.5987211554602254e-14 -2.4868995751603507e-14 1.0 3.3306690738754696e-15 1.999999761581421 2.980232238769531e-07 4.440892098500626e-16 1.0 -3.552713678800501e-15 0.0 0.0 0.0 1.0 1.0 2.220446049250313e-14 -2.980232238769531e-07 -4.440892098500626e-15 -2.3092638912203256e-14 1.0 8.881784197001252e-16 2.000000238418579 2.980232238769531e-07 -3.552713678800501e-15 1.0 2.1316282072803006e-14 0.0 0.0 0.0 1.0 1.0000001192092896 2.220446049250313e-14 -2.980232238769531e-07 1.3322676295501878e-14 -2.3092638912203256e-14 1.0 0.0 1.999999761581421 2.980232238769531e-07 -1.7763568394002505e-15 1.0000001192092896 -1.0658141036401503e-14 0.0 0.0 0.0 1.0 1.0 2.0872192862952943e-14 -2.980232238769531e-07 1.3322676295501878e-15 -2.220446049250313e-14 1.0 3.552713678800501e-15 2.000000238418579 2.980232238769531e-07 -3.1086244689504383e-15 1.0 -2.3092638912203256e-14 0.0 0.0 0.0 1.0 1.0 2.2799733224976824e-14 -3.019916050561733e-07 -1.0164395367051604e-20 -2.2799733224976824e-14 1.0 0.0 2.0 3.019916050561733e-07 0.0 1.0 2.842169587787685e-14 0.0 0.0 0.0 1.0 1.0 2.3148150063434514e-14 -3.2782554626464844e-07 5.6066262743570405e-15 -2.1316282072803006e-14 1.0 -5.329070518200751e-15 2.0 3.2782554626464844e-07 -5.329070518200751e-15 1.0 -7.105427357601002e-15 0.0 0.0 0.0 1.0 1.0 2.1760371282653068e-14 -2.980232238769531e-07 9.325873406851315e-15 -1.7763568394002505e-14 1.0 -7.105427357601002e-15 2.000000238418579 2.980232238769531e-07 -8.881784197001252e-15 1.0000001192092896 -7.105427357601002e-14 0.0 0.0 0.0 1.0 1.0 2.3092638912203256e-14 -2.682209014892578e-07 -5.329070518200751e-15 -2.4868995751603507e-14 1.0 -1.4210854715202004e-14 1.999999761581421 2.682209014892578e-07 0.0 1.0000001192092896 -3.552713678800501e-14 0.0 0.0 0.0 1.0 0.9999999403953552 2.1316282072803006e-14 -2.980232238769531e-07 3.552713678800501e-15 -2.3092638912203256e-14 1.0 4.440892098500626e-15 2.0 2.980232238769531e-07 -4.440892098500626e-15 0.9999999403953552 -4.263256414560601e-14 0.0 0.0 0.0 1.0 1.0 2.2799733224976824e-14 -3.019916050561733e-07 -1.6940658945086007e-21 -2.2799733224976824e-14 1.0 7.105428204633949e-15 1.999999761581421 3.0199157663446385e-07 -7.10542481650216e-15 1.0 -2.842170265414043e-14 0.0 0.0 0.0 1.0 0.9999999403953552 1.9539925233402755e-14 -2.980232238769531e-07 -1.4210854715202004e-14 -2.5757174171303632e-14 1.0 9.325873406851315e-15 2.000000238418579 2.980232238769531e-07 -1.7763568394002505e-15 0.9999999403953552 1.2434497875801753e-14 0.0 0.0 0.0 1.0 1.0000001192092896 2.842170943040401e-14 -2.980232238769531e-07 2.1316282072803006e-14 -2.4868995751603507e-14 1.0 -3.552713678800501e-15 2.0 2.980232238769531e-07 -1.7763568394002505e-15 1.0000001192092896 -7.105427357601002e-14 0.0 0.0 0.0 1.0 0.9999999403953552 2.3092638912203256e-14 -2.980232238769531e-07 0.0 -1.7763568394002505e-14 1.0 0.0 2.000000238418579 2.980232238769531e-07 0.0 0.9999999403953552 0.0 0.0 0.0 0.0 1.0 1.0 1.9984014443252818e-14 -2.905726432800293e-07 7.105427357601002e-14 -2.2648549702353193e-14 1.0 -4.440892098500626e-15 1.999999761581421 2.905726432800293e-07 3.552713678800501e-15 1.0 2.1316282072803006e-14 0.0 0.0 0.0 1.0 1.0 2.2799733224976824e-14 -3.019916050561733e-07 8.470329472543003e-21 -2.2799733224976824e-14 1.0 0.0 2.0 3.019916050561733e-07 1.522012327097571e-21 1.0 -4.658681209898652e-21 0.0 0.0 0.0 1.0 + + + + + + + + LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR + + + + + + + + + + + + + + + + 0.0 0.041666666666666664 0.08333333333333333 0.125 0.16666666666666666 0.20833333333333331 0.25 0.29166666666666663 0.3333333333333333 0.375 0.41666666666666663 0.4583333333333333 0.5 0.5416666666666666 0.5833333333333333 0.625 0.6666666666666666 0.7083333333333333 0.75 0.7916666666666666 0.8333333333333333 + + + + + + + + 1.0 0.0 0.0 0.0 0.0 7.549790126404332e-08 -1.0 0.0 0.0 1.0 7.549790126404332e-08 -1.0 0.0 0.0 0.0 1.0 0.9955579042434692 0.0 0.0941510796546936 0.0 0.0941510796546936 7.549790126404332e-08 -0.9955579042434692 0.0 -7.108209132411503e-09 1.0 7.516253219819191e-08 -1.0 0.0 0.0 0.0 1.0 0.9274256825447083 0.0 0.37400758266448975 0.0 0.37400758266448975 7.549790126404332e-08 -0.9274256825447083 0.0 -2.8236787130708763e-08 1.0 7.001869306577646e-08 -1.0 0.0 0.0 0.0 1.0 0.6892805695533752 0.0 0.7244945168495178 0.0 0.7244945168495178 7.549790126404332e-08 -0.6892805695533752 0.0 -5.469781427791531e-08 1.0 5.2039236919654286e-08 -1.0 0.0 0.0 0.0 1.0 0.327949196100235 0.0 0.9446954131126404 0.0 0.9446954131126404 7.549790126404332e-08 -0.327949196100235 0.0 -7.132251766961417e-08 1.0 2.4759476247027123e-08 -1.0 0.0 0.0 0.0 1.0 -1.3435885648505064e-07 -7.549791547489804e-08 1.0000001192092896 0.0 1.0000001192092896 -1.4210854715202004e-14 1.3435885648505064e-07 0.0 7.105427357601002e-15 1.0 7.549790836947068e-08 -1.0 0.0 0.0 0.0 1.0 -0.2926259934902191 -6.342676073245457e-08 0.9562267661094666 0.0 0.9562267661094666 -1.0242303005725262e-08 0.2926259934902191 0.0 -8.766356529577024e-09 1.0 6.364755478216466e-08 -1.0 0.0 0.0 0.0 1.0 -0.580210268497467 -4.877818682302859e-08 0.8144668340682983 0.0 0.8144668340682983 -1.914044389650371e-08 0.580210268497467 0.0 -1.2712352059907062e-08 1.0 5.0833687481599554e-08 -1.0 0.0 0.0 0.0 1.0 -0.8144670128822327 -3.242801938085904e-08 0.5802100896835327 0.0 0.5802100896835327 -2.5912903822700173e-08 0.8144670128822327 0.0 -1.1376624087233722e-08 1.0 3.9920251992953126e-08 -1.0 0.0 0.0 0.0 1.0 -0.9562267661094666 -1.5777985140630335e-08 0.29262611269950867 0.0 0.29262611269950867 -2.997906989321564e-08 0.9562267661094666 0.0 -6.314671452400944e-09 1.0 3.3283853895227367e-08 -1.0 0.0 0.0 0.0 1.0 -1.0 4.303330901289246e-22 -5.699934153277153e-15 0.0 -5.699934153277153e-15 -7.549791547489804e-08 1.0 0.0 0.0 1.0 7.549791547489804e-08 -1.0 0.0 0.0 0.0 1.0 -0.9562270045280457 2.2313441760957176e-08 -0.29262617230415344 0.0 -0.29262617230415344 -7.366906373817983e-08 0.9562270045280457 0.0 -2.2077983885537833e-10 1.0 7.697383352933684e-08 -1.0 0.0 0.0 0.0 1.0 -0.8144670128822327 4.5860144126663727e-08 -0.5802100896835327 0.0 -0.5802100896835327 -6.791864137767334e-08 0.8144670128822327 0.0 -2.0555006585709634e-09 1.0 8.192598954792629e-08 -1.0 0.0 0.0 0.0 1.0 -0.580210268497467 6.89827786004571e-08 -0.8144668936729431 0.0 -0.8144668936729431 -5.8340923203559214e-08 0.580210268497467 0.0 -7.492239717521443e-09 1.0 9.003416323594138e-08 -1.0 0.0 0.0 0.0 1.0 -0.29262620210647583 8.969897891120127e-08 -0.9562268257141113 0.0 -0.9562268257141113 -4.575706924470069e-08 0.29262620210647583 0.0 -1.7505861649169674e-08 1.0 9.916230681028537e-08 -1.0 0.0 0.0 0.0 1.0 -1.3435885648505064e-07 7.549790836947068e-08 -1.0000001192092896 0.0 -1.0000001192092896 -1.4210854715202004e-14 1.3435885648505064e-07 0.0 -7.105427357601002e-15 1.0 7.549790126404332e-08 -1.0 0.0 0.0 0.0 1.0 0.327949196100235 8.808321183551016e-08 -0.9446954727172852 0.0 -0.9446954727172852 1.283601136492507e-08 -0.327949196100235 0.0 -1.6760694165895984e-08 1.0 8.742135548800434e-08 -1.0 0.0 0.0 0.0 1.0 0.68928062915802 1.0117053506064622e-07 -0.7244945168495178 0.0 -0.7244945168495178 3.2108129488506165e-08 -0.68928062915802 0.0 -4.647272788815826e-08 1.0 9.542900158976408e-08 -1.0 0.0 0.0 0.0 1.0 0.9274256229400635 1.0772405545367292e-07 -0.37400758266448975 0.0 -0.37400758266448975 5.4594561760268334e-08 -0.9274256229400635 0.0 -7.948726477025048e-08 1.0 9.092201480598305e-08 -1.0 0.0 0.0 0.0 1.0 0.9955579042434692 1.0759762147927177e-07 -0.0941511020064354 0.0 -0.0941511020064354 7.042140026669585e-08 -0.9955579042434692 0.0 -1.0048940879414658e-07 1.0 8.023901898468466e-08 -1.0 0.0 0.0 0.0 1.0 1.0 5.024294934767972e-15 3.7932372841020008e-22 0.0 5.048709793414476e-29 7.549789415861596e-08 -1.0 0.0 -5.024294934767972e-15 1.0 7.549789415861596e-08 -1.0 0.0 0.0 0.0 1.0 + + + + + + + + LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR + + + + + + + + + + + + + + + + + +
From ccd9f92533f56e06d62685e95c8d356c34504ff9 Mon Sep 17 00:00:00 2001 From: Trond Abusdal Date: Thu, 11 Feb 2016 01:00:03 +0100 Subject: [PATCH 37/45] Fixed a couple of nested template brackets that wasn't spaced out correctly. --- code/ColladaParser.cpp | 2 +- code/ColladaParser.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/code/ColladaParser.cpp b/code/ColladaParser.cpp index 41a56e24a..f52ec677a 100644 --- a/code/ColladaParser.cpp +++ b/code/ColladaParser.cpp @@ -299,7 +299,7 @@ void ColladaParser::ReadAnimationClipLibrary() else animName = "animation_" + mAnimationClipLibrary.size(); - std::pair> clip; + std::pair > clip; clip.first = animName; diff --git a/code/ColladaParser.h b/code/ColladaParser.h index b2ff92701..14d2f8d4b 100644 --- a/code/ColladaParser.h +++ b/code/ColladaParser.h @@ -324,7 +324,7 @@ namespace Assimp AnimationLibrary mAnimationLibrary; /** Animation clip library: clip animation references by ID */ - typedef std::vector>> AnimationClipLibrary; + typedef std::vector > > AnimationClipLibrary; AnimationClipLibrary mAnimationClipLibrary; /** Pointer to the root node. Don't delete, it just points to one of From 7d4a713a867cc0886eb97999873d1b331e00da21 Mon Sep 17 00:00:00 2001 From: rdb Date: Thu, 11 Feb 2016 14:10:49 +0100 Subject: [PATCH 38/45] Fix loading of pk3 q3bsp maps This fixes loading of pk3 maps. The pk3 files contain directory entries with a size of 0, which triggered an assertion. --- code/Q3BSPZipArchive.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/Q3BSPZipArchive.cpp b/code/Q3BSPZipArchive.cpp index cc21754b3..cdc6ea2c5 100644 --- a/code/Q3BSPZipArchive.cpp +++ b/code/Q3BSPZipArchive.cpp @@ -292,7 +292,7 @@ bool Q3BSPZipArchive::mapArchive() { // The file has EXACTLY the size of uncompressed_size. In C // you need to mark the last character with '\0', so add // another character - if(unzOpenCurrentFile(m_ZipFileHandle) == UNZ_OK) { + if(fileInfo.uncompressed_size != 0 && unzOpenCurrentFile(m_ZipFileHandle) == UNZ_OK) { std::pair::iterator, bool> result = m_ArchiveMap.insert(std::make_pair(filename, new ZipFile(fileInfo.uncompressed_size))); if(unzReadCurrentFile(m_ZipFileHandle, result.first->second->m_Buffer, fileInfo.uncompressed_size) == (long int) fileInfo.uncompressed_size) { From a5f9d0d3fc22d9840f4875ed6d194c2e0a2fb733 Mon Sep 17 00:00:00 2001 From: Alexander Bobkov Date: Thu, 11 Feb 2016 16:24:26 +0300 Subject: [PATCH 39/45] Fixed installing pdb file --- code/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/CMakeLists.txt b/code/CMakeLists.txt index 3b9fb2ab2..5088d5433 100644 --- a/code/CMakeLists.txt +++ b/code/CMakeLists.txt @@ -798,7 +798,7 @@ if (ASSIMP_ANDROID_JNIIOSYSTEM) endif(ASSIMP_ANDROID_JNIIOSYSTEM) if(MSVC AND ASSIMP_INSTALL_PDB) - install(FILES ${Assimp_BINARY_DIR}/code/Debug/assimp${CMAKE_DEBUG_POSTFIX}.pdb + install(FILES ${Assimp_BINARY_DIR}/code/Debug/assimp${LIBRARY_SUFFIX}${CMAKE_DEBUG_POSTFIX}.pdb DESTINATION ${ASSIMP_LIB_INSTALL_DIR} CONFIGURATIONS Debug ) From b71bd3df84c036a61ca39daf8dbb660b13ed8e9d Mon Sep 17 00:00:00 2001 From: Turo Lamminen Date: Sat, 13 Feb 2016 23:37:08 +0200 Subject: [PATCH 40/45] LWO: Fix division by zero --- code/LWOAnimation.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/code/LWOAnimation.cpp b/code/LWOAnimation.cpp index de6d6493c..9f23c13b2 100644 --- a/code/LWOAnimation.cpp +++ b/code/LWOAnimation.cpp @@ -328,7 +328,12 @@ void AnimResolver::DoInterpolation2(std::vector::const_iterator beg, break; } // linear interpolation - default - fill = (*beg).value + ((*end).value - (*beg).value)*(float)(((time - (*beg).time) / ((*end).time - (*beg).time))); + double duration = (*end).time - (*beg).time; + if (duration > 0.0) { + fill = (*beg).value + ((*end).value - (*beg).value)*(float)(((time - (*beg).time) / duration)); + } else { + fill = (*beg).value; + } } // ------------------------------------------------------------------------------------------------ From bf74a5a66299e6edaf63c4a96b0aab0e46b191d1 Mon Sep 17 00:00:00 2001 From: afiskon Date: Sun, 14 Feb 2016 22:39:37 +0300 Subject: [PATCH 41/45] Update pstdint.h to version 0.1.12 ( solve #795 ) --- include/assimp/Compiler/pstdint.h | 284 +++++++++++++++++++++--------- 1 file changed, 201 insertions(+), 83 deletions(-) diff --git a/include/assimp/Compiler/pstdint.h b/include/assimp/Compiler/pstdint.h index 5bc322fab..3692a8aef 100644 --- a/include/assimp/Compiler/pstdint.h +++ b/include/assimp/Compiler/pstdint.h @@ -3,13 +3,13 @@ * BSD License: **************************************************************************** * - * Copyright (c) 2005-2007 Paul Hsieh + * Copyright (c) 2005-2011 Paul Hsieh * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: - * + * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright @@ -17,7 +17,7 @@ * documentation and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. @@ -31,7 +31,7 @@ * **************************************************************************** * - * Version 0.1.10 + * Version 0.1.12 * * The ANSI C standard committee, for the C99 standard, specified the * inclusion of a new standard include file called stdint.h. This is @@ -172,12 +172,15 @@ * * Acknowledgements * + * Edited by Philip G. Lee 2011 to avoid overlap with sys/types.h + * * The following people have made significant contributions to the * development and testing of this file: * * Chris Howie * John Steele Scott * Dave Thorup + * John Dill * */ @@ -190,7 +193,7 @@ * do nothing else. On the Mac OS X version of gcc this is _STDINT_H_. */ -#if ((defined(__STDC__) && __STDC__ && __STDC_VERSION__ >= 199901L) || (defined (__WATCOMC__) && (defined (_STDINT_H_INCLUDED) || __WATCOMC__ >= 1250)) || (defined(__GNUC__) && (defined(_STDINT_H) || defined(_STDINT_H_)))) && !defined (_PSTDINT_H_INCLUDED) && !defined(_STDINT) +#if ((defined(__STDC__) && __STDC__ && __STDC_VERSION__ >= 199901L) || (defined (__WATCOMC__) && (defined (_STDINT_H_INCLUDED) || __WATCOMC__ >= 1250)) || (defined(__GNUC__) && (defined(_STDINT_H) || defined(_STDINT_H_) || defined (__UINT_FAST64_TYPE__)) )) && !defined (_PSTDINT_H_INCLUDED) #include #define _PSTDINT_H_INCLUDED # ifndef PRINTF_INT64_MODIFIER @@ -300,17 +303,10 @@ * definitions. */ -#ifndef UINT8_MAX -# define UINT8_MAX 0xff -#endif -#ifndef uint8_t -# if (UCHAR_MAX == UINT8_MAX) || defined (S_SPLINT_S) - typedef unsigned char uint8_t; -# define UINT8_C(v) ((uint8_t) v) -# else -# error "Platform not supported" -# endif -#endif + +// Avoid overlap with sys/types.h +#ifndef __int8_t_defined +#define __int8_t_defined #ifndef INT8_MAX # define INT8_MAX 0x7f @@ -320,13 +316,110 @@ #endif #ifndef int8_t # if (SCHAR_MAX == INT8_MAX) || defined (S_SPLINT_S) - typedef signed char int8_t; +typedef signed char int8_t; # define INT8_C(v) ((int8_t) v) # else # error "Platform not supported" # endif #endif +#ifndef INT16_MAX +# define INT16_MAX 0x7fff +#endif +#ifndef INT16_MIN +# define INT16_MIN INT16_C(0x8000) +#endif +#ifndef int16_t +#if (INT_MAX == INT16_MAX) || defined (S_SPLINT_S) +typedef signed int int16_t; +# define INT16_C(v) ((int16_t) (v)) +# ifndef PRINTF_INT16_MODIFIER +# define PRINTF_INT16_MODIFIER "" +# endif +#elif (SHRT_MAX == INT16_MAX) +typedef signed short int16_t; +# define INT16_C(v) ((int16_t) (v)) +# ifndef PRINTF_INT16_MODIFIER +# define PRINTF_INT16_MODIFIER "h" +# endif +#else +#error "Platform not supported" +#endif +#endif + +#ifndef INT32_MAX +# define INT32_MAX (0x7fffffffL) +#endif +#ifndef INT32_MIN +# define INT32_MIN INT32_C(0x80000000) +#endif +#ifndef int32_t +#if ((LONG_MAX == INT32_MAX) || defined (S_SPLINT_S)) && ! defined(__FreeBSD__) +typedef signed long int32_t; +# define INT32_C(v) v ## L +# ifndef PRINTF_INT32_MODIFIER +# define PRINTF_INT32_MODIFIER "l" +# endif +#elif (INT_MAX == INT32_MAX) +typedef signed int int32_t; +# define INT32_C(v) v +# ifndef PRINTF_INT32_MODIFIER +# define PRINTF_INT32_MODIFIER "" +# endif +#elif (SHRT_MAX == INT32_MAX) +typedef signed short int32_t; +# define INT32_C(v) ((short) (v)) +# ifndef PRINTF_INT32_MODIFIER +# define PRINTF_INT32_MODIFIER "" +# endif +#else +#error "Platform not supported" +#endif +#endif + +// 64-bit shit seems more tricky. Philip Lee +/* +* The macro stdint_int64_defined is temporarily used to record +* whether or not 64 integer support is available. It must be +* defined for any 64 integer extensions for new platforms that are +* added. +*/ +#undef stdint_int64_defined +#if (defined(__STDC__) && defined(__STDC_VERSION__)) || defined (S_SPLINT_S) +# if (__STDC__ && __STDC_VERSION__ >= 199901L) || defined (S_SPLINT_S) +# define stdint_int64_defined +typedef long long int64_t; +# endif +#endif +#if !defined (stdint_int64_defined) +# if defined(__GNUC__) +# define stdint_int64_defined +# ifndef __FreeBSD__ + __extension__ typedef long long int64_t; +# endif +# elif defined(__MWERKS__) || defined (__SUNPRO_C) || defined (__SUNPRO_CC) || defined (__APPLE_CC__) || defined (_LONG_LONG) || defined (_CRAYC) || defined (S_SPLINT_S) +# define stdint_int64_defined +typedef long long int64_t; +# elif (defined(__WATCOMC__) && defined(__WATCOM_INT64__)) || (defined(_MSC_VER) && _INTEGRAL_MAX_BITS >= 64) || (defined (__BORLANDC__) && __BORLANDC__ > 0x460) || defined (__alpha) || defined (__DECC) +# define stdint_int64_defined +typedef __int64 int64_t; +# endif +#endif + +#endif /*ifndef __int8_t_defined*/ + +#ifndef UINT8_MAX +# define UINT8_MAX 0xff +#endif +#ifndef uint8_t +# if (UCHAR_MAX == UINT8_MAX) || defined (S_SPLINT_S) + typedef unsigned char uint8_t; +# define UINT8_C(v) ((uint8_t) v) +# else +# error "Platform not supported" +# endif +#endif + #ifndef UINT16_MAX # define UINT16_MAX 0xffff #endif @@ -348,35 +441,11 @@ #endif #endif -#ifndef INT16_MAX -# define INT16_MAX 0x7fff -#endif -#ifndef INT16_MIN -# define INT16_MIN INT16_C(0x8000) -#endif -#ifndef int16_t -#if (INT_MAX == INT16_MAX) || defined (S_SPLINT_S) - typedef signed int int16_t; -# define INT16_C(v) ((int16_t) (v)) -# ifndef PRINTF_INT16_MODIFIER -# define PRINTF_INT16_MODIFIER "" -# endif -#elif (SHRT_MAX == INT16_MAX) - typedef signed short int16_t; -# define INT16_C(v) ((int16_t) (v)) -# ifndef PRINTF_INT16_MODIFIER -# define PRINTF_INT16_MODIFIER "h" -# endif -#else -#error "Platform not supported" -#endif -#endif - #ifndef UINT32_MAX # define UINT32_MAX (0xffffffffUL) #endif #ifndef uint32_t -#if (ULONG_MAX == UINT32_MAX) || defined (S_SPLINT_S) +#if ((ULONG_MAX == UINT32_MAX) || defined (S_SPLINT_S)) && ! defined(__FreeBSD__) typedef unsigned long uint32_t; # define UINT32_C(v) v ## UL # ifndef PRINTF_INT32_MODIFIER @@ -399,36 +468,6 @@ #endif #endif -#ifndef INT32_MAX -# define INT32_MAX (0x7fffffffL) -#endif -#ifndef INT32_MIN -# define INT32_MIN INT32_C(0x80000000) -#endif -#ifndef int32_t -#if (LONG_MAX == INT32_MAX) || defined (S_SPLINT_S) - typedef signed long int32_t; -# define INT32_C(v) v ## L -# ifndef PRINTF_INT32_MODIFIER -# define PRINTF_INT32_MODIFIER "l" -# endif -#elif (INT_MAX == INT32_MAX) - typedef signed int int32_t; -# define INT32_C(v) v -# ifndef PRINTF_INT32_MODIFIER -# define PRINTF_INT32_MODIFIER "" -# endif -#elif (SHRT_MAX == INT32_MAX) - typedef signed short int32_t; -# define INT32_C(v) ((short) (v)) -# ifndef PRINTF_INT32_MODIFIER -# define PRINTF_INT32_MODIFIER "" -# endif -#else -#error "Platform not supported" -#endif -#endif - /* * The macro stdint_int64_defined is temporarily used to record * whether or not 64 integer support is available. It must be @@ -438,10 +477,11 @@ #undef stdint_int64_defined #if (defined(__STDC__) && defined(__STDC_VERSION__)) || defined (S_SPLINT_S) -# if (__STDC__ && __STDC_VERSION >= 199901L) || defined (S_SPLINT_S) +# if (__STDC__ && __STDC_VERSION__ >= 199901L) || defined (S_SPLINT_S) # define stdint_int64_defined - typedef long long int64_t; - typedef unsigned long long uint64_t; +# ifndef __FreeBSD__ + typedef unsigned long long uint64_t; +# endif # define UINT64_C(v) v ## ULL # define INT64_C(v) v ## LL # ifndef PRINTF_INT64_MODIFIER @@ -453,8 +493,9 @@ #if !defined (stdint_int64_defined) # if defined(__GNUC__) # define stdint_int64_defined - __extension__ typedef long long int64_t; - __extension__ typedef unsigned long long uint64_t; +# ifndef __FreeBSD__ + __extension__ typedef unsigned long long uint64_t; +# endif # define UINT64_C(v) v ## ULL # define INT64_C(v) v ## LL # ifndef PRINTF_INT64_MODIFIER @@ -462,7 +503,6 @@ # endif # elif defined(__MWERKS__) || defined (__SUNPRO_C) || defined (__SUNPRO_CC) || defined (__APPLE_CC__) || defined (_LONG_LONG) || defined (_CRAYC) || defined (S_SPLINT_S) # define stdint_int64_defined - typedef long long int64_t; typedef unsigned long long uint64_t; # define UINT64_C(v) v ## ULL # define INT64_C(v) v ## LL @@ -471,7 +511,6 @@ # endif # elif (defined(__WATCOMC__) && defined(__WATCOM_INT64__)) || (defined(_MSC_VER) && _INTEGRAL_MAX_BITS >= 64) || (defined (__BORLANDC__) && __BORLANDC__ > 0x460) || defined (__alpha) || defined (__DECC) # define stdint_int64_defined - typedef __int64 int64_t; typedef unsigned __int64 uint64_t; # define UINT64_C(v) v ## UI64 # define INT64_C(v) v ## I64 @@ -616,10 +655,12 @@ * stdint.h. */ +#ifndef __FreeBSD__ typedef int_least8_t int_fast8_t; typedef uint_least8_t uint_fast8_t; typedef int_least16_t int_fast16_t; typedef uint_least16_t uint_fast16_t; +#endif typedef int_least32_t int_fast32_t; typedef uint_least32_t uint_fast32_t; #define UINT_FAST8_MAX UINT_LEAST8_MAX @@ -677,7 +718,7 @@ typedef uint_least32_t uint_fast32_t; # elif defined (__i386__) || defined (_WIN32) || defined (WIN32) # define stdint_intptr_bits 32 # elif defined (__INTEL_COMPILER) -/* TODO -- what will Intel do about x86-64? */ +/* TODO -- what did Intel do about x86-64? */ # endif # ifdef stdint_intptr_bits @@ -707,8 +748,15 @@ typedef uint_least32_t uint_fast32_t; # ifndef UINTPTR_C # define UINTPTR_C(x) stdint_intptr_glue3(UINT,stdint_intptr_bits,_C)(x) # endif - typedef stdint_intptr_glue3(uint,stdint_intptr_bits,_t) uintptr_t; - typedef stdint_intptr_glue3( int,stdint_intptr_bits,_t) intptr_t; +// Philip , need to check if [u]intprt_t is already defined... +# ifndef __uintptr_t_defined +# define __uintptr_t_defined + typedef stdint_intptr_glue3(uint,stdint_intptr_bits,_t) uintptr_t; +# endif /*uintptr_t*/ +# ifndef __intptr_t_defined +# define __intptr_t_defined + typedef stdint_intptr_glue3( int,stdint_intptr_bits,_t) intptr_t; +# endif /*__intptr_t_defined*/ # else /* TODO -- This following is likely wrong for some platforms, and does nothing for the definition of uintptr_t. */ @@ -727,3 +775,73 @@ typedef uint_least32_t uint_fast32_t; #endif +#if defined (__TEST_PSTDINT_FOR_CORRECTNESS) + +/* + * Please compile with the maximum warning settings to make sure macros are not + * defined more than once. + */ + +#include +#include +#include + +#define glue3_aux(x,y,z) x ## y ## z +#define glue3(x,y,z) glue3_aux(x,y,z) + +#define DECLU(bits) glue3(uint,bits,_t) glue3(u,bits,=) glue3(UINT,bits,_C) (0); +#define DECLI(bits) glue3(int,bits,_t) glue3(i,bits,=) glue3(INT,bits,_C) (0); + +#define DECL(us,bits) glue3(DECL,us,) (bits) + +#define TESTUMAX(bits) glue3(u,bits,=) glue3(~,u,bits); if (glue3(UINT,bits,_MAX) glue3(!=,u,bits)) printf ("Something wrong with UINT%d_MAX\n", bits) + +int main () { + DECL(I,8) + DECL(U,8) + DECL(I,16) + DECL(U,16) + DECL(I,32) + DECL(U,32) +#ifdef INT64_MAX + DECL(I,64) + DECL(U,64) +#endif + intmax_t imax = INTMAX_C(0); + uintmax_t umax = UINTMAX_C(0); + char str0[256], str1[256]; + + sprintf (str0, "%d %x\n", 0, ~0); + + sprintf (str1, "%d %x\n", i8, ~0); + if (0 != strcmp (str0, str1)) printf ("Something wrong with i8 : %s\n", str1); + sprintf (str1, "%u %x\n", u8, ~0); + if (0 != strcmp (str0, str1)) printf ("Something wrong with u8 : %s\n", str1); + sprintf (str1, "%d %x\n", i16, ~0); + if (0 != strcmp (str0, str1)) printf ("Something wrong with i16 : %s\n", str1); + sprintf (str1, "%u %x\n", u16, ~0); + if (0 != strcmp (str0, str1)) printf ("Something wrong with u16 : %s\n", str1); + sprintf (str1, "%" PRINTF_INT32_MODIFIER "d %x\n", i32, ~0); + if (0 != strcmp (str0, str1)) printf ("Something wrong with i32 : %s\n", str1); + sprintf (str1, "%" PRINTF_INT32_MODIFIER "u %x\n", u32, ~0); + if (0 != strcmp (str0, str1)) printf ("Something wrong with u32 : %s\n", str1); +#ifdef INT64_MAX + sprintf (str1, "%" PRINTF_INT64_MODIFIER "d %x\n", i64, ~0); + if (0 != strcmp (str0, str1)) printf ("Something wrong with i64 : %s\n", str1); +#endif + sprintf (str1, "%" PRINTF_INTMAX_MODIFIER "d %x\n", imax, ~0); + if (0 != strcmp (str0, str1)) printf ("Something wrong with imax : %s\n", str1); + sprintf (str1, "%" PRINTF_INTMAX_MODIFIER "u %x\n", umax, ~0); + if (0 != strcmp (str0, str1)) printf ("Something wrong with umax : %s\n", str1); + + TESTUMAX(8); + TESTUMAX(16); + TESTUMAX(32); +#ifdef INT64_MAX + TESTUMAX(64); +#endif + + return EXIT_SUCCESS; +} + +#endif From d393ab11ecb7b538f9b073afcda41e2bfa2689f8 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Mon, 15 Feb 2016 10:20:34 +0100 Subject: [PATCH 42/45] Appveyor: add support for VS2010. --- appveyor.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/appveyor.yml b/appveyor.yml index f5c221efd..6b1410b69 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -13,6 +13,10 @@ branches: platform: - x86 - x64 +os: + - Visual Studio 2010 + - Visual Studio 2015 + configuration: Release build: From 03af4b3dd448c4ddfefe6d35e8b30892920522a8 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Wed, 17 Feb 2016 13:44:33 +0100 Subject: [PATCH 43/45] Appveyor: add compiler setup script. --- appveyor.yml | 16 +++++++++--- scripts/appveyor/compiler_setup.bat | 40 +++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+), 3 deletions(-) create mode 100644 scripts/appveyor/compiler_setup.bat diff --git a/appveyor.yml b/appveyor.yml index 6b1410b69..b72708d41 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -17,11 +17,21 @@ os: - Visual Studio 2010 - Visual Studio 2015 -configuration: Release +configuration: + - 2015 + - 2013 + - 2012 + #- MinGW + - 2010 # only works for x86 -build: +init: +- if "%platform%" EQU "x64" ( for %%a in (2008 2010 MinGW) do ( if "%Configuration%"=="%%a" (echo "Skipping unsupported configuration" && exit /b 1 ) ) ) + +install: +# Make compiler command line tools available +- call appveyor\compiler_setup.bat build_script: - cd c:\projects\assimp - - cmake CMakeLists.txt -G "Visual Studio 11" + - cmake CMakeLists.txt -G "Visual Studio %Configuration%" - msbuild /m /p:Configuration=Release /p:Platform="Win32" Assimp.sln diff --git a/scripts/appveyor/compiler_setup.bat b/scripts/appveyor/compiler_setup.bat new file mode 100644 index 000000000..7e8462ec5 --- /dev/null +++ b/scripts/appveyor/compiler_setup.bat @@ -0,0 +1,40 @@ +@echo off + +:: Now we declare a scope +Setlocal EnableDelayedExpansion EnableExtensions + +if not defined Configuration set Configuration=2015 + +if "%Configuration%"=="MinGW" ( goto :mingw ) + +set arch=x86 + +if "%platform%" EQU "x64" ( set arch=x86_amd64 ) + +if "%Configuration%"=="2015" ( + set SET_VS_ENV="C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" +) + +if "%Configuration%"=="2013" ( + set SET_VS_ENV="C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" +) + +if "%Configuration%"=="2012" ( + set SET_VS_ENV="C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\vcvarsall.bat" +) + +if "%Configuration%"=="2010" ( + set SET_VS_ENV="C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" +) + +if "%Configuration%"=="2008" ( + set SET_VS_ENV="C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" +) + +:: Visual Studio detected +endlocal & call %SET_VS_ENV% %arch% +goto :eof + +:: MinGW detected +:mingw +endlocal & set PATH=c:\mingw\bin;%PATH% From 909c5d51521002dc0944face8415e8ca09b0c37f Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Wed, 17 Feb 2016 15:17:55 +0100 Subject: [PATCH 44/45] CI: Remove erroreous platform spec from appveyor file. --- appveyor.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index b72708d41..f7cd5cd4f 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -13,9 +13,6 @@ branches: platform: - x86 - x64 -os: - - Visual Studio 2010 - - Visual Studio 2015 configuration: - 2015 From 166d5d1d1371eab2fc3f3c85b7b39bbbde80a961 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Thu, 18 Feb 2016 18:29:25 +0100 Subject: [PATCH 45/45] appveyor: Fix invalid path. --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index f7cd5cd4f..04c527a92 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -26,7 +26,7 @@ init: install: # Make compiler command line tools available -- call appveyor\compiler_setup.bat +- call c:\projects\assimp\appveyor\compiler_setup.bat build_script: - cd c:\projects\assimp