From fe3c433f766267357c34164b285510c1564373f8 Mon Sep 17 00:00:00 2001 From: nic96 Date: Sun, 5 Jul 2020 18:30:50 -0600 Subject: [PATCH] Transparent blocks should get hit by raycast if they have a collision aabb --- edition/voxel_tool_terrain.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/edition/voxel_tool_terrain.cpp b/edition/voxel_tool_terrain.cpp index 0d39d9c7..f74ed6c0 100644 --- a/edition/voxel_tool_terrain.cpp +++ b/edition/voxel_tool_terrain.cpp @@ -40,6 +40,9 @@ Ref VoxelToolTerrain::raycast(Vector3 pos, Vector3 dir, floa if (voxel.is_transparent() == false) return true; + if (voxel.is_transparent() && voxel.get_collision_aabbs().empty() == false) + return true; + float v1 = map->get_voxel_f(pos, VoxelBuffer::CHANNEL_SDF); return v1 < 0; }