#include "../irr_v2d.h"
#include "../irr_v3d.h"
#include "../irr_aabb3d.h"
-#include <irrList.h>
+#include <list>
// Calculate the borders of a "d-radius" cube
-void getFacePositions(core::list<v3s16> &list, u16 d);
+void getFacePositions(std::list<v3s16> &list, u16 d);
class IndentationRaiser
{
return p;
}
+// The naive swap performs better than the xor version
+#define SWAP(t, x, y) do { \
+ t temp = x; \
+ x = y; \
+ y = temp; \
+} while (0)
+
+inline void sortBoxVerticies(v3s16 &p1, v3s16 &p2) {
+ if (p1.X > p2.X)
+ SWAP(s16, p1.X, p2.X);
+ if (p1.Y > p2.Y)
+ SWAP(s16, p1.Y, p2.Y);
+ if (p1.Z > p2.Z)
+ SWAP(s16, p1.Z, p2.Z);
+}
+
/*
See test.cpp for example cases.
}
}
+inline float cycle_shift(float value, float by = 0, float max = 1)
+{
+ if (value + by < 0) return max + by + value;
+ if (value + by > max) return value + by - max;
+ return value + by;
+}
+
#endif