{"_id":"@dao3fun/high-bessel","_rev":"12-10d4f553646bb5e56fd0471d8d3e3dc6","name":"@dao3fun/high-bessel","dist-tags":{"latest":"2.1.2"},"versions":{"1.0.0":{"name":"@dao3fun/high-bessel","version":"1.0.0","keywords":["神奇代码岛","贝塞尔"],"author":{"name":"冷鱼闲风"},"license":"ISC","_id":"@dao3fun/high-bessel@1.0.0","maintainers":[{"name":"surfish","email":"surfish.fun@outlook.com"},{"name":"viyrs","email":"2991883280@qq.com"}],"dist":{"shasum":"37b08ecc9b69bd34cb6c5eeec9162389a746d2c2","tarball":"https://registry.npmjs.org/@dao3fun/high-bessel/-/high-bessel-1.0.0.tgz","fileCount":5,"integrity":"sha512-mdZOeqK6kMYZCxhZ3EvSKzMfJJNPYVj0GOGdXbc8mk8fJkXFSY1M1ZSU5OJV1BnOQeAASt+kxwNARini+j+fSw==","signatures":[{"sig":"MEYCIQCB+ISPOFCqqYx+JrtCqcTABt5S/okWureJzakjpY2J8gIhAOSU9yIa0IrBMkm1EvshLm7sR+HIeNdNK8Qkh/05k0sY","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":21985},"main":"index.js","types":"index.d.ts","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"viyrs","email":"2991883280@qq.com"},"_npmVersion":"10.8.2","description":">来自box3游戏《新春·欢乐游乐园》中的火车运行路径，运用了贝塞尔3阶内连续移动。[https://dao3.fun/exp/experience/detail/100012435](https://dao3.fun/exp/experience/detail/100012435)","directories":{},"_nodeVersion":"20.17.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/high-bessel_1.0.0_1731065561761_0.20680217824278246","host":"s3://npm-registry-packages"}},"2.0.0":{"name":"@dao3fun/high-bessel","version":"2.0.0","keywords":[],"author":{"name":"冷鱼闲风"},"license":"ISC","_id":"@dao3fun/high-bessel@2.0.0","maintainers":[{"name":"viyrs","email":"2991883280@qq.com"},{"name":"surfish","email":"surfish.fun@outlook.com"},{"name":"tobylai","email":"toby_lai@126.com"},{"name":"studentnumber2","email":"pzh123gxy2023@163.com"},{"name":"l.w.kevin0wvf","email":"Qck320923@163.com"},{"name":"onloading","email":"605952607@qq.com"},{"name":"whale303","email":"little_whale303@outlook.com"}],"dist":{"shasum":"fb04940f0461a284a3632e8068d5ce9b2d88384b","tarball":"https://registry.npmjs.org/@dao3fun/high-bessel/-/high-bessel-2.0.0.tgz","fileCount":4,"integrity":"sha512-0uc6jKxvchu81TJbFHArPrkYEuiqXO5IfUg7h7PkJJcaDiAP4A5O61xe1bzGGyb3dcxzee5Y8LA1UV/lyZW8pw==","signatures":[{"sig":"MEQCIHQpGvvfBnPA5tKPwjVzY/9RZ+OYgkIsYPNvfI5TnGJ6AiAdj7q4z3TO91NIptnAGVB9AJAffB8dDxImFHBCM2S5nQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":19319},"main":"server/dist/server/src/App.js","types":"server/dist/server/src/App.d.ts","gitHead":"256d0c2642358a96f0d053584982b87c161fe897","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"viyrs","email":"2991883280@qq.com"},"_npmVersion":"10.9.0","description":"负责管理游戏中的模型高贝塞尔曲线动画，它使用贝塞尔曲线来平滑地移动相机实体，并支持不同的缓动函数来控制动画速度","directories":{},"_nodeVersion":"22.12.0","_hasShrinkwrap":false,"devDependencies":{"acorn":"^8.14.0","webpack":"^5.97.1","ts-loader":"^9.5.1","typescript":"^5.7.2","webpack-cli":"^5.1.4","terser-webpack-plugin":"^5.3.11"},"_npmOperationalInternal":{"tmp":"tmp/high-bessel_2.0.0_1738331842111_0.7034137554068152","host":"s3://npm-registry-packages-npm-production"}},"2.0.1":{"name":"@dao3fun/high-bessel","version":"2.0.1","keywords":[],"author":{"name":"冷鱼闲风"},"license":"ISC","_id":"@dao3fun/high-bessel@2.0.1","maintainers":[{"name":"viyrs","email":"2991883280@qq.com"},{"name":"surfish","email":"surfish.fun@outlook.com"},{"name":"tobylai","email":"toby_lai@126.com"},{"name":"studentnumber2","email":"pzh123gxy2023@163.com"},{"name":"l.w.kevin0wvf","email":"Qck320923@163.com"},{"name":"onloading","email":"605952607@qq.com"},{"name":"whale303","email":"little_whale303@outlook.com"}],"dist":{"shasum":"5d85254a158fb162d32ed9ba14b6bf12155e1b85","tarball":"https://registry.npmjs.org/@dao3fun/high-bessel/-/high-bessel-2.0.1.tgz","fileCount":4,"integrity":"sha512-IxtfR9JLhphzPQbXUdGgJ6vI9q8k/VRnTvAZzbLgpITxerwDm2/3jVYGV92N7KrGuhqRNy99HxvScR7ukkllOg==","signatures":[{"sig":"MEUCIQDej0D+dBrIgpFFhUsPnaA98nA4/jto+OFwC95op+4YOQIgT+//7kDkvUeAThfDX16PfEZxFgX2lu5os4Sz4/cvYGE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":19343},"main":"server/dist/server/src/App.js","types":"server/dist/server/src/App.d.ts","gitHead":"256d0c2642358a96f0d053584982b87c161fe897","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"viyrs","email":"2991883280@qq.com"},"_npmVersion":"10.9.0","description":"负责管理游戏中的模型高贝塞尔曲线动画，它使用贝塞尔曲线来平滑地移动相机实体，并支持不同的缓动函数来控制动画速度","directories":{},"_nodeVersion":"22.12.0","_hasShrinkwrap":false,"devDependencies":{"acorn":"^8.14.0","webpack":"^5.97.1","ts-loader":"^9.5.1","typescript":"^5.7.2","webpack-cli":"^5.1.4","terser-webpack-plugin":"^5.3.11"},"_npmOperationalInternal":{"tmp":"tmp/high-bessel_2.0.1_1738376777317_0.4805392825647985","host":"s3://npm-registry-packages-npm-production"}},"2.1.0":{"name":"@dao3fun/high-bessel","version":"2.1.0","keywords":[],"author":{"name":"冷鱼闲风"},"license":"ISC","_id":"@dao3fun/high-bessel@2.1.0","maintainers":[{"name":"viyrs","email":"2991883280@qq.com"},{"name":"surfish","email":"surfish.fun@outlook.com"},{"name":"tobylai","email":"toby_lai@126.com"},{"name":"studentnumber2","email":"pzh123gxy2023@163.com"},{"name":"l.w.kevin0wvf","email":"Qck320923@163.com"},{"name":"onloading","email":"605952607@qq.com"},{"name":"whale303","email":"little_whale303@outlook.com"}],"dist":{"shasum":"c00c132d4f7c3f1739d948a1b0044d021ad052a3","tarball":"https://registry.npmjs.org/@dao3fun/high-bessel/-/high-bessel-2.1.0.tgz","fileCount":5,"integrity":"sha512-8vj/rq5nBZkJvl7RjvNczn5ddOK+xF8U9rMyKJOQrGvXOmJIkzIZ9MSKyO8mWcPowKv0dDsYXZeU1XmJo9EcHQ==","signatures":[{"sig":"MEYCIQC03ZPGpFT00pzlQPI0JXWCurg8j2Kd5+ayAI4m2sZEEwIhAKe65Ik2N82Z4cpyB/3PofOd82tUwb0iFqG8I88D5Ifo","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":34818},"main":"server/dist/server/src/App.js","types":"server/dist/server/src/App.d.ts","gitHead":"a1f9b16200816be3182b74d73746589949bf9245","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"viyrs","email":"2991883280@qq.com"},"_npmVersion":"10.9.0","description":"负责管理游戏中的模型高贝塞尔曲线动画，它使用贝塞尔曲线来平滑地移动相机实体，并支持不同的缓动函数来控制动画速度，同时也支持生成曲面","directories":{},"_nodeVersion":"22.12.0","_hasShrinkwrap":false,"devDependencies":{"acorn":"^8.14.0","webpack":"^5.97.1","ts-loader":"^9.5.1","typescript":"^5.7.2","webpack-cli":"^5.1.4","terser-webpack-plugin":"^5.3.11"},"_npmOperationalInternal":{"tmp":"tmp/high-bessel_2.1.0_1738399067635_0.318262312546155","host":"s3://npm-registry-packages-npm-production"}},"2.1.1":{"name":"@dao3fun/high-bessel","version":"2.1.1","keywords":[],"author":{"name":"冷鱼闲风"},"license":"ISC","_id":"@dao3fun/high-bessel@2.1.1","maintainers":[{"name":"viyrs","email":"2991883280@qq.com"},{"name":"surfish","email":"surfish.fun@outlook.com"},{"name":"tobylai","email":"toby_lai@126.com"},{"name":"studentnumber2","email":"pzh123gxy2023@163.com"},{"name":"l.w.kevin0wvf","email":"Qck320923@163.com"},{"name":"onloading","email":"605952607@qq.com"},{"name":"whale303","email":"little_whale303@outlook.com"}],"dist":{"shasum":"cb5c3ad60f883367191840431895c790c3b94f5e","tarball":"https://registry.npmjs.org/@dao3fun/high-bessel/-/high-bessel-2.1.1.tgz","fileCount":5,"integrity":"sha512-SivXrSOg7AtK7gKBqh03oA4IAQiYNkH7W4QahLXyWEkx9vRgk7wQ4sGE0FYX+ZHiCwySXo1TvOepO/rJup5A9A==","signatures":[{"sig":"MEQCICUF9oj/Jn2ykrogkHLVcWN69inlhaeUdaPuy3zv1twMAiBLjSVkzjdt+rf21Cq5/0mafQtpnG0UUaWLfneC/jtDuQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":35318},"main":"server/dist/server/src/App.js","types":"server/dist/server/src/App.d.ts","gitHead":"a1f9b16200816be3182b74d73746589949bf9245","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"viyrs","email":"2991883280@qq.com"},"_npmVersion":"10.9.0","description":"负责管理游戏中的模型高贝塞尔曲线动画，它使用贝塞尔曲线来平滑地移动相机实体，并支持不同的缓动函数来控制动画速度，同时也支持生成曲面","directories":{},"_nodeVersion":"22.12.0","_hasShrinkwrap":false,"devDependencies":{"acorn":"^8.14.0","webpack":"^5.97.1","ts-loader":"^9.5.1","typescript":"^5.7.2","webpack-cli":"^5.1.4","terser-webpack-plugin":"^5.3.11"},"_npmOperationalInternal":{"tmp":"tmp/high-bessel_2.1.1_1738414316849_0.6154185448942249","host":"s3://npm-registry-packages-npm-production"}},"2.1.2":{"name":"@dao3fun/high-bessel","version":"2.1.2","keywords":[],"author":{"name":"冷鱼闲风"},"license":"ISC","_id":"@dao3fun/high-bessel@2.1.2","maintainers":[{"name":"viyrs","email":"2991883280@qq.com"},{"name":"surfish","email":"surfish.fun@outlook.com"},{"name":"tobylai","email":"toby_lai@126.com"},{"name":"studentnumber2","email":"pzh123gxy2023@163.com"},{"name":"l.w.kevin0wvf","email":"Qck320923@163.com"},{"name":"onloading","email":"605952607@qq.com"},{"name":"whale303","email":"little_whale303@outlook.com"}],"dist":{"shasum":"65d00c4d6ea893494821846e207e98b0a060c3cb","tarball":"https://registry.npmjs.org/@dao3fun/high-bessel/-/high-bessel-2.1.2.tgz","fileCount":5,"integrity":"sha512-p1Lx41MhWRjfWRmzR0/5H4y2eXUwVbQ2nwvqMfzp10JvG3vLh8tJwmhS7OlGfX6k8IJuxjiimYXK7uWwLv0hEA==","signatures":[{"sig":"MEUCIQD5uBaBDLiP6S/j+YEFufLOF2cM8276brj84lOxdcy8UAIgOYskovicUG5i4q7WjGdQ580NLwnD0qjEhlW+RLu8dIM=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":35339},"main":"server/dist/server/src/App.js","types":"server/dist/server/src/App.d.ts","gitHead":"be11f8823730d64fce340ae8576e10eee693690c","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"viyrs","email":"2991883280@qq.com"},"_npmVersion":"10.9.0","description":"负责管理游戏中的模型高贝塞尔曲线动画，它使用贝塞尔曲线来平滑地移动相机实体，并支持不同的缓动函数来控制动画速度，同时也支持生成曲面","directories":{},"_nodeVersion":"22.12.0","_hasShrinkwrap":false,"devDependencies":{"acorn":"^8.14.0","webpack":"^5.97.1","ts-loader":"^9.5.1","typescript":"^5.7.2","webpack-cli":"^5.1.4","terser-webpack-plugin":"^5.3.11"},"_npmOperationalInternal":{"tmp":"tmp/high-bessel_2.1.2_1738414450800_0.839702889184736","host":"s3://npm-registry-packages-npm-production"}}},"time":{"created":"2024-11-08T11:32:41.662Z","modified":"2025-07-17T09:04:48.460Z","1.0.0":"2024-11-08T11:32:41.924Z","2.0.0":"2025-01-31T13:57:22.305Z","2.0.1":"2025-02-01T02:26:17.498Z","2.1.0":"2025-02-01T08:37:47.836Z","2.1.1":"2025-02-01T12:51:57.046Z","2.1.2":"2025-02-01T12:54:11.016Z"},"author":{"name":"冷鱼闲风"},"license":"ISC","keywords":[],"description":"负责管理游戏中的模型高贝塞尔曲线动画，它使用贝塞尔曲线来平滑地移动相机实体，并支持不同的缓动函数来控制动画速度，同时也支持生成曲面","maintainers":[{"email":"2991883280@qq.com","name":"viyrs"},{"email":"surfish.fun@outlook.com","name":"surfish"},{"email":"toby_lai@126.com","name":"tobylai"},{"email":"pzh123gxy2023@163.com","name":"studentnumber2"},{"email":"Qck320923@163.com","name":"l.w.kevin0wvf"},{"email":"605952607@qq.com","name":"onloading"},{"email":"little_whale303@outlook.com","name":"whale303"},{"email":"863489539@qq.com","name":"syhdarkforest"}],"readme":"# 神岛模型高阶贝塞尔曲线动画 2.0\r\n\r\n> 来自 box3 游戏《新春·欢乐游乐园》中的火车运行路径，运用了贝塞尔 3 阶内连续移动。[https://dao3.fun/exp/experience/detail/100012435](https://dao3.fun/exp/experience/detail/100012435)\r\n\r\n![](https://static.codemao.cn/pickduck/Hkh0XuvWkx.gif?hash=lm78J0LS8CUIYMHZDEuyLx-7CMLQ)\r\n\r\n> 来自 box3 游戏《瓶盖人大乱斗》中的胜利场面，运用了贝塞尔 3 阶内连续移动。锁定视角。[https://dao3.fun/exp/experience/detail/100108748](https://dao3.fun/exp/experience/detail/100108748)\r\n\r\n![](https://static.codemao.cn/pickduck/HyMx4dvbyx.gif?hash=lg9KArMwdfxvjKmGEpH1akLVqtTN)\r\n\r\n![](https://static.codemao.cn/pickduck/SyWfEdwbke.gif?hash=ljTs4HwUvh9Efg8bS8IYd-SrQlLJ)\r\n\r\n## 详细文档\r\n\r\n[https://docs.pgaot.com/npm/high-bessel/](https://docs.pgaot.com/npm/high-bessel/)\r\n\r\n## 示例\r\n\r\n- 生成模型\r\n  效果： 根据刷新频率，在贝塞尔曲线上动态生成一系列模型。\r\n\r\n```javascript\r\nimport GameHighBessel, { GameHighBesselEases } from \"@dao3fun/high-bessel\";\r\n\r\n// 初始化贝塞尔曲线动画对象，设置固定点模型名称为 \"pos\"\r\nconst bessel = new GameHighBessel({\r\n  fixedPointNameOrPosList: \"pos\",\r\n});\r\n\r\n// 当动画进度更新时，创建一个新实体表示贝塞尔曲线上的一个点\r\nbessel.onUpdate((point) => {\r\n  world.createEntity({\r\n    mesh: \"mesh/点.vb\",\r\n    collides: false,\r\n    gravity: false,\r\n    position: point,\r\n  });\r\n});\r\n\r\n// 播放贝塞尔曲线动画，设置播放速度为 0.01\r\nbessel.play({\r\n  speed: 0.01,\r\n});\r\n```\r\n\r\n- 场景展示动画\r\n  效果： 使用贝塞尔曲线缓动，从 pos-1 位置移动到 pos-2 位置等，实现平滑的场景切换。\r\n\r\n```javascript\r\nimport GameHighBessel, { GameHighBesselEases } from \"@dao3fun/high-bessel\";\r\n\r\n// 创建一个模型实体，设置其属性\r\nconst model = world.createEntity({\r\n  mesh: \"mesh/摄像头.vb\",\r\n  collides: false,\r\n  gravity: false,\r\n});\r\n\r\n// 初始化贝塞尔曲线动画对象，设置固定点模型名称为 \"pos\"\r\nconst bessel = new GameHighBessel({\r\n  fixedPointNameOrPosList: \"pos\",\r\n});\r\n\r\n// 如果模型存在，则在玩家加入世界时播放动画，并将摄像机绑定到玩家\r\nif (model) {\r\n  model.meshInvisible = true;\r\n  world.onPlayerJoin(({ entity, tick }) => {\r\n    // 播放贝塞尔曲线动画，设置播放速度和缓动函数\r\n    bessel.play({\r\n      cameraEntity: model,\r\n      speed: 0.00002,\r\n      ease: \"easeInOutCubic\",\r\n    });\r\n\r\n    // 将贝塞尔曲线动画的摄像机实体设置为当前玩家的摄像机实体\r\n    if (bessel.cameraEntity) entity.player.cameraEntity = bessel.cameraEntity;\r\n  });\r\n}\r\n```\r\n\r\n- 拖放进度\r\n  效果： 在贝塞尔曲线上拖拽进度条，从任意位置开始播放动画。\r\n\r\n```javascript\r\nimport GameHighBessel, { GameHighBesselEases } from \"@dao3fun/high-bessel\";\r\n\r\n// 创建一个模型实体，设置其属性\r\nconst model = world.createEntity({\r\n  mesh: \"mesh/AI自动生成-橘子.vb\",\r\n  collides: false,\r\n  gravity: false,\r\n});\r\n\r\nif (model) {\r\n  // 初始化贝塞尔曲线动画对象，设置固定点模型名称为 \"pos\" 并绑定摄像机实体\r\n  const bessel = new GameHighBessel({\r\n    fixedPointNameOrPosList: \"pos\",\r\n    cameraEntity: model,\r\n  });\r\n\r\n  // 设置贝塞尔曲线动画的进度为 60%，并开始播放\r\n  bessel.progress = 0.6;\r\n  bessel.play();\r\n\r\n  // 当贝塞尔曲线动画完成时，重新从头开始播放\r\n  bessel.onFinish(() => {\r\n    bessel.play({ progress: 0 });\r\n  });\r\n}\r\n```\r\n\r\n- 曲线转曲面\r\n  效果：将多条贝塞尔曲线转化为曲面\r\n\r\n```javascript\r\nimport GameHighBessel, { GameHighBesselEases } from \"@dao3fun/high-bessel\";\r\n\r\n// 定义一个包含贝塞尔曲线配置的数组\r\nconst besselConfigs = [\r\n  { fixedPointNameOrPosList: \"pos\", fixedPointMeshInvisible: false },\r\n  { fixedPointNameOrPosList: \"pos2\", fixedPointMeshInvisible: false },\r\n  { fixedPointNameOrPosList: \"pos3\", fixedPointMeshInvisible: false },\r\n];\r\n\r\n// 根据配置数组创建贝塞尔曲线对象数组\r\nconst bessels = besselConfigs.map((config) => new GameHighBessel(config));\r\n\r\n// 获取所有贝塞尔曲线对象的固定点列表\r\nconst fixedPointLists = bessels.map((bessel) => bessel.fixedPointList());\r\n\r\n// 从固定点列表中创建一个贝塞尔曲面\r\nconst vectorSurface = GameHighBessel.createBezierSurfaceFromPoints({\r\n  controlPoints: fixedPointLists,\r\n});\r\n\r\n// 遍历贝塞尔曲面上的每个位置，创建实体\r\nvectorSurface.forEach((position) => {\r\n  world.createEntity({\r\n    mesh: \"mesh/方块.vb\",\r\n    position,\r\n    fixed: true,\r\n  });\r\n});\r\n```\r\n","readmeFilename":"README.md"}