Cogs.Core
MeshGenerator.h
1#pragma once
2
3#include "ShapeType.h"
4
5#include "Resources/Resources.h"
6
7#include <memory>
8
9namespace Cogs
10{
11 namespace Core
12 {
13 class Context;
14
15 struct ShapeCache;
16
18 {
19 public:
20 MeshGenerator(Context * context);
22
23 void cleanup();
24
25 COGSCORE_DLL_API MeshHandle getMesh(ShapeType shape, int samples, glm::vec3 size = glm::vec3(1, 1, 1), float arcStart = 0.0f, float arcEnd = 0.0f);
26 void getMesh(Mesh * mesh, const ShapeDefinition & definition);
27
28 void setMaxSamples(int maxSamples) {
29 kMaxSamples = maxSamples;
30 }
31
32 COGSCORE_DLL_API void purgeCache();
33
34 private:
35 Context * context;
36 int kMaxSamples = 150;
37 int kRefinementLevels = 30;
38
39 std::unique_ptr<ShapeCache> cache;
40 };
41 }
42}
43
44template<> inline Cogs::StringView getName<Cogs::Core::MeshGenerator>() { return "MeshGenerator"; }
A Context instance contains all the services, systems and runtime components needed to use Cogs.
Definition: Context.h:83
Provides a weakly referenced view over the contents of a string.
Definition: StringView.h:24
ShapeType
Shape types generated by mesh generator.
Definition: ShapeType.h:19
Contains all Cogs related functionality.
Definition: FieldSetter.h:23
Meshes contain streams of vertex data in addition to index data and options defining geometry used fo...
Definition: Mesh.h:265
Defines creation values for a unique shape.
Definition: ShapeType.h:74