Skip to main content

Vec2Component.ixx File

Included Headers

#include <cassert> #include <helios.math.concepts> #include <helios.math.types>

Namespaces Index

namespacehelios
namespaceengine
namespacecore
namespacecomponents

Classes Index

classVec2Component<TDomainTag, TNumericType, Args>

Generic 2D value component with dirty-state tracking. More...

File Listing

The file content with the documentation metadata removed is:

1module;
2
3#include <cassert>
4
5export module helios.engine.core.components.Vec2Component;
6
7import helios.math.types;
8
9import helios.math.concepts;
10
11using namespace helios::math;
12using namespace helios::math::concepts;
14
22 template<typename TDomainTag, typename TNumericType, typename ... Args>
25
26 helios::math::vec2<TNumericType> value_{};
27
28 bool isDirty_ = true;
29
30 public:
31
32 Vec2Component() = default;
33
39 explicit Vec2Component(const vec2<TNumericType> value) : value_(value){}
40
50 value_(other.value_),
51 isDirty_(true) {}
52
59
66 isDirty_ = true;
67 }
68
75 isDirty_ = true;
76 }
77
82 isDirty_ = false;
83 }
84
91 return isDirty_;
92 }
93
100 return value_;
101 }
102
104 return value_;
105 }
106
112 void setValue(const vec2<TNumericType> value) noexcept {
113
114 if (value_.same(value)) {
115 return;
116 }
117
118 value_ = value;
119 isDirty_ = true;
120 };
121
122
123 };
124
125}

Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.8.