three-player-controller 0.3.5 → 0.3.6
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/README.md +34 -26
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -270,32 +270,40 @@ type PlayerControllerOptions = {
|
|
|
270
270
|
|
|
271
271
|
### 关键字段说明
|
|
272
272
|
|
|
273
|
-
| 字段 | 类型 | 默认
|
|
274
|
-
|
|
275
|
-
| `scene` | `THREE.Scene` | three.js
|
|
276
|
-
| `camera` | `THREE.PerspectiveCamera` | three.js
|
|
277
|
-
| `controls` | `OrbitControls` |
|
|
278
|
-
| `playerModel.url` | `string` |
|
|
279
|
-
| `playerModel.scale` | `number` |
|
|
280
|
-
| `playerModel.idleAnim`
|
|
281
|
-
| `playerModel.
|
|
282
|
-
| `playerModel.
|
|
283
|
-
| `playerModel.
|
|
284
|
-
| `playerModel.
|
|
285
|
-
| `playerModel.
|
|
286
|
-
| `playerModel.
|
|
287
|
-
| `playerModel.
|
|
288
|
-
| `playerModel.
|
|
289
|
-
| `playerModel.
|
|
290
|
-
| `playerModel.
|
|
291
|
-
| `
|
|
292
|
-
| `
|
|
293
|
-
| `
|
|
294
|
-
| `
|
|
295
|
-
| `
|
|
296
|
-
| `
|
|
297
|
-
| `
|
|
298
|
-
| `
|
|
273
|
+
| 字段 | 类型 | 必填 | 默认 | 说明 |
|
|
274
|
+
|------|-----:|:----:|:----:|------|
|
|
275
|
+
| `scene` | `THREE.Scene` | 是 | — | three.js 场景 |
|
|
276
|
+
| `camera` | `THREE.PerspectiveCamera` | 是 | — | three.js 相机 |
|
|
277
|
+
| `controls` | `OrbitControls` | 是 | — | 外部相机控制器 |
|
|
278
|
+
| `playerModel.url` | `string` | 是 | — | 人物模型路径(GLB/GLTF) |
|
|
279
|
+
| `playerModel.scale` | `number` | 是 | — | 人物模型缩放 |
|
|
280
|
+
| `playerModel.idleAnim` | `string` | 是 | — | Idle 动画名,需与模型内动画名一致 |
|
|
281
|
+
| `playerModel.walkAnim` | `string` | 是 | — | Walk 动画名,需与模型内动画名一致 |
|
|
282
|
+
| `playerModel.runAnim` | `string` | 是 | — | Run 动画名,需与模型内动画名一致 |
|
|
283
|
+
| `playerModel.jumpAnim` | `string` | 是 | — | Jump 动画名,需与模型内动画名一致 |
|
|
284
|
+
| `playerModel.leftWalkAnim` | `string` | 否 | `walkAnim` | 左走动画名,不填则复用 `walkAnim` |
|
|
285
|
+
| `playerModel.rightWalkAnim` | `string` | 否 | `walkAnim` | 右走动画名,不填则复用 `walkAnim` |
|
|
286
|
+
| `playerModel.backwardAnim` | `string` | 否 | `walkAnim` | 后退动画名,不填则复用 `walkAnim` |
|
|
287
|
+
| `playerModel.flyAnim` | `string` | 否 | `idleAnim` | 飞行动画名,不填则复用 `idleAnim` |
|
|
288
|
+
| `playerModel.flyIdleAnim` | `string` | 否 | `idleAnim` | 飞行待机动画名,不填则复用 `idleAnim` |
|
|
289
|
+
| `playerModel.enterCarAnim` | `string` | 否 | — | 上车动画名(使用车辆功能时必填) |
|
|
290
|
+
| `playerModel.exitCarAnim` | `string` | 否 | — | 下车动画名(使用车辆功能时必填) |
|
|
291
|
+
| `playerModel.rotateY` | `number` | 否 | `0` | 模型绕 Y 轴的额外旋转偏移 |
|
|
292
|
+
| `playerModel.headObjName` | `string` | 否 | — | 头部节点名称,用于第一人称相机绑定 |
|
|
293
|
+
| `playerModel.speed` | `number` | 否 | `300` | 移动速度基准值 |
|
|
294
|
+
| `playerModel.gravity` | `number` | 否 | `-2400` | 重力加速度基准值 |
|
|
295
|
+
| `playerModel.jumpHeight` | `number` | 否 | `600` | 跳跃高度基准值 |
|
|
296
|
+
| `playerModel.playerFlySpeed` | `number` | 否 | `2100` | 飞行速度基准值 |
|
|
297
|
+
| `playerModel.flyEnabled` | `boolean` | 否 | `true` | 是否允许飞行模式 |
|
|
298
|
+
| `initPos` | `THREE.Vector3` | 否 | `(0,0,0)` | 初始位置 |
|
|
299
|
+
| `mouseSensity` | `number` | 否 | `5` | 鼠标灵敏度 |
|
|
300
|
+
| `minCamDistance` | `number` | 否 | `100` | 第三人称最小相机距离 |
|
|
301
|
+
| `maxCamDistance` | `number` | 否 | `440` | 第三人称最大相机距离 |
|
|
302
|
+
| `colliderMeshUrl` | `string` | 否 | — | 自定义碰撞体模型路径,默认使用场景中所有网格 |
|
|
303
|
+
| `isShowMobileControls` | `boolean` | 否 | `true` | 移动端是否自动显示虚拟摇杆 |
|
|
304
|
+
| `thirdMouseMode` | `0\|1\|2\|3` | 否 | `1` | 第三人称鼠标模式(见下表) |
|
|
305
|
+
| `enableZoom` | `boolean` | 否 | `false` | 第三人称是否允许滚轮缩放 |
|
|
306
|
+
| `enableOverShoulderView` | `boolean` | 否 | `false` | 是否开启过肩视角偏移 |
|
|
299
307
|
|
|
300
308
|
**thirdMouseMode 说明:**
|
|
301
309
|
|