Skip to content

A fast 2D and 3D game engine — TypeScript SDK, C++/WebAssembly core, visual editor. Ship one project to web, desktop, WeChat MiniGames, playable ads, and native Android / iOS.

feat(editor): a selected spring-bone collider has six handles in the viewport that drag its radius and height

yhh215f88f8bfe5
diff --git a/CHANGELOG.md b/CHANGELOG.md
index ed2891c73..9c7f1605f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -35,6 +35,7 @@ published separately; it ships inside the editor.
- **Contact shadows and screen-space bounce light.** Contact Shadows and Screen Space GI effects add small sharp shadows at contacts and one bounce of colour between surfaces, and the weather softens the sun's shadows. `contactShadows` marches a short ray toward the scene's sun in the depth buffer; `ssgi` gathers eight rays a pixel over the G-buffer's normals at half size into a float target and averages the neighbours on the same surface before laying the light, times the receiver's colour, over the picture. The Weather component raises the sun's `sourceAngle` and lowers its `shadowStrength` as the sky clouds over.
- **Terrain and Foliage.** A Terrain component makes ground from a heightmap or noise, paints it with grass, dirt, snow and rock layers and draws it in chunks that coarsen with distance; a Foliage component scatters grass or a mesh over it, swaying in the wind and thinning out with distance.
- **Separate material maps packed on import.** Importing an FBX with separate metalness, roughness and occlusion images now packs them into the one map the Model shader samples, instead of dropping them. Occlusion goes in red, roughness in green and metal in blue, each from its image's red channel (a glossiness map is inverted); a channel with no image stays at full so the material's own value speaks. Only PNG and DDS can be read.
+- **Spring-bone collider handles.** A selected spring-bone collider carries six square handles in the viewport: on a sphere any of them sets the radius, on a capsule the four round its middle set the radius and the two on its ends set the height. The ones on the far side of the shape are faded, the value shows beside the pointer while one is dragged, a drag is one undo step, and with Preview FX on the strands follow it live.
- **Spring-bone import.** A model's new Spring Bones import setting (By Bone Name) builds hair motion from names the file already carries: a bone called Hair_<region>_<chain>_00 becomes a SpringBone with the bones below it as the strand, and an empty called SBC_Sphere_<name>_r<cm> or SBC_Capsule_<name>_r<cm>_h<cm> becomes a collider every chain is kept out of. The region sets a starting stiffness and drag, sizes follow the model's metres and the import scale, and the result is ordinary components to adjust in Details.
- **Spring-bone wind.** A spring-bone chain takes a wind: `wind` is a steady acceleration on the chain, `windGust` swings its strength from calm to twice as strong, and `windFrequency` sets how often. Each bone meets a gust a moment after the one above, so a strand ripples rather than swaying as one, and a chain's gusts depend only on its own clock, so the same scene moves the same way twice. The wind is a field on each chain; there is no scene-wide wind source yet.
- **Spring-bone authoring.** Spring bones can be authored in the editor: Details groups a chain's fields into Motion, Chain and Collision and counts the bones below it (or warns that there are none), the viewport draws a selected chain (the bones as posed, a ring at each joint, the tips) with the colliders it keeps out of, or a selected collider on its own, behind a Spring bones entry in the Gizmo menu, and View · Preview FX simulates the chain in the edit viewport, drawn solid over its dashed pose. Ending the preview gives the bones back as the scene has them.
diff --git a/desktop b/desktop
index 07bf324e2..ae7d1651e 160000
--- a/desktop
+++ b/desktop
@@ -1 +1 @@
-Subproject commit 07bf324e238ecbd8d72aa6fef6e6b2d7faf532ba
+Subproject commit ae7d1651e348c32eba57c5b3ab35b850c6d6864f
diff --git a/docs/astro/src/content/docs/animation/spring-bones.mdx b/docs/astro/src/content/docs/animation/spring-bones.mdx
index 9ac4f773f..b50270900 100644
--- a/docs/astro/src/content/docs/animation/spring-bones.mdx
+++ b/docs/astro/src/content/docs/animation/spring-bones.mdx
@@ -51,7 +51,7 @@ line how many bones the chain has below its entity and how many end tips, or, in
Select a chain's root and the viewport draws it, and the colliders it keeps out of, in the **Spring bones** entry of the Gizmo menu: the bones as the animation poses them
as amber lines, a ring at each joint the width of the strand's `radius` (a dot where it is 0), a tip where `endLength` gives one, and each collider as a wireframe sphere or
-capsule in the collider green. Select a `SpringBoneCollider` and its own shape is drawn. Nothing is drawn for what is not selected, so a character's hair does not fill the viewport.
+capsule in the collider green. Select a `SpringBoneCollider` and its own shape is drawn, with six square handles to size it: on a sphere all six set the radius, on a capsule the four round its middle set the radius and the two on its ends set the height (the distance between the centres of its end spheres). The handles on the far side of the shape are faded. A drag is one undo step, shows the value beside the pointer, and the strands follow it live while Preview FX is on. Nothing is drawn for what is not selected, so a character's hair does not fill the viewport.
**View → Preview FX** (on in a fresh editor, the same switch particles and trails use) runs the chain in the edit viewport: drag the head, or change a field, and the
hair swings. With it on, the simulated chain is drawn solid over the animated pose, dashed, so the difference you are tuning is the difference you see. Turning it off
@@ -82,5 +82,5 @@ cost 0.28 ms an update.** The test is `springbone` in the editor checks; `test_s
- A bone with several children aims at its first child; the others follow by being children, and aim at their own.
- Scale is taken from the bones' composed scale; non-uniform scale down a chain is not modelled.
- Collision is bone against sphere or capsule: no collision between strands, no self-collision, and no collision with the world's physics shapes.
-- The wind is a field on each chain, not a force in the scene: there is no scene-wide wind source to set once for every chain. A collider's radius, height and offset are typed in Details; the viewport has no handles to drag them. Chains are made from names; the importer does not look at
+- The wind is a field on each chain, not a force in the scene: there is no scene-wide wind source to set once for every chain. A collider's offset is typed in Details, or set by moving its entity; the handles size it, they do not place it. Chains are made from names; the importer does not look at
the shape of the mesh, so a strand with no `Hair_` bone gets no motion.
diff --git a/docs/astro/src/content/docs/zh-cn/animation/spring-bones.mdx b/docs/astro/src/content/docs/zh-cn/animation/spring-bones.mdx
index 73c358dfe..f1100f462 100644
--- a/docs/astro/src/content/docs/zh-cn/animation/spring-bones.mdx
+++ b/docs/astro/src/content/docs/zh-cn/animation/spring-bones.mdx
@@ -43,7 +43,7 @@ description: 骨骼链的次级运动(头发、尾巴、绳索):放在链根上
Details 把链的字段分成 **Motion**(stiffness、drag、gravity)、**Chain**(end length、radius、weight)和 **Collision**(colliders)三组,第一行说明这条链在它的实体下有几根骨头、几个末端尖端;没有子骨头时用警告色说明它什么也不会模拟。
-选中链的根,视口就会画出它,和它要避开的碰撞体,开关在 Gizmo 菜单的 **Spring bones** 一项:动画摆出的骨头是琥珀色的线,每个关节有一个与发丝 `radius` 同宽的圈(为 0 时是一个点),`endLength` 给出尖端的地方有一段尖端,每个碰撞体是碰撞体绿色的线框球或胶囊。选中 `SpringBoneCollider` 就画它自己的形状。没选中的什么也不画,所以角色的头发不会把视口填满。
+选中链的根,视口就会画出它,和它要避开的碰撞体,开关在 Gizmo 菜单的 **Spring bones** 一项:动画摆出的骨头是琥珀色的线,每个关节有一个与发丝 `radius` 同宽的圈(为 0 时是一个点),`endLength` 给出尖端的地方有一段尖端,每个碰撞体是碰撞体绿色的线框球或胶囊。选中 `SpringBoneCollider` 就画它自己的形状,并带六个方形手柄来调整大小:球上六个都改半径,胶囊中间一圈的四个改半径,两端的两个改高度(两端球心之间的距离)。在形状背面的手柄会变淡。一次拖拽是一步撤销,数值显示在指针旁边,开着预览特效时发丝会实时跟着变。没选中的什么也不画,所以角色的头发不会把视口填满。
**视图 → 预览特效**(新编辑器里默认开,和粒子、拖尾用同一个开关)会让链在编辑视口里运行:拖动头,或者改一个字段,头发就会摆动。开着时,模拟出的链画成实线,盖在虚线画的动画姿势上,所以你在调的那个差别就是你看到的差别。关掉它会结束模拟,并把骨头还给场景里原来的样子。这个模拟是编辑器自己的:它从不写进场景文件。
@@ -66,4 +66,4 @@ Details 把链的字段分成 **Motion**(stiffness、drag、gravity)、**Chain**
- 有多个子骨头的骨头瞄准它的第一个子骨头;其他的因为是子骨头而跟着动,并各自瞄准自己的。
- 缩放取骨头合成后的缩放;链上的非均匀缩放没有建模。
- 碰撞是骨头对球或胶囊:没有发丝之间的碰撞,没有自碰撞,也没有和世界物理形状的碰撞。
-- 风是每条链自己的字段,不是场景里的力:还没有一个场景级的风源可以一次设置给所有链。碰撞体的半径、高度和偏移在 Details 里输入;视口里没有可以拖动它们的手柄。链是按名字建的,导入器不看网格的形状,所以没有 `Hair_` 骨头的发束不会有动作。
+- 风是每条链自己的字段,不是场景里的力:还没有一个场景级的风源可以一次设置给所有链。碰撞体的偏移在 Details 里输入,或者移动它的实体来设置;手柄只调大小,不改位置。链是按名字建的,导入器不看网格的形状,所以没有 `Hair_` 骨头的发束不会有动作。
diff --git a/tools/releaseNotes.mjs b/tools/releaseNotes.mjs
index 69c837a74..7d0f64a4d 100644
--- a/tools/releaseNotes.mjs
+++ b/tools/releaseNotes.mjs
@@ -2567,6 +2567,8 @@ export const NOTED = {
{"note":"Water holds things up. A Floating component on an entity with a RigidBody3D floats it: a buoyant force against gravity (`buoyancy` is the water's density against the body's, so 2 floats it half under) and a drag against its velocity relative to the water, which brings it to rest in a lake and carries it with a river's current, applied at a few points of the body so waves tip it. It works from the CPU's own water surface, so it needs no renderer, and it needs the 3D physics module, which gains force and mass queries."},
"feat(water): a camera under the surface sees through the water, fogged and tinted by what it has crossed":
{"note":"A camera under water sees through it. Whenever the active camera is below a water body's surface an Underwater effect is added to the post-process volumes: the light of each pixel is taken out colour by colour (red first) by the distance it crossed, with the same absorption and density the surface's material draws with, and the water gives back its own colour, dimmer the deeper the camera is. The surface seen from below turns over and, past the critical angle, reflects whole (Snell's window)."},
+ "feat(editor): a selected spring-bone collider has six handles in the viewport that drag its radius and height":
+ {"note":"A selected spring-bone collider carries six square handles in the viewport: on a sphere any of them sets the radius, on a capsule the four round its middle set the radius and the two on its ends set the height. The ones on the far side of the shape are faded, the value shows beside the pointer while one is dragged, a drag is one undo step, and with Preview FX on the strands follow it live."},
"feat(pipeline): a model's Spring Bones import setting builds hair chains and colliders from bone names":
{"note":"A model's new Spring Bones import setting (By Bone Name) builds hair motion from names the file already carries: a bone called Hair_<region>_<chain>_00 becomes a SpringBone with the bones below it as the strand, and an empty called SBC_Sphere_<name>_r<cm> or SBC_Capsule_<name>_r<cm>_h<cm> becomes a collider every chain is kept out of. The region sets a starting stiffness and drag, sizes follow the model's metres and the import scale, and the result is ordinary components to adjust in Details."},
"feat(animation): a spring-bone chain takes a wind, with gusts that ripple down the strand":