Use double-sided material for RayCast

This makes RayCasts visible if the camera is fully inside one
(e.g. a RayCast parented to the current Camera).
This commit is contained in:
Hugo Locurcio 2021-06-19 09:12:58 +02:00
parent 622f744ad0
commit 3143f5fcc5
No known key found for this signature in database
GPG Key ID: 39E8F8BE30B0A49C

View File

@ -415,6 +415,8 @@ void RayCast::_update_debug_shape_material(bool p_check_collision) {
material->set_flag(SpatialMaterial::FLAG_UNSHADED, true);
material->set_feature(SpatialMaterial::FEATURE_TRANSPARENT, true);
// Use double-sided rendering so that the RayCast can be seen if the camera is inside.
material->set_cull_mode(SpatialMaterial::CULL_DISABLED);
}
Color color = debug_shape_custom_color;