0.1.3 • Published 2 months ago

@ylbupt/three-game-engine v0.1.3

Weekly downloads
-
License
ISC
Repository
github
Last release
2 months ago

介绍

这是一个模块化开发 3D 应用的库,基于 threejs 的高级封装,以面向对象的方式,快速高效地编写你的应用。同时开发流程和 Unity 等引擎十分吻合,使得这部分开发者可以非常方便地构建自己的 3D 网页应用

安装

npm i @ylbupt/three-game-engine

文档快速开始

主要特性

  • 支持较为完善的生命周期

life-cycle

  • 支持导入外部 3D 对象,并支持挂载自定义脚本Script来控制 3D 对象
import { ObjectScript } from '@ylbupt/three-game-engine'

/* options 类型 */
export interface RotateScriptOptions {
  speed: number
}

export class RotateScript extends ObjectScript<RotateScriptOptions> {
  render(time: number, dt: number) {
    this.object.rotateY(dt * this.options.speed)  /* 通过 this.options 访问传入的参数 */
  }
}
  • 统一的管理器,包括音频SoundManager、场景SceneManager、加载LoaderBar、事件监听Input
0.1.3

2 months ago

0.1.2

2 months ago

0.1.1

2 months ago

0.1.0

2 months ago

0.0.4

2 months ago

0.0.3

12 months ago

0.0.2

12 months ago

0.0.1

12 months ago