summaryrefslogtreecommitdiff
path: root/engine-ocean/Game/Components/drawcomponent.h
diff options
context:
space:
mode:
authorjjesswan <jessica_wan@brown.edu>2024-04-22 21:56:26 -0400
committerjjesswan <jessica_wan@brown.edu>2024-04-22 21:56:26 -0400
commita556b45abf18f1bd509daaf63b66b7d55e9fd291 (patch)
treebc9b8a2d184c12aee236e7f9f276a34b84ca552d /engine-ocean/Game/Components/drawcomponent.h
parentcd7c76017a12bb548036571c1ff13e551369d06d (diff)
add engine version
Diffstat (limited to 'engine-ocean/Game/Components/drawcomponent.h')
-rw-r--r--engine-ocean/Game/Components/drawcomponent.h41
1 files changed, 41 insertions, 0 deletions
diff --git a/engine-ocean/Game/Components/drawcomponent.h b/engine-ocean/Game/Components/drawcomponent.h
new file mode 100644
index 0000000..94f4b21
--- /dev/null
+++ b/engine-ocean/Game/Components/drawcomponent.h
@@ -0,0 +1,41 @@
+#ifndef DRAWCOMPONENT_H
+#define DRAWCOMPONENT_H
+
+
+#include "Graphics/global.h"
+#include <string>
+#include "Component.h"
+
+class DrawComponent : public Component
+{
+public:
+ DrawComponent(std::shared_ptr<Shape> shape);
+ DrawComponent(std::shared_ptr<Shape> shape, std::string shape_name);
+
+ // for materials, with multiple shape parts
+ DrawComponent(std::vector<std::shared_ptr<Shape>> shapes);
+
+
+ void draw(const std::shared_ptr<ModelTransform> &entity_mt);
+ void addMaterial(std::string material_name, std::string material_filepath);
+ std::shared_ptr<Material> getMaterial();
+ std::shared_ptr<Shape> getShape();
+ std::vector<std::shared_ptr<Shape>> getShapesWithMaterials();
+ bool objHasMaterial();
+ bool objHasMultipleShapes();
+
+ std::string getShapeName();
+
+private:
+ std::shared_ptr<Shape> m_shape;
+ std::vector<std::shared_ptr<Shape>> m_shapes;
+
+ std::string m_material_name;
+ bool hasMaterial = false;
+ std::string m_shape_name = "empty";
+
+ bool hasMultipleShapes = false;
+
+};
+
+#endif // DRAWCOMPONENT_H