add 'grounded' support for 'pipe' rotation profile

This commit is contained in:
MihailRis
2024-07-10 09:14:24 +03:00
parent 359123bb36
commit 4c8ae465c7
4 changed files with 21 additions and 5 deletions
+9
View File
@@ -202,4 +202,13 @@ public:
Block(const Block&) = delete;
};
inline glm::ivec3 get_ground_direction(const Block* def, int rotation) {
const auto& profileName = def->rotations.name;
if (profileName == BlockRotProfile::PIPE_NAME) {
return -def->rotations.variants[rotation].axisY;
} else {
return glm::ivec3(0, -1, 0);
}
}
#endif // VOXELS_BLOCK_HPP_