Commit 4a7dde8b authored by Jan Möbius's avatar Jan Möbius

Merge branch 'prepareAssimpPlugin' into 'master'

Prepare assimp plugin

See merge request !5
parents fd7c45e0 8662a68a
......@@ -45,68 +45,6 @@
#include "AssimpPlugin.hh"
/*
* we have to implement our own aiScene and aiMaterial constructor/destructor
* since the linker cannot find the corresponding symbols from the
* assimp library
*/
aiMaterial::aiMaterial() {
mNumAllocated = 0;
mNumProperties = 0;
mProperties = NULL;
}
aiMaterial::~aiMaterial() {
for (unsigned int i = 0; i < mNumProperties; ++i)
delete mProperties[i];
delete[] mProperties;
}
aiScene::aiScene() {
mFlags = 0;
mRootNode = NULL;
mNumMeshes = 0;
mMeshes = NULL;
mNumMaterials = 0;
mMaterials = NULL;
mNumAnimations = 0;
mAnimations = NULL;
mNumTextures = 0;
mTextures = NULL;
mNumLights = 0;
mLights = NULL;
mNumCameras = 0;
mCameras = NULL;
}
aiScene::~aiScene() {
delete mRootNode;
for (unsigned int i = 0; i < mNumMeshes; ++i)
delete mMeshes[i];
delete[] mMeshes;
for (unsigned int i = 0; i < mNumMaterials; ++i)
delete mMaterials[i];
delete[] mMaterials;
for (unsigned int i = 0; i < mNumAnimations; ++i)
delete mAnimations[i];
delete[] mAnimations;
for (unsigned int i = 0; i < mNumTextures; ++i)
delete mTextures[i];
delete[] mTextures;
for (unsigned int i = 0; i < mNumLights; ++i)
delete mLights[i];
delete[] mLights;
for (unsigned int i = 0; i < mNumCameras; ++i)
delete mCameras[i];
delete[] mCameras;
}
AssimpPlugin::AssimpPlugin()
:
loadOptions_(0),
......@@ -397,9 +335,9 @@ int AssimpPlugin::loadObject(QString _filename) {
const aiScene* scene = NULL;
if (type_ == DATA_TRIANGLE_MESH)
scene = importer.ReadFile(_filename.toStdString(), aiProcess_JoinIdenticalVertices | aiProcess_Triangulate);
scene = importer.ReadFile(_filename.toStdString(), aiProcess_JoinIdenticalVertices | aiProcess_Triangulate | aiProcess_FindDegenerates);
else
scene = importer.ReadFile(_filename.toStdString(), aiProcess_JoinIdenticalVertices);
scene = importer.ReadFile(_filename.toStdString(), aiProcess_JoinIdenticalVertices | aiProcess_FindDegenerates);
if (!scene) {
emit log(LOGERR, tr(importer.GetErrorString()));
......
include(plugin)
openflipper_plugin(DEPS ASSIMP
TYPES POLYMESH)
TYPES POLYMESH TRIANGLEMESH)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment