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
|`worldAlignment`|`Enumeration` <br /> One of: `ARKit.ARWorldAlignment.Gravity`, `ARKit.ARWorldAlignment.GravityAndHeading`, `ARKit.ARWorldAlignment.Camera` (documentation [here](https://developer.apple.com/documentation/arkit/arworldalignment)) |`ARKit.ARWorldAlignment.Gravity`|**ARWorldAlignmentGravity** <br /> The coordinate system's y-axis is parallel to gravity, and its origin is the initial position of the device. **ARWorldAlignmentGravityAndHeading** <br /> The coordinate system's y-axis is parallel to gravity, its x- and z-axes are oriented to compass heading, and its origin is the initial position of the device. **ARWorldAlignmentCamera** <br /> The scene coordinate system is locked to match the orientation of the camera.|
180
+
|`origin`|`{position, transition}`| Usually `{0,0,0}` is where you launched the app. If you want to have a different origin, you can set it here. E.g. if you set `origin={{position: {0,-1, 0}, transition: {duration: 1}}}` the new origin will be one meter below. If you have any objects already placed, they will get moved down using the given transition. All hit-test functions or similar will report coordinates relative to that new origin as `position`. You can get the original coordinates with `positionAbsolute` in these functions |
179
181
180
182
##### Events
181
183
182
184
| Event Name | Returns | Notes
183
185
|---|---|---|
184
-
| `onPlaneDetected` | `{ id, center, extent }` | When a plane is first detected.
186
+
|`onARKitError`|`ARKiterror`| will report whether an error occured while initializing ARKit. A common error is when the user has not allowed camera access. Another error is, if you use `worldAlignment=GravityAndHeading` and location service is turned off |
185
187
| `onLightEstimation` | `{ ambientColorTemperature, ambientIntensity }` | Light estimation on every frame. Called rapidly, better use polling. See `ARKit.getCurrentLightEstimation()`
186
188
| `onFeaturesDetected` | `{ featurePoints}` | Detected Features on every frame (currently also not throttled). Usefull to display custom dots for detected features. You can also poll this information with `ARKit.getCurrentDetectedFeaturePoints()`
187
-
| `onPlaneUpdate` | `{ id, center, extent }` | When a detected plane is updated
189
+
| `onPlaneDetected` | `Plane` | When a plane is first detected.
190
+
| `onPlaneUpdate` | `Plane` | When a detected plane is updated
191
+
| `onPlaneRemoved` | `Plane` | When a detected plane is updated
192
+
193
+
The `Plane` object has the following properties:
194
+
195
+
| Property | Description
196
+
|---|---|
197
+
|`id`| a unique id identifying the plane |
198
+
|`position`| the position of the plane (relative to the origin) |
199
+
|`positionAbsolute`| the absolute position of the plane |
200
+
|`extent`| the extent of the plane |
201
+
|`eulerAngles`| the rotation of the plane |
202
+
203
+
204
+
188
205
189
206
##### Static methods
190
207
@@ -253,7 +270,7 @@ Most objects take a material property with these sub-props:
253
270
|`doubleSided`| boolean | render both sides, default is `true`|
254
271
|`litPerPixel`| boolean | calculate lighting per-pixel or vertex [litPerPixel](https://developer.apple.com/documentation/scenekit/scnmaterial/1462580-litperpixel)|
|`shaders`| Object with keys from `ARKit.ShaderModifierEntryPoint.*` and shader strings as values |[Shader modifiers](https://developer.apple.com/documentation/scenekit/scnshadable)|
259
276
|`colorBufferWriteMask`|`ARKit.ColorMask.*`|[color mask](https://developer.apple.com/documentation/scenekit/scncolormask). Set to ARKit.ColorMask.None so that an object is transparent, but receives deferred shadows. |
0 commit comments