69 lines
1.6 KiB
C++
69 lines
1.6 KiB
C++
#ifndef VOXELSPACE_H
|
|
#define VOXELSPACE_H
|
|
|
|
#include <vector>
|
|
#include <cstdint>
|
|
|
|
namespace Voxel {
|
|
constexpr int NUM_ROTS_3D = 24;
|
|
|
|
struct Extrema {
|
|
int xMax;
|
|
int xMin;
|
|
int yMax;
|
|
int yMin;
|
|
int zMax;
|
|
int zMin;
|
|
};
|
|
|
|
struct Space {
|
|
uint64_t space;
|
|
int dim_x;
|
|
int dim_y;
|
|
int dim_z;
|
|
};
|
|
|
|
auto newIndexRotX(Space *space, int x, int y, int z) -> int;
|
|
|
|
auto newIndexRotY(Space *space, int x, int y, int z) -> int;
|
|
|
|
auto newIndexRotZ(Space *space, int x, int y, int z) -> int;
|
|
|
|
auto toggle(uint64_t space, int index) -> uint64_t;
|
|
|
|
auto set(uint64_t space, int index, bool val) -> uint64_t;
|
|
|
|
auto collides(Space *a, Space *b) -> bool;
|
|
auto collides(uint64_t a, uint64_t b) -> bool;
|
|
|
|
auto add(Space *a, Space *b) -> Space;
|
|
|
|
auto filledAt(Space *space, int x, int y, int z) -> bool;
|
|
|
|
auto getExtrema(Space *space) -> Extrema;
|
|
|
|
auto cullEmptySpace(Space *space) -> void;
|
|
|
|
auto isMatch(Space *a, Space *b) -> bool;
|
|
|
|
auto rotate90X(Space *space) -> void;
|
|
|
|
auto rotate90Y(Space *space) -> void;
|
|
|
|
auto rotate90Z(Space *space) -> void;
|
|
|
|
auto pushNewUniqueSpins(std::vector<Space> *existingSpaces, Space* spaceToSpin) -> void;
|
|
|
|
auto getUniqueRotations(Space *space) -> std::vector<Space>;
|
|
|
|
auto getAllRotations(Space *space) -> std::vector<Space>;
|
|
|
|
auto getAllPositionsInPrism(Space *space, int prism_dims[3]) -> std::vector<uint64_t>;
|
|
|
|
auto getAllPermutationsInPrism(Space *space, int prism_dims[3]) -> std::vector<uint64_t>;
|
|
|
|
auto size(uint64_t space) -> int;
|
|
}
|
|
|
|
#endif
|