mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-10 21:41:50 +00:00
Merge branch 'main' into volume-renderer
This commit is contained in:
commit
d9a7afad05
42 changed files with 539 additions and 196 deletions
|
|
@ -54,6 +54,11 @@ struct BlockFuncsSet {
|
|||
bool onblockremoved : 1;
|
||||
};
|
||||
|
||||
struct BlockFuncNamesCache {
|
||||
std::string update;
|
||||
std::string randomUpdate;
|
||||
};
|
||||
|
||||
struct CoordSystem {
|
||||
std::array<glm::ivec3, 3> axes;
|
||||
/// @brief Grid 3d position fix offset (for negative vectors)
|
||||
|
|
@ -296,6 +301,8 @@ public:
|
|||
blockid_t surfaceReplacement = 0;
|
||||
|
||||
std::set<int> tags;
|
||||
|
||||
BlockFuncNamesCache eventNames;
|
||||
} rt {};
|
||||
|
||||
Block(const std::string& name);
|
||||
|
|
|
|||
|
|
@ -40,6 +40,8 @@ public:
|
|||
bool dirtyHeights : 1;
|
||||
} flags {};
|
||||
|
||||
uint64_t lastRandomTickId = -1;
|
||||
|
||||
/// @brief Block inventories map where key is index of block in voxels array
|
||||
ChunkInventoriesMap inventories;
|
||||
/// @brief Blocks metadata heap
|
||||
|
|
@ -81,4 +83,10 @@ public:
|
|||
glm::vec3((x + 1) * CHUNK_W, INFINITY, (z + 1) * CHUNK_D)
|
||||
);
|
||||
}
|
||||
|
||||
bool isBlockInside(int x, int z) const {
|
||||
x -= this->x * CHUNK_W;
|
||||
z -= this->z * CHUNK_D;
|
||||
return x >= 0 && z >= 0 && x < CHUNK_W && z < CHUNK_D;
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue