summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Gilleron <marc.gilleron@gmail.com>2017-09-25 23:17:23 +0200
committerMarc Gilleron <marc.gilleron@gmail.com>2017-09-25 23:17:23 +0200
commit2ac8c2fa91ad1b7b1612c6621898087600192b9b (patch)
treeab4dc34b02129c77114888a15664c5b51aa00361
parent5195935156f942418a2ef3f1159a4bab391ba11e (diff)
In editor, instance DirectionalLight with an initial sun-like orientation
-rw-r--r--scene/3d/light.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/scene/3d/light.cpp b/scene/3d/light.cpp
index 7402e664d9..b7cd9bd2dc 100644
--- a/scene/3d/light.cpp
+++ b/scene/3d/light.cpp
@@ -369,6 +369,12 @@ DirectionalLight::DirectionalLight()
set_shadow_depth_range(SHADOW_DEPTH_RANGE_STABLE);
blend_splits = false;
+
+#ifdef TOOLS_ENABLED
+ if (Engine::get_singleton()->is_editor_hint())
+ // Create light with a default natural "sun" orientation in editor, instead of looking horizontally on X
+ set_rotation_in_degrees(Vector3(-50, 25, 30));
+#endif
}
void OmniLight::set_shadow_mode(ShadowMode p_mode) {