summaryrefslogtreecommitdiff
path: root/themes/src/Windfield.hpp
diff options
context:
space:
mode:
authormattkae <mattkae@protonmail.com>2023-01-22 18:59:38 -0500
committermattkae <mattkae@protonmail.com>2023-01-22 18:59:38 -0500
commit22c7d2cfa31d83eb81c5ab397e287c2212691e71 (patch)
tree38ba6db608beff7cbc1ed476531eb02befd44942 /themes/src/Windfield.hpp
parent64a8d78225e6539ca25374596fe5de44e6252a62 (diff)
WIP on Wind Fields, and updated resume
Diffstat (limited to 'themes/src/Windfield.hpp')
-rw-r--r--themes/src/Windfield.hpp38
1 files changed, 38 insertions, 0 deletions
diff --git a/themes/src/Windfield.hpp b/themes/src/Windfield.hpp
new file mode 100644
index 0000000..5935c5d
--- /dev/null
+++ b/themes/src/Windfield.hpp
@@ -0,0 +1,38 @@
+#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.
+ */
+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