summaryrefslogtreecommitdiffstats
path: root/scene/resources
diff options
context:
space:
mode:
Diffstat (limited to 'scene/resources')
-rw-r--r--scene/resources/environment.cpp2
-rw-r--r--scene/resources/importer_mesh.cpp4
2 files changed, 5 insertions, 1 deletions
diff --git a/scene/resources/environment.cpp b/scene/resources/environment.cpp
index abe1561310..b936c2decf 100644
--- a/scene/resources/environment.cpp
+++ b/scene/resources/environment.cpp
@@ -1172,7 +1172,7 @@ void Environment::_bind_methods() {
ADD_GROUP("Sky", "sky_");
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "sky", PROPERTY_HINT_RESOURCE_TYPE, "Sky"), "set_sky", "get_sky");
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "sky_custom_fov", PROPERTY_HINT_RANGE, "0,180,0.1,degrees"), "set_sky_custom_fov", "get_sky_custom_fov");
- ADD_PROPERTY(PropertyInfo(Variant::VECTOR3, "sky_rotation", PROPERTY_HINT_RANGE, "-360,360,0.1,or_less,or_greater,radians"), "set_sky_rotation", "get_sky_rotation");
+ ADD_PROPERTY(PropertyInfo(Variant::VECTOR3, "sky_rotation", PROPERTY_HINT_RANGE, "-360,360,0.1,or_less,or_greater,radians_as_degrees"), "set_sky_rotation", "get_sky_rotation");
// Ambient light
diff --git a/scene/resources/importer_mesh.cpp b/scene/resources/importer_mesh.cpp
index f479ae1e1b..092ba84aa5 100644
--- a/scene/resources/importer_mesh.cpp
+++ b/scene/resources/importer_mesh.cpp
@@ -514,6 +514,10 @@ void ImporterMesh::generate_lods(float p_normal_merge_angle, float p_normal_spli
const Vector3 &v2 = vertices_ptr[new_indices_ptr[j + 2]];
Vector3 face_normal = vec3_cross(v0 - v2, v0 - v1);
float face_area = face_normal.length(); // Actually twice the face area, since it's the same error_factor on all faces, we don't care
+ if (!Math::is_finite(face_area) || face_area == 0) {
+ WARN_PRINT_ONCE("Ignoring face with non-finite normal in LOD generation.");
+ continue;
+ }
Vector3 dir = face_normal / face_area;
int ray_count = CLAMP(5.0 * face_area * error_factor, 16, 64);