Cogs.Core
MeshGeneratorComponent.cpp
1#include "MeshGeneratorComponent.h"
2
3#include "Types.h"
4
5using namespace Cogs::Reflection;
6
8{
9 static constexpr EnumeratorDef enumerators[] = {
10 { "Sphere", ShapeType::Sphere },
11 { "SphereGeoTexCyl", ShapeType::SphereGeoTexCyl },
12 { "SphereGeoTexSph", ShapeType::SphereGeoTexSph },
13 { "Cylinder", ShapeType::Cylinder },
14 { "Cone", ShapeType::Cone },
15 { "Cube", ShapeType::Cube },
16 { "CubeTex2D", ShapeType::CubeTex2D },
17 { "WireCube", ShapeType::WireCube },
18 { "None", ShapeType::None },
19 { "Plane", ShapeType::Plane },
20 { "CoordSys", ShapeType::CoordSys },
21 { "CircularArc", ShapeType::CircularArc },
22 };
23
24 TypeDatabase::createType<ShapeType>().setEnumerators(enumerators);
25
26 Field fields[] = {
32 };
33
34 TypeDatabase::createType<MeshGeneratorComponent>()
35 .setBase<Component>()
36 .setFields(fields);
37}
Field definition describing a single data member of a data structure.
Definition: Field.h:68
@ CubeTex2D
Cube shape with unit square texture coordinates over each face.
@ CircularArc
Flat circular arc with inner (size.x) and outer (size.y) radius on the XY plane. Can be extended (arc...
@ Plane
Plane shape.
@ Cylinder
Generic cylinder shape.
@ SphereGeoTexCyl
Sphere shape with geodesic tessellation and cylindrical texture coordinates.
@ SphereGeoTexSph
Sphere shape with geodesic tessellation and spherical texture coordinates.
@ Cube
Generic cube shape.
@ Sphere
Generic sphere shape.
@ Cone
Generic cone shape.
@ CoordSys
Simple coordinate system where X axis is red, Y axis is green and Z axis is blue.
Contains reflection support.
Definition: Component.h:11
ShapeType shape
Shape of the mesh to generate.
int samples
Sample complexity of the mesh.
static void registerType()
Register the type in the type system.