Cogs.Core
UniformGridComponent.cpp
1#include "UniformGridComponent.h"
2#include "Types.h"
3
4using namespace Cogs::Reflection;
5
6void Cogs::Core::EchoSounder::UniformGridComponent::registerType()
7{
8 static constexpr EnumeratorDef enums[] = {
9 { "Reference", ComputeType::Reference },
10 { "SSE41", ComputeType::SSE41 },
11 { "FMA", ComputeType::FMA },
12 { "AVX2", ComputeType::AVX2 },
13 };
14 TypeDatabase::createType<ComputeType>().setEnumerators(enums);
15
16 Field fields[] = {
17 Field(Name("size"), &UniformGridComponent::size),
18 Field::create(Name("scale"), &UniformGridComponent::scale).setRange(glm::vec3(0.0f), glm::vec3(4.0f)),
19 Field::create(Name("max_tiles"), &UniformGridComponent::max_tiles).setRange((uint32_t)0, (uint32_t)100000),
20 Field::create(Name("decibelMin"), &UniformGridComponent::decibelMin).setRange(-100.0f, 0.0f),
21 Field::create(Name("decibelMax"), &UniformGridComponent::decibelMax).setRange(-100.0f, 0.0f),
22 Field::create(Name("average_alpha"), &UniformGridComponent::average_alpha).setRange(0.0f, 1.0f),
23 Field::create(Name("filter_width"), &UniformGridComponent::filter_width).setRange(0.0f, 30.0f),
24 Field::create(Name("filter_falloff"), &UniformGridComponent::filter_falloff).setRange(0.0f, 1.0f),
25 Field(Name("compute"), &UniformGridComponent::compute),
26 Field(Name("show_frustum"), &UniformGridComponent::show_frustum),
27 };
28 TypeDatabase::createType<UniformGridComponent>()
29 .setFields(fields)
30 .setBase<Component>();
31}
Field definition describing a single data member of a data structure.
Definition: Field.h:68
static FieldWrapper< Field, FieldType > create(const Name &name, FieldType ClassType::*field)
Creates a new field instance, returning a wrapper for type safe continuation style setup.
Definition: Field.inl:29
Contains reflection support.
Definition: Component.h:11
Represents an unique name.
Definition: Name.h:70