1.0.4 • Published 12 months ago

cesium-role-controller v1.0.4

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
12 months ago

演示地址

http://devmodels.oss-cn-shenzhen.aliyuncs.com/devtest/liubofang/CesiumRoleController/index.html

快速上手

import CesiumRoleController from 'cesium-role-controller'

/*
import * as Cesium from 'cesium'
let viewer = Cesium.viewer({...})
*/

let controller = new CesiumRoleController(Cesium, viewer)
controller.init({
  position: [106.306177, 36.030691],
  url: 'http://devmodels.oss-cn-shenzhen.aliyuncs.com/devtest/liubofang/glb/foreigner_cesium.glb',
  animation: 'run',
})

API 文档

options

名称说明类型可选值默认值是否必选
url模型地址string--
position初始经纬度坐标array--
animation模型动画名称string--
speed运动速度number-1
pitch相机看向模型的俯仰角度number0~-90-25
lockViewLevel相机看向模型的限制级别,等级由低到高,1 为自由视角,3 为全限制number1~33
range相机看向模型的视角范围number0~999994

method

名称说明参数参数类型返回值使用方法
init初始化optionsobjectvoidcontroller.init({...})
destroy销毁--voidcontroller.destory()

注意事项

  1. 本插件基于 Cesium 104+以上版本进行开发,如需兼容早期版本,可自行修改源码
  2. 通过键盘 W/S/A/D 控制人物移动和鼠标控制相机视角
  3. 当在启用地形的地图下时 可以把 speed 和 range 设置大一些 如 speed:10 range:1000

版权说明

  1. cesium-role-controller 插件由liubf自主研发,拥有所有权利。
  2. 任何个人或组织可以在遵守相关要求下可以免费无限制使用。

版本日志

1.0.0 2023/06/07

  1. 添加初始化配置参数
  2. 添加初始化方法

1.0.1 2023/06/08

  1. 修复配置文件参数拼写错误 参数 lookViewLevel 修改为 lockViewLevel

1.0.2 2023/06/08

  1. 修复自由视角下相机飘的问题

1.0.3 2023/06/08

  1. 修复自由视角下多个按键按下相机飘的问题

1.0.4 2023/06/09

  1. 优化一些局部问题

示例视频

贴合地形视频

贴合 3dtiles 视频

1.0.4

12 months ago

1.0.3

12 months ago

1.0.2

12 months ago

1.0.1

12 months ago

1.0.0

12 months ago