AnimEngine
SolidMeshEntity.hpp
1 #pragma once
2 #ifndef KJY_ANIM_ENGINE_SOLID_MESH_ENTITY_HPP_
3 #define KJY_ANIM_ENGINE_SOLID_MESH_ENTITY_HPP_
4 
5 #include "EntitiesBase.hpp"
6 #include "MeshEntity.hpp"
7 #include <vector>
8 #include <glm/glm.hpp>
9 #include <OOOGL/MidLevel/Geometry.hpp>
10 #include <OOOGL/HighLevel/Material.hpp>
11 #include <components/attachable/Pose.hpp>
12 #include <components/inheritable/drawable.hpp>
13 
14 #pragma warning(disable: 4250) // Disable warnings about dominance in MSVC
15 
16 using namespace OOOGL;
17 
19  /* Just attaching materials.
20  * Leaving these public to avoid headache of writing accessors. It'll just be
21  * a warning if materials indices are nonsense
22  */
23  std::vector<MaterialInterface*> materials;
24  std::vector<int> material_indices;
25 
26  static SurfacedTriangleMesh createQuadPrimitive(bool upload = true);
27  static SurfacedTriangleMesh createQuadPrimitive(glm::vec3 ll, glm::vec3 ul, glm::vec3 ur, glm::vec3 lr, bool upload = true);
28 };
29 
30 
31 struct SolidMeshEntity : public MeshEntity{
32  SolidMeshEntity() {}
33  SolidMeshEntity(const SurfacedTriangleMesh& mesh) : geometry(1, mesh) {}
34 
35  virtual void draw(const MVPset& MVP, Program* shader = nullptr) override;
36  virtual bool canOverrideShader() const override {return(true);}
37  virtual bool requiresOverrideShader() const override {return(false);}
38  virtual const Pose& getPose() const override;
39  virtual Pose& getMutablePose();
40  virtual void setPose(const Pose& pose) override;
41 
42  std::vector<SurfacedTriangleMesh> geometry;
43 
44 };
45 
46 #endif
Definition: Program.h:15
Definition: drawable.hpp:8
Definition: SolidMeshEntity.hpp:31
Definition: MeshEntity.hpp:14
Definition: Geometry.hpp:89
Definition: Pose.hpp:11
Definition: Core_Utilities.cpp:3
Definition: SolidMeshEntity.hpp:18