- BUGFIX: Fixed a crash in the normal-loader method of obj loader.

- CHANGE: Improve and fix a bug in texture coordinate loading in obj loader.
- CHANGE: Use ai_assert instead of assert.

git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@112 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
This commit is contained in:
kimmi
2008-08-14 21:25:50 +00:00
parent c1d19035ee
commit fa8edfe207
7 changed files with 203 additions and 47 deletions

View File

@@ -44,6 +44,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <vector>
#include <map>
#include "../include/aiTypes.h"
#include "../include/aiMesh.h"
namespace Assimp
{
@@ -151,12 +152,16 @@ struct Material
//! Illumination model
int illumination_model;
//! Constructor
Material()
{
// empty
}
// Destructor
~Material()
{
// empty
}
};
@@ -165,19 +170,27 @@ struct Material
//! \brief Data structure to store a mesh
struct Mesh
{
/// Array with pointer to all stored faces
std::vector<Face*> m_Faces;
/// Assigned material
Material *m_pMaterial;
/// Number of stored indices.
unsigned int m_uiNumIndices;
/// Number of UV
unsigned int m_uiUVCoordinates[ AI_MAX_NUMBER_OF_TEXTURECOORDS ];
/// Material index.
unsigned int m_uiMaterialIndex;
/// Constructor
Mesh() :
m_pMaterial(NULL),
m_uiNumIndices(0),
m_uiMaterialIndex(0)
{
// empty
memset(m_uiUVCoordinates, 0, sizeof( unsigned int ) * AI_MAX_NUMBER_OF_TEXTURECOORDS);
}
/// Destructor
~Mesh()
{
// empty
@@ -260,6 +273,8 @@ struct Model
}
};
// ------------------------------------------------------------------------------------------------
} // Namespace ObjFile
} // Namespace Assimp