anov-3d-controller
TypeScript icon, indicating that this package has built-in type declarations

0.0.1 • Public • Published

THREE 第三人称角色控制器模块说明

功能概述

该模块实现了一个基于Three.js的三维角色控制系统,主要包含以下核心功能:

  • 角色控制:WASD键控制前后左右移动,Shift加速跑动
  • 视角控制:鼠标拖拽/触摸滑动控制摄像机环绕观察
  • 动画系统:支持多种动作状态的切换与过渡(站立、行走、奔跑)

典型调用示例

基本初始化

const controller = new CharacterController({
  scene: scene,
  camera: camera,
  modelUrl: "assets/man.glb"  // 角色模型地址
});

动画更新

function animate() {
  requestAnimationFrame(animate);
  controller.update();
}
animate();

注意事项

  1. 需要预加载角色GLTF模型资源
  2. 模型需要具备基本的动画功能,动画名称必须为:
    'idle',    // 空闲
    'walking', // 行走
    'running',  // 跑步

Readme

Keywords

none

Package Sidebar

Install

npm i anov-3d-controller

Weekly Downloads

2

Version

0.0.1

License

none

Unpacked Size

10.1 kB

Total Files

4

Last publish

Collaborators

  • zhu18