Also merged directions.h into WaveFormCollapse.

This commit is contained in:
Relintai 2022-04-21 23:35:45 +02:00
parent 9f190ca13c
commit bcfb45d049
2 changed files with 7 additions and 13 deletions

View File

@ -1,11 +0,0 @@
#ifndef FAST_WFC_DIRECTION_HPP_
#define FAST_WFC_DIRECTION_HPP_
constexpr int directions_x[4] = { 0, -1, 1, 0 };
constexpr int directions_y[4] = { -1, 0, 0, 1 };
constexpr uint32_t get_opposite_direction(uint32_t direction) {
return 3 - direction;
}
#endif

View File

@ -10,8 +10,6 @@
#include "core/reference.h"
#include "direction.h"
class WaveFormCollapse : public Reference {
GDCLASS(WaveFormCollapse, Reference);
@ -52,6 +50,9 @@ public:
}
};
static constexpr int directions_x[4] = { 0, -1, 1, 0 };
static constexpr int directions_y[4] = { -1, 0, 0, 1 };
public:
bool get_eriodic_output() const;
void set_periodic_output(const bool val);
@ -107,6 +108,10 @@ public:
propagating.push_back(PropagatingEntry(y, x, pattern));
}
constexpr uint32_t get_opposite_direction(uint32_t direction) {
return 3 - direction;
}
void normalize(Vector<double> &v);
Vector<double> get_plogp(const Vector<double> &distribution);
double get_min_abs_half(const Vector<double> &v);