/* This file is part of Daydream Engine. Copyright 2014 Adam Byléhn, Tobias Dahl, Simon Holmberg, Viktor Ljung Daydream Engine is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Daydream Engine is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with Daydream Engine. If not, see . */ #ifndef RawModel_h__ #define RawModel_h__ #include #include #include #include #include #include #include #include #include #include #include #include #include "Core/ResourceManager.h" #include "Rendering/Texture.h" #include "Rendering/Skeleton.h" namespace dd { class RawModel : public Resource { friend class ResourceManager; protected: RawModel(std::string fileName); public: ~RawModel(); struct Vertex { glm::vec3 Position; glm::vec3 Normal; glm::vec3 Tangent; glm::vec3 BiTangent; glm::vec2 TextureCoords; glm::vec4 DiffuseVertexColor; glm::vec4 SpecularVertexColor; glm::vec4 BoneIndices1; glm::vec4 BoneIndices2; glm::vec4 BoneWeights1; glm::vec4 BoneWeights2; }; struct MaterialGroup { float Shininess; std::shared_ptr Texture; std::shared_ptr NormalMap; std::shared_ptr SpecularMap; unsigned int StartIndex; unsigned int EndIndex; }; std::vector TextureGroups; std::vector m_Vertices; std::vector m_Indices; Skeleton* m_Skeleton = nullptr; private: std::vector BoneIndices; std::vector BoneWeights; std::vector Normals; std::vector DiffuseVertexColor; std::vector SpecularVertexColor; std::vector TangentNormals; std::vector BiTangentNormals; std::vector TextureCoords; void CreateSkeleton(std::vector> &boneInfo, std::map &boneNameMapping, aiNode* node, int parentID); }; } #endif