add advanced entities.raycast overload

This commit is contained in:
MihailRis 2026-07-15 22:21:18 +03:00
parent 66c99adab9
commit f29f3b1bba
10 changed files with 235 additions and 128 deletions

View file

@ -412,6 +412,11 @@ inline void set_rotation(
}
}
struct RaycastSettings {
const std::set<blockid_t>* filter = nullptr;
bool includeNonSelectable = false;
};
/// @brief Cast ray to a selectable block with filter based on id.
/// @param chunks chunks matrix
/// @param start ray start position
@ -431,8 +436,7 @@ voxel* raycast(
glm::vec3& end,
glm::ivec3& norm,
glm::ivec3& iend,
std::set<blockid_t> filter,
bool includeNonSelectable
const RaycastSettings& settings
);
/// @brief Cast ray to a selectable block with filter based on id.
@ -454,8 +458,7 @@ voxel* raycast(
glm::vec3& end,
glm::ivec3& norm,
glm::ivec3& iend,
std::set<blockid_t> filter,
bool includeNonSelectable
const RaycastSettings& settings
);
void get_voxels(