Cogs.Core
ShapeComponent.h
1#pragma once
2
3#include "Foundation/ComponentModel/Component.h"
4
5#include <glm/vec2.hpp>
6#include <glm/vec3.hpp>
7
8#include <memory>
9#include <vector>
10
11namespace Cogs
12{
13 namespace Core
14 {
15 enum class ShapePrimitiveType
16 {
17 Default = 0,
18 TriangleList = 1,
19 TriangleStrip = 2,
20 DefaultLine = 3,
21 LineList = 4,
22 LineStrip = 5,
23 TriangleListAdjacency = 6,
24 TriangleStripAdjacency = 7,
25 LineListAdjacency = 8,
26 LineStripAdjacency = 9,
27 PointList = 10,
28 ShapePrimitiveType_Size,
29 };
30
32 {
33 ShapeComponent() = default;
34
35 std::vector<glm::vec3> positions;
36 std::vector<glm::vec3> normals;
37 std::vector<glm::vec2> texCoords;
38
39 std::vector<int> indexes;
40
41 ShapePrimitiveType primitiveType = ShapePrimitiveType::Default;
42
43 static void registerType();
44 };
45 }
46}
47
48template<> inline Cogs::StringView getName<Cogs::Core::ShapePrimitiveType>() { return "ShapePrimitiveType"; }
49
50template<> inline Cogs::StringView getName<Cogs::Core::ShapeComponent>() { return "ShapeComponent"; }
Base class for Component instances.
Definition: Component.h:143
Provides a weakly referenced view over the contents of a string.
Definition: StringView.h:24
Contains all Cogs related functionality.
Definition: FieldSetter.h:23