You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+27-4Lines changed: 27 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -37,23 +37,46 @@ dependencies {
37
37
## Usage
38
38
39
39
*res/layout/main_fragment.xml*
40
+
- 3D only
40
41
```xml
41
-
// 3D only
42
42
<io.github.sceneview.SceneView
43
43
android:id="@+id/sceneView"
44
44
android:layout_width="match_parent"
45
45
android:layout_height="match_parent" />
46
46
```
47
47
48
-
48
+
- 3D and ARCore
49
49
```xml
50
-
// 3D and ARCore
51
50
<io.github.sceneview.ar.ArSceneView
52
51
android:id="@+id/sceneView"
53
52
android:layout_width="match_parent"
54
53
android:layout_height="match_parent" />
55
54
```
56
55
56
+
## Camera Permission and ARCore install/update/unsupported
57
+
58
+
The `ArSceneView` handles the camera permission ask and the ARCore requirements automatically and will be proceed when your view is attached to the Activity/Fragment
59
+
If you need it, you can add a listener on both ARCore success or failed session creation (including
60
+
camera permission denied since a session cannot be created without it).
61
+
62
+
- Camera permission has been granted and latest ARCore Services version are already installed or have been installed during the auto check
// If AR is not available, we add the model directly to the scene for a 3D only usage
76
+
sceneView.addChild(modelNode)
77
+
}
78
+
```
79
+
57
80
## Why have we included the Kotlin-Math library in SceneView?
58
81
59
82
Earlier versions of OpenGL had a fixed rendering pipeline and provided an API for setting positions of vertices, transformation and projection matrices, etc. However, with the new rendering pipeline it is required to prepare this data before passing it to GLSL shaders and OpenGL doesn't provide any mathematical functions to do that.
@@ -75,7 +98,7 @@ You will have a little work to do if you are using the `ArFragment` in Sceneform
75
98
After the migration you should get cleaner code and all of the benefits described in the [Features](#Features) section :tada:
76
99
77
100
#### Requesting the camera permission and installing/updating the Google Play Services for AR
78
-
This is handled automatically in the `ArSceneView`. You can use the `ArSceneView.onARCoreException` property to register a callback to be invoked when the ARCore Session cannot be initialized because ARCore is not available on the device or the camera permission has been denied.
101
+
This is handled automatically in the `ArSceneView`. You can use the `ArSceneView.onArSessionFailed` property to register a callback to be invoked when the ARCore Session cannot be initialized because ARCore is not available on the device or the camera permission has been denied.
79
102
80
103
#### Instructions for AR
81
104
The `InstructionsController` in the `BaseArFragment` has been replaced with the `Instructions` in the `ArSceneView`.
0 commit comments