Just the functional assimp lib rather than the entire assimp repository unnecessarily.

This commit is contained in:
Areloch 2019-02-28 16:37:15 -06:00
parent 0f7641a282
commit e9ea38eda3
1747 changed files with 9012 additions and 925008 deletions

View file

@ -2,8 +2,7 @@
Open Asset Import Library (assimp)
----------------------------------------------------------------------
Copyright (c) 2006-2018, assimp team
Copyright (c) 2006-2017, assimp team
All rights reserved.
@ -47,12 +46,12 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "PlyExporter.h"
#include <memory>
#include <cmath>
#include <assimp/Exceptional.h>
#include "Exceptional.h"
#include <assimp/scene.h>
#include <assimp/version.h>
#include <assimp/IOSystem.hpp>
#include <assimp/Exporter.hpp>
#include <assimp/qnan.h>
#include "qnan.h"
//using namespace Assimp;
@ -148,17 +147,6 @@ PlyExporter::PlyExporter(const char* _filename, const aiScene* pScene, bool bina
<< aiGetVersionMajor() << '.' << aiGetVersionMinor() << '.'
<< aiGetVersionRevision() << ")" << endl;
// Look through materials for a diffuse texture, and add it if found
for ( unsigned int i = 0; i < pScene->mNumMaterials; ++i )
{
const aiMaterial* const mat = pScene->mMaterials[i];
aiString s;
if ( AI_SUCCESS == mat->Get( AI_MATKEY_TEXTURE_DIFFUSE( 0 ), s ) )
{
mOutput << "comment TextureFile " << s.data << endl;
}
}
// TODO: probably want to check here rather than just assume something
// definitely not good to always write float even if we might have double precision
@ -194,16 +182,16 @@ PlyExporter::PlyExporter(const char* _filename, const aiScene* pScene, bool bina
for (unsigned int n = PLY_EXPORT_HAS_COLORS, c = 0; (components & n) && c != AI_MAX_NUMBER_OF_COLOR_SETS; n <<= 1, ++c) {
if (!c) {
mOutput << "property " << "uchar" << " red" << endl;
mOutput << "property " << "uchar" << " green" << endl;
mOutput << "property " << "uchar" << " blue" << endl;
mOutput << "property " << "uchar" << " alpha" << endl;
mOutput << "property " << typeName << " r" << endl;
mOutput << "property " << typeName << " g" << endl;
mOutput << "property " << typeName << " b" << endl;
mOutput << "property " << typeName << " a" << endl;
}
else {
mOutput << "property " << "uchar" << " red" << c << endl;
mOutput << "property " << "uchar" << " green" << c << endl;
mOutput << "property " << "uchar" << " blue" << c << endl;
mOutput << "property " << "uchar" << " alpha" << c << endl;
mOutput << "property " << typeName << " r" << c << endl;
mOutput << "property " << typeName << " g" << c << endl;
mOutput << "property " << typeName << " b" << c << endl;
mOutput << "property " << typeName << " a" << c << endl;
}
}
@ -288,13 +276,13 @@ void PlyExporter::WriteMeshVerts(const aiMesh* m, unsigned int components)
for (unsigned int n = PLY_EXPORT_HAS_COLORS, c = 0; (components & n) && c != AI_MAX_NUMBER_OF_COLOR_SETS; n <<= 1, ++c) {
if (m->HasVertexColors(c)) {
mOutput <<
" " << (int)(m->mColors[c][i].r * 255) <<
" " << (int)(m->mColors[c][i].g * 255) <<
" " << (int)(m->mColors[c][i].b * 255) <<
" " << (int)(m->mColors[c][i].a * 255);
" " << m->mColors[c][i].r <<
" " << m->mColors[c][i].g <<
" " << m->mColors[c][i].b <<
" " << m->mColors[c][i].a;
}
else {
mOutput << " 0 0 0";
mOutput << " -1.0 -1.0 -1.0 -1.0";
}
}