Importing custom mesh without material.
This commit is contained in:
@@ -9,7 +9,8 @@
|
||||
|
||||
#include "../Core/Ray.h"
|
||||
#include "../Core/AABB.h"
|
||||
#include "Engine/Rendering/RawModelAssimp.h"
|
||||
//#include "Engine/Rendering/RawModelAssimp.h"
|
||||
#include "Engine/Rendering/RawModelCustom.h"
|
||||
#include "../Core/Entity.h"
|
||||
|
||||
class World;
|
||||
|
||||
@@ -32,10 +32,10 @@ public:
|
||||
};
|
||||
struct FailedLoadingException : public std::exception
|
||||
{
|
||||
virtual const char* what() const throw()
|
||||
{
|
||||
return "Resource is failed to load.";
|
||||
}
|
||||
FailedLoadingException(char const* const _Message)
|
||||
: std::exception(_Message)
|
||||
{ }
|
||||
FailedLoadingException() :std::exception("Resource failed to load.") { };
|
||||
};
|
||||
|
||||
// Pretend that this is a pure virtual function that you have to implement
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef Model_h__
|
||||
#define Model_h__
|
||||
|
||||
#include "RawModelAssimp.h"
|
||||
#include "RawModelCustom.h"
|
||||
#include "../OpenGL.h"
|
||||
|
||||
class Model : public ThreadUnsafeResource
|
||||
@@ -23,8 +23,6 @@ public:
|
||||
private:
|
||||
RawModel* m_RawModel;
|
||||
GLuint VertexBuffer;
|
||||
GLuint DiffuseVertexColorBuffer;
|
||||
GLuint SpecularVertexColorBuffer;
|
||||
GLuint NormalBuffer;
|
||||
GLuint TangentNormalsBuffer;
|
||||
GLuint BiTangentNormalsBuffer;
|
||||
|
||||
@@ -40,15 +40,22 @@ public:
|
||||
|
||||
struct MaterialGroup
|
||||
{
|
||||
float Shininess;
|
||||
std::shared_ptr<::Texture> Texture;
|
||||
std::shared_ptr<::Texture> NormalMap;
|
||||
std::shared_ptr<::Texture> SpecularMap;
|
||||
float SpecularExponent;
|
||||
float ReflectionFactor;
|
||||
unsigned int StartIndex;
|
||||
unsigned int EndIndex;
|
||||
//float Transparency;
|
||||
std::string TexturePath;
|
||||
std::shared_ptr<::Texture> Texture;
|
||||
std::string NormalMapPath;
|
||||
std::shared_ptr<::Texture> NormalMap;
|
||||
std::string SpecularMapPath;
|
||||
std::shared_ptr<::Texture> SpecularMap;
|
||||
std::string IncandescenceMapPath;
|
||||
std::shared_ptr<::Texture> IncandescenceMap;
|
||||
};
|
||||
|
||||
std::vector<MaterialGroup> TextureGroups;
|
||||
std::vector<MaterialGroup> MaterialGroups;
|
||||
|
||||
std::vector<Vertex> m_Vertices;
|
||||
std::vector<unsigned int> m_Indices;
|
||||
@@ -57,10 +64,10 @@ public:
|
||||
|
||||
private:
|
||||
|
||||
bool ReadMeshFileHeader(unsigned int& offset, char* fileData, unsigned int& fileByteSize);
|
||||
bool ReadMesh(unsigned int& offset, char* fileData, unsigned int& fileByteSize);
|
||||
bool ReadVertices(unsigned int& offset, char* fileData, unsigned int& fileByteSize);
|
||||
bool ReadIndices(unsigned int& offset, char* fileData, unsigned int& fileByteSize);
|
||||
void ReadMeshFileHeader(unsigned int& offset, char* fileData, unsigned int& fileByteSize);
|
||||
void ReadMesh(unsigned int& offset, char* fileData, unsigned int& fileByteSize);
|
||||
void ReadVertices(unsigned int& offset, char* fileData, unsigned int& fileByteSize);
|
||||
void ReadIndices(unsigned int& offset, char* fileData, unsigned int& fileByteSize);
|
||||
|
||||
//void CreateSkeleton(std::vector<std::tuple<std::string, glm::mat4>> &boneInfo, std::map<std::string, int> &boneNameMapping, aiNode* node, int parentID);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user