File tree Expand file tree Collapse file tree 4 files changed +64
-1
lines changed
src/main/java/io/github/sceneview/ar Expand file tree Collapse file tree 4 files changed +64
-1
lines changed Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ dependencies {
4848 api project(" :sceneview" )
4949
5050 // ARCore
51- def arcore_version = ' 1.30 .0'
51+ def arcore_version = ' 1.32 .0'
5252 api " com.google.ar:core:$arcore_version "
5353}
5454
Original file line number Diff line number Diff line change @@ -152,6 +152,14 @@ open class ArSceneView @JvmOverloads constructor(
152152 arSession?.cloudAnchorEnabled = value
153153 }
154154
155+ private var _geospatialEnabled = false
156+ var geospatialEnabled: Boolean
157+ get() = arSession?.geospatialEnabled ? : _geospatialEnabled
158+ set(value) {
159+ _geospatialEnabled = value
160+ arSession?.geospatialEnabled = value
161+ }
162+
155163 private var _sessionLightEstimationMode = Config .LightEstimationMode .ENVIRONMENTAL_HDR
156164
157165 /* *
@@ -319,6 +327,7 @@ open class ArSceneView @JvmOverloads constructor(
319327 config.instantPlacementEnabled = _instantPlacementEnabled
320328 config.cloudAnchorEnabled = _cloudAnchorEnabled
321329 config.lightEstimationMode = _sessionLightEstimationMode
330+ config.geospatialEnabled = _geospatialEnabled
322331 }
323332
324333 // Feature config, therefore facing direction, can only be configured once per session.
Original file line number Diff line number Diff line change @@ -217,6 +217,17 @@ class ArSession(
217217 }
218218 }
219219
220+ var geospatialEnabled: Boolean
221+ get() = config.geospatialEnabled
222+ set(value) {
223+ if (geospatialEnabled != value) {
224+ configure {
225+ it.geospatialEnabled = value
226+ }
227+ }
228+ }
229+
230+
220231 /* *
221232 * ### The behavior of the lighting estimation subsystem
222233 *
@@ -329,4 +340,14 @@ var Config.cloudAnchorEnabled
329340 } else {
330341 Config .CloudAnchorMode .DISABLED
331342 }
343+ }
344+
345+ var Config .geospatialEnabled
346+ get() = geospatialMode != Config .GeospatialMode .DISABLED
347+ set(value) {
348+ geospatialMode = if (value) {
349+ Config .GeospatialMode .ENABLED
350+ } else {
351+ Config .GeospatialMode .DISABLED
352+ }
332353 }
Original file line number Diff line number Diff line change 1+ package io.github.sceneview.ar.arcore
2+
3+ import com.google.ar.core.Earth
4+ import dev.romainguy.kotlin.math.Quaternion
5+ import io.github.sceneview.math.Rotation
6+ import io.github.sceneview.math.toQuaternion
7+
8+ fun Earth.createAnchor (
9+ latitude : Double ,
10+ longitude : Double ,
11+ altitude : Double ,
12+ quaternion : Quaternion
13+ ) = createAnchor(
14+ latitude,
15+ longitude,
16+ altitude,
17+ quaternion.x,
18+ quaternion.y,
19+ quaternion.z,
20+ quaternion.w
21+ )
22+
23+ fun Earth.createAnchor (
24+ latitude : Double ,
25+ longitude : Double ,
26+ altitude : Double ,
27+ rotation : Rotation
28+ ) = createAnchor(
29+ latitude,
30+ longitude,
31+ altitude,
32+ rotation.toQuaternion()
33+ )
You can’t perform that action at this time.
0 commit comments