@8thwall/engine 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +7 -0
- package/README.md +109 -0
- package/dist/resources/dom-tablet-button.glb +0 -0
- package/dist/resources/dom-tablet-frame.glb +0 -0
- package/dist/resources/face-ear-model.tflite +0 -0
- package/dist/resources/face-mesh-model.tflite +0 -0
- package/dist/resources/face-model.tflite +0 -0
- package/dist/resources/media-worker.js +1 -0
- package/dist/resources/powered-by.svg +1 -0
- package/dist/resources/semantics-model.tflite +0 -0
- package/dist/resources/semantics-worker.js +1 -0
- package/dist/xr-face.js +1 -0
- package/dist/xr-tracking.js +18 -0
- package/dist/xr.js +18 -0
- package/index.js +11 -0
- package/package.json +37 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
Copyright 2026 Niantic Spatial, Inc.
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
4
|
+
|
|
5
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
6
|
+
|
|
7
|
+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
# 8th Wall Engine
|
|
2
|
+
|
|
3
|
+
> [!WARNING]
|
|
4
|
+
> This engine is released as a pre-release build. The API may change before the official 1.0.0 release.
|
|
5
|
+
|
|
6
|
+
## Usage
|
|
7
|
+
|
|
8
|
+
See https://8thwall.org/docs/engine/overview for a more detailed guide.
|
|
9
|
+
|
|
10
|
+
### Option 1: Script tag
|
|
11
|
+
|
|
12
|
+
```html
|
|
13
|
+
<script src="https://cdn.jsdelivr.net/npm/@8thwall/engine@0.1.0/dist/xr.js" async crossorigin="anonymous" data-preload-chunks="slam"></script>
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
> [!NOTE]
|
|
17
|
+
> The `XrController` module in this package does not contain SLAM (World Tracking), only Image Targets. However, for backwards compatibility, the chunk name is still `slam`. See "SLAM Integration" below for more details.
|
|
18
|
+
|
|
19
|
+
### Option 2: npm
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
npm install @8thwall/engine
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
You will need to copy the included artifacts into your dist folder, for example in webpack:
|
|
26
|
+
|
|
27
|
+
```js
|
|
28
|
+
new CopyWebpackPlugin({
|
|
29
|
+
patterns: [
|
|
30
|
+
{
|
|
31
|
+
from: 'node_modules/@8thwall/engine/dist',
|
|
32
|
+
to: 'external/xr',
|
|
33
|
+
}
|
|
34
|
+
]
|
|
35
|
+
})
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
You can then load the SDK by adding the following to index.html:
|
|
39
|
+
|
|
40
|
+
```html
|
|
41
|
+
<script src="./external/xr/xr.js" data-preload-chunks="slam" async></script>
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
When importing the package, you will get a simple helper for accessing XR8 once it is loaded. This promise will only resolve if the script tag is included in the HTML.
|
|
45
|
+
|
|
46
|
+
```js
|
|
47
|
+
import {XR8Promise} from '@8thwall/engine'
|
|
48
|
+
|
|
49
|
+
XR8Promise.then((XR8) => XR8.XrController.configure({}))
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Overview
|
|
53
|
+
|
|
54
|
+
The 8th Wall open-source engine includes:
|
|
55
|
+
|
|
56
|
+
- Core engine architecture
|
|
57
|
+
- Image Targets
|
|
58
|
+
- Face Effects
|
|
59
|
+
- Sky Effects
|
|
60
|
+
|
|
61
|
+
It does not include:
|
|
62
|
+
|
|
63
|
+
- Niantic Spatial products such as VPS, Lightship Maps, or the Geospatial Browser
|
|
64
|
+
- Hand Tracking
|
|
65
|
+
|
|
66
|
+
### SLAM Integration
|
|
67
|
+
|
|
68
|
+
The open-source engine does not contain a SLAM module. However, there is an option to load the SLAM module provided by the Distributed Engine Binary into the open-source engine.
|
|
69
|
+
|
|
70
|
+
> [!NOTE]
|
|
71
|
+
> The Distributed Engine Binary is available through a limited-use license which places restrictions on how it can be used. The full license text is [here](https://github.com/8thwall/engine/blob/main/LICENSE). Please see the [Permitted Use FAQ](https://8thwall.org/docs/migration/faq#distributed-engine-binary-license-and-permitted-use) and [Attribution Guidelines](https://8thwall.org/docs/open-source) for more information.
|
|
72
|
+
|
|
73
|
+
In the below code, the `data-preload-chunks="slam: <url>"` instructs the open-source engine to fetch the `slam` chunk from that given URL. The same XrController API will be available. `XR8.loadChunks({name: 'slam', url: '<url>'})` is also supported.
|
|
74
|
+
|
|
75
|
+
```html
|
|
76
|
+
<script async crossorigin="anonymous"
|
|
77
|
+
src="https://cdn.jsdelivr.net/npm/@8thwall/engine@0.1.0/dist/xr.js"
|
|
78
|
+
data-preload-chunks="slam: https://cdn.jsdelivr.net/npm/@8thwall/engine-binary@1/dist/xr-slam.js"
|
|
79
|
+
></script>
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
If using npm, run:
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
npm install @8thwall/engine-binary
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Add the following, or equivalent to your build configuration:
|
|
89
|
+
|
|
90
|
+
```js
|
|
91
|
+
new CopyWebpackPlugin({
|
|
92
|
+
patterns: [
|
|
93
|
+
{
|
|
94
|
+
from: 'node_modules/@8thwall/engine-binary/dist',
|
|
95
|
+
to: 'external/xr-binary', // NOTE: Copied to a different path than @8thwall/engine
|
|
96
|
+
}
|
|
97
|
+
]
|
|
98
|
+
})
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
Then specify the relative URL:
|
|
102
|
+
|
|
103
|
+
```html
|
|
104
|
+
<script async
|
|
105
|
+
src="./external/xr/xr.js"
|
|
106
|
+
data-preload-chunks="slam: ./external/xr-binary/xr-slam.js"
|
|
107
|
+
></script>
|
|
108
|
+
```
|
|
109
|
+
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|