Model.h
1 /*
2 
3 Copyright (c) 2018, Johnathan Corkery. (jcorkery@umich.edu)
4 All rights reserved.
5 
6 This file is part of the Dynacoe project (https://github.com/jcorks/Dynacoe)
7 Dynacoe was released under the MIT License, as detailed below.
8 
9 
10 
11 Permission is hereby granted, free of charge, to any person obtaining a copy
12 of this software and associated documentation files (the "Software"), to deal
13 in the Software without restriction, including without limitation the rights
14 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15 copies of the Software, and to permit persons to whom the Software is furnished
16 to do so, subject to the following conditions:
17 
18 The above copyright notice and this permission notice shall
19 be included in all copies or substantial portions of the Software.
20 
21 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
22 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
23 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
24 IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
25 DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
26 ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
27 DEALINGS IN THE SOFTWARE.
28 
29 */
30 #ifndef H_DC_MODEL_INCLUDED
31 #define H_DC_MODEL_INCLUDED
32 
33 #include <Dynacoe/Entity.h>
34 #include <Dynacoe/Modules/Assets.h>
35 
36 namespace Dynacoe {
37 class Mesh;
38 class Material;
39 class Animation;
42 class Model : public Asset {
43  public:
44  Model(const std::string & str) : Asset(str){}
45  ~Model();
46 
47 
51 
55  void AddSection();
56 
59  uint32_t GetSectionCount() const;
60 
63  Mesh & SectionMesh(uint32_t);
64 
67  Material & SectionMaterial(uint32_t);
68 
70  void Clear();
71 
72  // Returns the Animation objects that belong to this actor
73  // All are of type Animation
74  //std::vector<Animation> animations;
75 
76 
77 
78  private:
79 
80  std::vector<Mesh *> meshes;
81  std::vector<Material *> materials;
82  //std::vector<Animation> animations;
83 
84 };
85 
86 
87 
88 }
89 
90 
91 #endif
Definition: AssetID.h:37
3D object defined by triangle primitives.
Definition: Mesh.h:50
void AddSection()
Adds a new section of the Model. A Section includes a Mesh and a Material.
Mesh & SectionMesh(uint32_t)
Returns the Mesh of the given section.
Material & SectionMaterial(uint32_t)
Returns the Material of the given section.
Entity::ID Create()
creates an Entity with many children that, if Draw()n, will express the Model in its entirety ...
void Clear()
Removes all Sections.
A 3D object as a collection of meshes and materials.
Definition: Model.h:42
Defines how an AspectMesh is visualized.
Definition: Material.h:44
uint32_t GetSectionCount() const
Returns the number of sections that belong to the Model.
Uniquely identifies an Entity.
Definition: Entity.h:67