@onirix/ar-engine-sdk 1.5.6 → 1.6.0

Sign up to get free protection for your applications and to get access to all the features.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## v1.5.7 (2024-01-22)
4
+
5
+ ### Added
6
+
7
+ - Improved World-Tracking to handle better outdoor environments and rotation-only movements.
8
+
3
9
  ## v1.5.6 (2023-12-05)
4
10
 
5
11
  ### Added
package/README.md CHANGED
@@ -11,6 +11,7 @@ Onirix AR Engine SDK is compatible with the following Onirix **tracking modes**:
11
11
  * **Surface**: Will use device camera and motion sensors to track an object fixed over any place or surface. This mode has 2 different sub-modes:
12
12
  * **World-Tracking** (Default): Allows to place objects fixed at a surface, so you can walk around and see them from different perspectives. Internally uses WebXR device API if the device is compatible (Android with ARCore support for now), and fallbacks to a custom implementation if not, or when using the config option `disableWebXR = true`.
13
13
  * **Rotation-Tracking**: Uses device gyroscope sensor to provide an accurate 360º rotation-only tracking. Useful for scenes where users are not supposed to move and rather look around. Can be enabled using the config option `disableWorldTracking = true`.
14
+ * **Spatial**: Will recognize a previously scanned environment (space), positioning you within it and initiating World-Tracking from that location.
14
15
 
15
16
  Onirix AR Engine SDK is agnostic (not tied) to any rendering engine, so you can combine it with any 3D engine library like:
16
17
 
@@ -51,7 +52,7 @@ Add a custom script (app.js) to your page html head tag and load it as an async
51
52
  Inside your custom script (app.js), import Onirix SDK:
52
53
 
53
54
  ```
54
- import OnirixSDK from "https://unpkg.com/@onirix/ar-engine-sdk@latest/dist/ox-sdk.esm.js";
55
+ import OnirixSDK from "https://unpkg.com/@onirix/ar-engine-sdk@1.6.0/dist/ox-sdk.esm.js";
55
56
  ```
56
57
 
57
58
  > If you're using a JavaScript framework or a bundler like Webpack, it is recommended to use the [NPM package](https://www.npmjs.com/package/@onirix/ar-engine-sdk) instead.
@@ -74,6 +75,7 @@ The **mode** can be one of following depending on the tracking type you want to
74
75
  * OnirixSDK.TrackingMode.Image
75
76
  * OnirixSDK.TrackingMode.QRCode
76
77
  * OnirixSDK.TrackingMode.Surface
78
+ * OnirixSDK.TrackingMode.Spatial
77
79
 
78
80
  This is the complete list of config parameters:
79
81
 
@@ -81,8 +83,9 @@ This is the complete list of config parameters:
81
83
  | ------ | ----------- | ---------- |
82
84
  | **mode** | **OnirixSDK.TrackingType** (required) | The AR mode you want your experience to run with. |
83
85
  | **disableWorldTracking** | **boolean** (optional, default: false) | You can use this option to enable Rotation-Tracking. (Surface tracking only) |
84
- | **disableWebXR** | **boolean** (optional, default: false) | You can use this option to force using Onirix custom World Tracking implementation for more homogeneous experiences between devices and OS. (Surface tracking only) |
86
+ | **disableWebXR** | **boolean** (optional, default: false) | You can use this option to force using Onirix custom World Tracking implementation for more homogeneous experiences between devices and OS. (Surface and Spatial tracking only) |
85
87
  | **useVocabulary** | **boolean** (optional, default: false) | Enabling this setting will speed up image detection in exchange of downloading an additional file (25MB) when the experience loads. It is recommended when number of marker images per project is bigger than 10. (Image tracking only) |
88
+ | **sceneOid** | **string** (required for Spatial mode) | OID of the scene in which you want to relocate |
86
89
 
87
90
  ---
88
91
 
@@ -136,7 +139,7 @@ There are 4 events you may want to subscribe depending on the tracking mode:
136
139
 
137
140
  | Event | Description |
138
141
  | ------ | ----------- |
139
- | **OnirixSDK.Events.OnDetected** | This event will be called when an Image or QR code is detected, returning an identifier. The identifier corresponds to the Image scene OID in Onirix Studio or the QR Code decoded content in case of a QR code. This event won't never be called in Surface mode. |
142
+ | **OnirixSDK.Events.OnDetected** | This event will be called when an Image, QR code or Space is detected, returning an identifier. The identifier corresponds to the Image or Space scene OID in Onirix Studio or the QR Code decoded content in case of a QR code. This event won't never be called in Surface mode. |
140
143
  | **OnirixSDK.Events.OnLost** | This event will be called when an already detected Image or QR code is lost, returning an identifier. The identifier corresponds to the Image scene OID in Onirix Studio or the QR Code decoded content in case of a QR code. This event won't never be called in Surface mode. |
141
144
  | **OnirixSDK.Events.OnPose** | This event will be called every time a new object pose is computed. Returned pose is a column major view-model matrix in OpenGL coordinates that you must forward to your 3D renderer. |
142
145
  | **OnirixSDK.Events.OnResize** | This event will be called every time your device switches between landscape and portrait orientation. When that happens, you must obtain new camera parameters through **getCameraParameters** function of the SDK and update your renderer with them. |
@@ -145,7 +148,7 @@ There are 4 events you may want to subscribe depending on the tracking mode:
145
148
  | **OnirixSDK.Events.OnTouchEnd** | Similar to OnTouch, but called when the touch ends. |
146
149
  | **OnirixSDK.Events.OnHitTestResult** | This event will be called every time a surface is detected throwing a **ray forward from camera origin** (screen center). It is useful to display a placeholder of a surface before placing the 3D scene. It only works with surface tracking mode. |
147
150
  | **OnirixSDK.Events.OnFrame** | This event will be called every frame. Useful for synchronizing tracking and 3D rendering. |
148
- | **OnirixSDK.Events.SessionEnd** | Called when user exits the AR experience (only Surface mode when using WebXR). |
151
+ | **OnirixSDK.Events.SessionEnd** | Called when user exits the AR experience (only Surface and Spatial modes when using WebXR). |
149
152
 
150
153
  This is how you should subscribe to events:
151
154
 
@@ -195,7 +198,7 @@ Onirix uses a **right handed** coordinate system with X running horizontally lef
195
198
 
196
199
  ![](https://docs.onirix.com/user/pages/05.onirix-sdk/08.web-ar/axes.jpg)
197
200
 
198
- This coordinate system was chosen to match WebGL convention that is also used by many 3D librarires like [Three.js](https://threejs.org/?target=_blank). However, there are others like [Babylon.js](https://www.babylonjs.com/?target=_blank) may need some conversions to get the same results. We encourage you to visit our [samples](/onirix-sdk/web-ar#sample-projects) to see how we deal with these coordinate transforms for each 3D engine.
201
+ This coordinate system was chosen to match WebGL convention that is also used by many 3D libraries like [Three.js](https://threejs.org/?target=_blank). However, there are others like [Babylon.js](https://www.babylonjs.com/?target=_blank) may need some conversions to get the same results. We encourage you to visit our [samples](/onirix-sdk/web-ar#sample-projects) to see how we deal with these coordinate transforms for each 3D engine.
199
202
 
200
203
  #### Surface mode
201
204
 
@@ -209,6 +212,10 @@ While in image mode, positive Y is orthogonal coming out from marker image, X go
209
212
 
210
213
  ![](https://docs.onirix.com/user/pages/05.onirix-sdk/08.web-ar/image-axes.jpg)
211
214
 
215
+ #### Spatial mode
216
+
217
+ While in Spatial mode, the coordinate system aligns with the scanned environment. This means that, similar to Surface mode, the -Z axis points towards the horizon, the Y axis points upward, aligned with gravity, and the X axis is perpendicular to both, forming the cross vector. However, in Spatial mode, these axes are rotated in such a way that they match the orientation and position of the previously scanned space, ensuring that virtual objects are accurately placed within the real-world context.
218
+
212
219
  ## Sample projects
213
220
 
214
221
  You can visit our GitHub account for samples using different tracking modes and 3D rendering libraries:
@@ -246,7 +253,7 @@ Onirix AR Engine SDK is compatible with the following browsers:
246
253
  Devices must also conform to the following **hardware requirements**:
247
254
 
248
255
  * **Rear camera** with at least VGA resolution (640x480px)
249
- * **Gyroscope sensor** (only required for surface-tracking mode).
256
+ * **Gyroscope sensor** (only required for Surface and Spatial modes).
250
257
  * **2 GB of RAM**
251
258
 
252
259
  ## Licensing