8号墙引擎
[尖叫声] 这款引擎作为出厂前的架构发布. API可能在官方1.0发布前更改.
使用量
见 https://8thwall.org/docs/engine/overview (中文(简体) ) 更详尽的指南.
备选案文1:脚本标签
<script src="https://cdn.jsdelivr.net/npm/@8thwall/[email protected]/dist/xr.js" async crossorigin="anonymous" data-preload-chunks="slam"></script>
[注] 这个
XrController此软件包中的模块不包含 SLAM(世界跟踪),只包含图像目标。 然而,对于后向兼容性,块名仍然slam,详见下文"SLAM集成".
备选案文2:npm
npm install @8thwall/engine
您需要将包含的文物复制到您的 dist 文件夹中, 例如在 Webpack 中 :
new CopyWebpackPlugin({
patterns: [
{
from: 'node_modules/@8thwall/engine/dist',
to: 'external/xr',
}
]
})
然后可以通过在index.html中添加以下内容来加载 SDK :
<script src="./external/xr/xr.js" data-preload-chunks="slam" async></script>
导入软件包时, 一旦装入, 您将获得访问 XR8 的简单帮助 。 此承诺只有在脚本标记包含在 HTML 中时才会解决.
import {XR8Promise} from '@8thwall/engine'
XR8Promise.then((XR8) => XR8.XrController.configure({}))
概览
八一墙开源引擎包括:
- 核心引擎结构
- 图像目标
- 面部效果
- 天空效应
它不包括:
- VPS, Lightship Maps等长相空间产品或地理空间浏览器
- 手迹追踪
SLAM 一体化
开源引擎不包含SLAM模块. 然而,可以选择将分布式引擎二进制提供的SLAM模块装入开源引擎.
[注] 分配引擎二进制通过有限使用许可证提供,该许可证对如何使用加以限制。 许可证全文是: 这里请参看 允许使用 FAQ 财务报告和审定财务报表 分配准则 更多信息.
在以下代码中 data-preload-chunks="slam: <url>" 指示开源引擎获取 slam 从给定的 URL 从块。 同样的Xr Captain API将可供使用. XR8.loadChunks({name: 'slam', url: '<url>'}) 也得到支持.
<script async crossorigin="anonymous"
src="https://cdn.jsdelivr.net/npm/@8thwall/[email protected]/dist/xr.js"
data-preload-chunks="slam: https://cdn.jsdelivr.net/npm/@8thwall/engine-binary@1/dist/xr-slam.js"
></script>
如果使用 npm, 请运行 :
npm install @8thwall/engine-binary
添加以下内容,或相当于您的构建配置 :
new CopyWebpackPlugin({
patterns: [
{
from: 'node_modules/@8thwall/engine-binary/dist',
to: 'external/xr-binary', // NOTE: Copied to a different path than @8thwall/engine
}
]
})
然后指定相对 URL :
<script async
src="./external/xr/xr.js"
data-preload-chunks="slam: ./external/xr-binary/xr-slam.js"
></script>