summaryrefslogtreecommitdiff
path: root/themes/src/winter/Windfield.hpp
diff options
context:
space:
mode:
authormattkae <mattkae@protonmail.com>2023-04-03 06:35:27 -0400
committermattkae <mattkae@protonmail.com>2023-04-03 06:35:27 -0400
commit5d3ff36045bfb11af0f373d5ecee7c9b54e4c4f9 (patch)
tree1877c85fc652603312c1093ff31678ab807616b2 /themes/src/winter/Windfield.hpp
parent9e21251ea16e594c8ef416cf8a6b8ebbbb42a858 (diff)
Folderized all of the seasons and loading the shaders from a remote source
Diffstat (limited to 'themes/src/winter/Windfield.hpp')
-rw-r--r--themes/src/winter/Windfield.hpp39
1 files changed, 39 insertions, 0 deletions
diff --git a/themes/src/winter/Windfield.hpp b/themes/src/winter/Windfield.hpp
new file mode 100644
index 0000000..5bf0c38
--- /dev/null
+++ b/themes/src/winter/Windfield.hpp
@@ -0,0 +1,39 @@
+#ifndef WIND_FIELD_HPP
+#define WIND_FIELD_HPP
+#include "../types.h"
+#include "../mathlib.h"
+
+/**
+ A Windfield represents a field of vectors in a rectangular region.
+ The Width and Height are given in units of CellDimenions. The CellDimension
+ is given in pixels.
+ */
+template <i32 Width, i32 Height, i32 CellDimension>
+struct WindField {
+ f32 ttl = 0.f;
+ Vector2 origin;
+ Vector2 end;
+
+ /*
+ Granularity of each cell in pixels.
+ */
+ const f32 cellDimension = CellDimension;
+
+ /*
+ Width of the vector field in CellDimensions.
+ */
+ const f32 width = Width;
+
+ /*
+ Height of the vector vield in CellDimensions.
+ */
+ const f32 height = Height;
+
+ Vector2** field;
+
+ void load(f32 cellSizePixels, i32 fieldWithCells, i32 fieldHeightCells, f32 ttl, Vector2 origin);
+ bool addVector(i32 x, i32 y, Vector2& v);
+ Vector2 getWindFactor(Vector2& v);
+};
+
+#endif