mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-12 06:21:50 +00:00
add advanced entities.raycast overload
This commit is contained in:
parent
66c99adab9
commit
f29f3b1bba
10 changed files with 235 additions and 128 deletions
|
|
@ -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(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue