From 99d5cef99f117975c86139efdbab103b204f8d85 Mon Sep 17 00:00:00 2001 From: ThomasGorisse Date: Wed, 24 Nov 2021 12:00:37 +0100 Subject: [PATCH] Fix #207: LightEstimationConfig init --- core/src/main/java/com/google/ar/sceneform/ArSceneView.java | 2 +- .../src/main/java/com/gorisse/thomas/sceneform/ArSceneView.kt | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/core/src/main/java/com/google/ar/sceneform/ArSceneView.java b/core/src/main/java/com/google/ar/sceneform/ArSceneView.java index c765b135..415abc5d 100644 --- a/core/src/main/java/com/google/ar/sceneform/ArSceneView.java +++ b/core/src/main/java/com/google/ar/sceneform/ArSceneView.java @@ -67,7 +67,7 @@ public class ArSceneView extends SceneView { * @see ArSceneViewKt#setEstimatedEnvironmentLights(ArSceneView, EnvironmentLightsEstimate) * @see ArSceneViewKt#getEstimatedEnvironmentLights(ArSceneView) */ - public LightEstimationConfig _lightEstimationConfig; + public LightEstimationConfig _lightEstimationConfig = new LightEstimationConfig(); private AtomicBoolean isProcessingFrame = new AtomicBoolean(false); @Nullable diff --git a/core/src/main/java/com/gorisse/thomas/sceneform/ArSceneView.kt b/core/src/main/java/com/gorisse/thomas/sceneform/ArSceneView.kt index ee777c09..ca2af804 100644 --- a/core/src/main/java/com/gorisse/thomas/sceneform/ArSceneView.kt +++ b/core/src/main/java/com/gorisse/thomas/sceneform/ArSceneView.kt @@ -32,9 +32,7 @@ import com.gorisse.thomas.sceneform.light.* * @see LightEstimationConfig.AMBIENT_INTENSITY */ var ArSceneView.lightEstimationConfig: LightEstimationConfig - get() = _lightEstimationConfig ?: LightEstimationConfig().also { - _lightEstimationConfig = it - } + get() = _lightEstimationConfig set(value) { if (_lightEstimationConfig != value) { if (sessionConfig != null && value.mode != sessionConfig?.lightEstimationMode) {