Cogs.Core
LodComponent.h
1#pragma once
2
3#include "Foundation/ComponentModel/Component.h"
4
5#include <vector>
6
7namespace Cogs
8{
9 namespace Core
10 {
14 enum class LodPolicy
15 {
17 None = 0,
23 };
24
27 {
28 DistanceBased,
29 AreaBased
30 };
31
43 {
44 public:
46 static void registerType();
47
52
63 std::vector<float> thresholds;
64
68 float geometricTolerance = 1.0f;
69
73 bool separateHierarchies = false;
74
75 };
76 }
77}
78
79template<> inline Cogs::StringView getName<Cogs::Core::LodComponent>() { return "LodComponent"; }
80template<> inline Cogs::StringView getName<Cogs::Core::LodPolicy>() { return "LodPolicy"; }
81template<> inline Cogs::StringView getName<Cogs::Core::GeometricErrorKind>() { return "GeometricErrorKind"; }
Base class for Component instances.
Definition: Component.h:143
Contains data describing level of detail behavior for the entity the component belongs to.
Definition: LodComponent.h:43
std::vector< float > thresholds
Threshold values to switch levels of detail at when the policy in use is distance based (for example ...
Definition: LodComponent.h:63
LodPolicy policy
The policy used for determining the level of detail for this entity.
Definition: LodComponent.h:51
float geometricTolerance
Geometric tolerance value applied when the lodPolicy field is set to LodPolicy::GeometricTolerance.
Definition: LodComponent.h:68
static void registerType()
Register the type in the type system.
Definition: LodComponent.cpp:9
bool separateHierarchies
Enable old-style lod'ing with a completely separate hierarchy for each lod-level.
Definition: LodComponent.h:73
Provides a weakly referenced view over the contents of a string.
Definition: StringView.h:24
GeometricErrorKind
Defines kinds of geometric error calculations.
Definition: LodComponent.h:27
LodPolicy
Defines policies for controlling level of detail.
Definition: LodComponent.h:15
@ GeometricTolerance
Use a geometric error bound to determine how refined geometry needs to be at its current position.
Contains all Cogs related functionality.
Definition: FieldSetter.h:23