Cogs.Core
Source
Generators
MeshGenerator.h
1
#pragma once
2
3
#include "ShapeType.h"
4
5
#include "Resources/Resources.h"
6
7
#include <memory>
8
9
namespace
Cogs
10
{
11
namespace
Core
12
{
13
class
Context;
14
15
struct
ShapeCache;
16
17
class
MeshGenerator
18
{
19
public
:
20
MeshGenerator
(
Context
* context);
21
~MeshGenerator
();
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
44
template
<>
inline
Cogs::StringView
getName<Cogs::Core::MeshGenerator>() {
return
"MeshGenerator"
; }
Cogs::Core::Context
A Context instance contains all the services, systems and runtime components needed to use Cogs.
Definition:
Context.h:83
Cogs::Core::MeshGenerator
Definition:
MeshGenerator.h:18
Cogs::StringView
Provides a weakly referenced view over the contents of a string.
Definition:
StringView.h:24
Cogs::Core::ShapeType
ShapeType
Shape types generated by mesh generator.
Definition:
ShapeType.h:19
Cogs
Contains all Cogs related functionality.
Definition:
FieldSetter.h:23
Cogs::Core::Mesh
Meshes contain streams of vertex data in addition to index data and options defining geometry used fo...
Definition:
Mesh.h:265
Cogs::Core::ResourceHandle_t< Mesh >
Cogs::Core::ShapeDefinition
Defines creation values for a unique shape.
Definition:
ShapeType.h:74
Generated by
1.9.6