Merge branch 'main' into heightmaps
This commit is contained in:
@@ -413,7 +413,8 @@ voxel* Chunks::rayCast(
|
||||
float maxDist,
|
||||
glm::vec3& end,
|
||||
glm::ivec3& norm,
|
||||
glm::ivec3& iend
|
||||
glm::ivec3& iend,
|
||||
std::set<blockid_t> filter
|
||||
) {
|
||||
float px = start.x;
|
||||
float py = start.y;
|
||||
@@ -453,8 +454,10 @@ voxel* Chunks::rayCast(
|
||||
if (voxel == nullptr) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
const auto& def = indices->blocks.require(voxel->id);
|
||||
if (def.selectable) {
|
||||
if ((filter.empty() && def.selectable) ||
|
||||
(!filter.empty() && filter.find(def.rt.id) == filter.end())) {
|
||||
end.x = px + t * dx;
|
||||
end.y = py + t * dy;
|
||||
end.z = pz + t * dz;
|
||||
|
||||
Reference in New Issue
Block a user