# @8thwall/engine 中文文档

规范地址：https://npmcn.com/package/%408thwall/engine/

版本：0\.1\.0
npm 元数据更新时间：2026-09-17T03:17:49.900Z
中文译文更新时间：2026-11-06T16:52:01.281Z
软件包许可：MIT

本文由上游 README 翻译，可能存在偏差，请结合原文核对 API、命令与配置。版权与许可归原作者所有。

原始 npm 页面：https://www.npmjs.com/package/%408thwall/engine
原文对照：https://npmcn.com/package/%408thwall/engine/?lang=original
项目主页：https://8thwall.org/
源码仓库：https://github.com/8thwall/8thwall

## 关键信息（来自 npm 元数据）

- 包体积（解压后）：29.3 MB，16 个文件
- 模块格式：CommonJS
- TypeScript 类型：未声明
- 运行依赖：0 个
- 首次发布：2026-09-17T03:17:49.145Z
- 最新版本发布：2026-09-17T03:17:49.591Z
- 近 30 天下载量：2691（2026-10-05 至 2026-11-03，npm 官方下载统计）
- 已发布版本数：1（近 12 个月 1 个）

## 中文简介

交叉平台的开源框架, 基于浏览器的 AR

## 安装

```sh
npm install @8thwall/engine
```

也可以使用：`pnpm add @8thwall/engine`、`yarn add @8thwall/engine`、`bun add @8thwall/engine`

## README

# 8号墙引擎

> \[尖叫声\] 这款引擎作为出厂前的架构发布. API可能在官方1.0发布前更改.

## 使用量

见 [https://8thwall.org/docs/engine/overview (中文(简体) )](https://8thwall.org/docs/engine/overview) 更详尽的指南.

### 备选案文1:脚本标签

```html
<script src="https://cdn.jsdelivr.net/npm/@8thwall/engine@0.1.0/dist/xr.js" async crossorigin="anonymous" data-preload-chunks="slam"></script>
```

> \[注\] 这个 `XrController` 此软件包中的模块不包含 SLAM(世界跟踪),只包含图像目标。 然而,对于后向兼容性,块名仍然 `slam`,详见下文"SLAM集成".

### 备选案文2:npm

```
npm install @8thwall/engine
```

您需要将包含的文物复制到您的 dist 文件夹中, 例如在 Webpack 中 :

```js
new CopyWebpackPlugin({
  patterns: [
    {
      from: 'node_modules/@8thwall/engine/dist',
      to: 'external/xr',
    }
  ]
})
```

然后可以通过在index.html中添加以下内容来加载 SDK :

```html
<script src="./external/xr/xr.js" data-preload-chunks="slam" async></script>
```

导入软件包时, 一旦装入, 您将获得访问 XR8 的简单帮助 。 此承诺只有在脚本标记包含在 HTML 中时才会解决.

```js
import {XR8Promise} from '@8thwall/engine'

XR8Promise.then((XR8) => XR8.XrController.configure({}))
```

## 概览

八一墙开源引擎包括:

-   核心引擎结构
-   图像目标
-   面部效果
-   天空效应

它不包括:

-   VPS, Lightship Maps等长相空间产品或地理空间浏览器
-   手迹追踪

### SLAM 一体化

开源引擎不包含SLAM模块. 然而,可以选择将分布式引擎二进制提供的SLAM模块装入开源引擎.

> \[注\] 分配引擎二进制通过有限使用许可证提供,该许可证对如何使用加以限制。 许可证全文是: [这里](https://github.com/8thwall/engine/blob/main/LICENSE)请参看 [允许使用 FAQ](https://8thwall.org/docs/migration/faq#distributed-engine-binary-license-and-permitted-use) 财务报告和审定财务报表 [分配准则](https://8thwall.org/docs/open-source) 更多信息.

在以下代码中 `data-preload-chunks="slam: <url>"` 指示开源引擎获取 `slam` 从给定的 URL 从块。 同样的Xr Captain API将可供使用. `XR8.loadChunks({name: 'slam', url: '<url>'})` 也得到支持.

```html
<script async crossorigin="anonymous"
  src="https://cdn.jsdelivr.net/npm/@8thwall/engine@0.1.0/dist/xr.js"
  data-preload-chunks="slam: https://cdn.jsdelivr.net/npm/@8thwall/engine-binary@1/dist/xr-slam.js"
></script>
```

如果使用 npm, 请运行 :

```bash
npm install @8thwall/engine-binary
```

添加以下内容,或相当于您的构建配置 :

```js
new CopyWebpackPlugin({
  patterns: [
    {
      from: 'node_modules/@8thwall/engine-binary/dist',
      to: 'external/xr-binary', // NOTE: Copied to a different path than @8thwall/engine
    }
  ]
})
```

然后指定相对 URL :

```html
<script async
  src="./external/xr/xr.js"
  data-preload-chunks="slam: ./external/xr-binary/xr-slam.js"
></script>
```

## 常见问题

### @8thwall/engine 是什么？

交叉平台的开源框架, 基于浏览器的 AR

### 如何安装 @8thwall/engine？

在项目目录运行 npm install @8thwall/engine，或使用 pnpm add / yarn add / bun add。

### @8thwall/engine 支持 TypeScript 吗？

该包的 package\.json 没有声明类型入口。需要类型提示时，可以在 npm 上查找社区维护的 @types/8thwall\_\_engine 是否存在。

### @8thwall/engine 支持 ESM 还是 CommonJS？

以 CommonJS 形式发布，可以直接 require\(\)；在 ES Module 项目中也可以用 import 引入（Node\.js 会把 module\.exports 作为默认导出）。

### @8thwall/engine 可以商用吗？

@8thwall/engine 使用 MIT 许可。宽松许可：允许商业使用、修改和再分发，通常只需在分发时保留原版权与许可声明。以上为概括，不构成法律意见，请以许可原文为准。

### @8thwall/engine 的下载量有多少？

根据 npm 官方下载统计，@8thwall/engine 在 2026/10/05 – 2026/11/03 这 30 天内被下载 2,691 次，日均约 90 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入，适合横向比较热度，不能直接等同于使用人数。

### @8thwall/engine 还在维护吗？

最新版本 0\.1\.0 发布于 2026/09/17（1 个月前）；至今共发布 1 个版本，其中过去 12 个月发布了 1 个；首次发布于 2026/09/17。发布频率只是参考信号：功能稳定的工具可能很少需要更新，建议结合源码仓库的 issue 和提交记录判断。

