npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

cesium-role-controller

v1.0.4

Published

基于Cesium的三维角色控制器插件

Downloads

13

Readme

演示地址

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 | 相机看向模型的俯仰角度 | number | 0~-90 | -25 | 否 | | lockViewLevel | 相机看向模型的限制级别,等级由低到高,1 为自由视角,3 为全限制 | number | 1~3 | 3 | 否 | | range | 相机看向模型的视角范围 | number | 0~99999 | 4 | 否 |

method

| 名称 | 说明 | 参数 | 参数类型 | 返回值 | 使用方法 | | ------- | ------ | ------- | -------- | ------ | ---------------------- | | init | 初始化 | options | object | void | controller.init({...}) | | destroy | 销毁 | - | - | void | controller.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 视频