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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@dao3fun/high-bessel

v2.1.2

Published

负责管理游戏中的模型高贝塞尔曲线动画,它使用贝塞尔曲线来平滑地移动相机实体,并支持不同的缓动函数来控制动画速度,同时也支持生成曲面

Readme

神岛模型高阶贝塞尔曲线动画 2.0

来自 box3 游戏《新春·欢乐游乐园》中的火车运行路径,运用了贝塞尔 3 阶内连续移动。https://dao3.fun/exp/experience/detail/100012435

来自 box3 游戏《瓶盖人大乱斗》中的胜利场面,运用了贝塞尔 3 阶内连续移动。锁定视角。https://dao3.fun/exp/experience/detail/100108748

详细文档

https://docs.pgaot.com/npm/high-bessel/

示例

  • 生成模型 效果: 根据刷新频率,在贝塞尔曲线上动态生成一系列模型。
import GameHighBessel, { GameHighBesselEases } from "@dao3fun/high-bessel";

// 初始化贝塞尔曲线动画对象,设置固定点模型名称为 "pos"
const bessel = new GameHighBessel({
  fixedPointNameOrPosList: "pos",
});

// 当动画进度更新时,创建一个新实体表示贝塞尔曲线上的一个点
bessel.onUpdate((point) => {
  world.createEntity({
    mesh: "mesh/点.vb",
    collides: false,
    gravity: false,
    position: point,
  });
});

// 播放贝塞尔曲线动画,设置播放速度为 0.01
bessel.play({
  speed: 0.01,
});
  • 场景展示动画 效果: 使用贝塞尔曲线缓动,从 pos-1 位置移动到 pos-2 位置等,实现平滑的场景切换。
import GameHighBessel, { GameHighBesselEases } from "@dao3fun/high-bessel";

// 创建一个模型实体,设置其属性
const model = world.createEntity({
  mesh: "mesh/摄像头.vb",
  collides: false,
  gravity: false,
});

// 初始化贝塞尔曲线动画对象,设置固定点模型名称为 "pos"
const bessel = new GameHighBessel({
  fixedPointNameOrPosList: "pos",
});

// 如果模型存在,则在玩家加入世界时播放动画,并将摄像机绑定到玩家
if (model) {
  model.meshInvisible = true;
  world.onPlayerJoin(({ entity, tick }) => {
    // 播放贝塞尔曲线动画,设置播放速度和缓动函数
    bessel.play({
      cameraEntity: model,
      speed: 0.00002,
      ease: "easeInOutCubic",
    });

    // 将贝塞尔曲线动画的摄像机实体设置为当前玩家的摄像机实体
    if (bessel.cameraEntity) entity.player.cameraEntity = bessel.cameraEntity;
  });
}
  • 拖放进度 效果: 在贝塞尔曲线上拖拽进度条,从任意位置开始播放动画。
import GameHighBessel, { GameHighBesselEases } from "@dao3fun/high-bessel";

// 创建一个模型实体,设置其属性
const model = world.createEntity({
  mesh: "mesh/AI自动生成-橘子.vb",
  collides: false,
  gravity: false,
});

if (model) {
  // 初始化贝塞尔曲线动画对象,设置固定点模型名称为 "pos" 并绑定摄像机实体
  const bessel = new GameHighBessel({
    fixedPointNameOrPosList: "pos",
    cameraEntity: model,
  });

  // 设置贝塞尔曲线动画的进度为 60%,并开始播放
  bessel.progress = 0.6;
  bessel.play();

  // 当贝塞尔曲线动画完成时,重新从头开始播放
  bessel.onFinish(() => {
    bessel.play({ progress: 0 });
  });
}
  • 曲线转曲面 效果:将多条贝塞尔曲线转化为曲面
import GameHighBessel, { GameHighBesselEases } from "@dao3fun/high-bessel";

// 定义一个包含贝塞尔曲线配置的数组
const besselConfigs = [
  { fixedPointNameOrPosList: "pos", fixedPointMeshInvisible: false },
  { fixedPointNameOrPosList: "pos2", fixedPointMeshInvisible: false },
  { fixedPointNameOrPosList: "pos3", fixedPointMeshInvisible: false },
];

// 根据配置数组创建贝塞尔曲线对象数组
const bessels = besselConfigs.map((config) => new GameHighBessel(config));

// 获取所有贝塞尔曲线对象的固定点列表
const fixedPointLists = bessels.map((bessel) => bessel.fixedPointList());

// 从固定点列表中创建一个贝塞尔曲面
const vectorSurface = GameHighBessel.createBezierSurfaceFromPoints({
  controlPoints: fixedPointLists,
});

// 遍历贝塞尔曲面上的每个位置,创建实体
vectorSurface.forEach((position) => {
  world.createEntity({
    mesh: "mesh/方块.vb",
    position,
    fixed: true,
  });
});