Transparent blocks should get hit by raycast if they have a collision aabb

master
nic96 2020-07-05 18:30:50 -06:00
parent 60d32ec006
commit fe3c433f76
1 changed files with 3 additions and 0 deletions

View File

@ -40,6 +40,9 @@ Ref<VoxelRaycastResult> 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;
}