Skip to content

Commit 5472558

Browse files
TokageItLablyumafireSaracenOne
committed
Implement SpringBoneSimulator3D to wiggle chained bones
Co-authored-by: lyuma <[email protected]> Co-authored-by: fire <[email protected]> Co-authored-by: SaracenOne <[email protected]>
1 parent 21a6bd8 commit 5472558

28 files changed

+3853
-11
lines changed

doc/classes/EditorSettings.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -480,6 +480,15 @@
480480
<member name="editors/3d_gizmos/gizmo_colors/skeleton" type="Color" setter="" getter="">
481481
The 3D editor gizmo color used for [Skeleton3D] nodes.
482482
</member>
483+
<member name="editors/3d_gizmos/gizmo_colors/spring_bone_collision" type="Color" setter="" getter="">
484+
The 3D editor gizmo color used for [SpringBoneCollision3D] nodes.
485+
</member>
486+
<member name="editors/3d_gizmos/gizmo_colors/spring_bone_inside_collision" type="Color" setter="" getter="">
487+
The 3D editor gizmo color used for [SpringBoneCollision3D] nodes with inside mode.
488+
</member>
489+
<member name="editors/3d_gizmos/gizmo_colors/spring_bone_joint" type="Color" setter="" getter="">
490+
The 3D editor gizmo color used for [SpringBoneSimulator3D] nodes.
491+
</member>
483492
<member name="editors/3d_gizmos/gizmo_colors/stream_player_3d" type="Color" setter="" getter="">
484493
The 3D editor gizmo color used for [AudioStreamPlayer3D]'s emission angle.
485494
</member>
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?xml version="1.0" encoding="UTF-8" ?>
2+
<class name="SpringBoneCollision3D" inherits="Node3D" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
3+
<brief_description>
4+
A base class of the collision that interacts with [SpringBoneSimulator3D].
5+
</brief_description>
6+
<description>
7+
A collision can be a child of [SpringBoneSimulator3D]. If it is not a child of [SpringBoneSimulator3D], it has no effect.
8+
The colliding and sliding are done in the [SpringBoneSimulator3D]'s modification process in order of its collision list which is set by [method SpringBoneSimulator3D.set_collision_path]. If [method SpringBoneSimulator3D.are_all_child_collisions_enabled] is [code]true[/code], the order matches [SceneTree].
9+
If [member bone] is set, it synchronizes with the bone pose of the ancestor [Skeleton3D], which is done in before the [SpringBoneSimulator3D]'s modification process as the pre-process.
10+
</description>
11+
<tutorials>
12+
</tutorials>
13+
<methods>
14+
<method name="get_skeleton" qualifiers="const">
15+
<return type="Skeleton3D" />
16+
<description>
17+
Get parent [Skeleton3D] node of the parent [SpringBoneSimulator3D] if found.
18+
</description>
19+
</method>
20+
</methods>
21+
<members>
22+
<member name="bone" type="int" setter="set_bone" getter="get_bone" default="-1">
23+
The index of the attached bone.
24+
</member>
25+
<member name="bone_name" type="String" setter="set_bone_name" getter="get_bone_name" default="&quot;&quot;">
26+
The name of the attached bone.
27+
</member>
28+
<member name="position_offset" type="Vector3" setter="set_position_offset" getter="get_position_offset">
29+
The offset of the position from [Skeleton3D]'s [member bone] pose position.
30+
</member>
31+
<member name="rotation_offset" type="Quaternion" setter="set_rotation_offset" getter="get_rotation_offset">
32+
The offset of the rotation from [Skeleton3D]'s [member bone] pose rotation.
33+
</member>
34+
</members>
35+
</class>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="UTF-8" ?>
2+
<class name="SpringBoneCollisionCapsule3D" inherits="SpringBoneCollision3D" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
3+
<brief_description>
4+
A capsule shape collision that interacts with [SpringBoneSimulator3D].
5+
</brief_description>
6+
<description>
7+
A capsule shape collision that interacts with [SpringBoneSimulator3D].
8+
</description>
9+
<tutorials>
10+
</tutorials>
11+
<members>
12+
<member name="height" type="float" setter="set_height" getter="get_height" default="0.5">
13+
The capsule's height.
14+
</member>
15+
<member name="inside" type="bool" setter="set_inside" getter="is_inside" default="false">
16+
If [code]true[/code], the collision acts to trap the joint within the collision.
17+
</member>
18+
<member name="radius" type="float" setter="set_radius" getter="get_radius" default="0.1">
19+
The capsule's radius.
20+
</member>
21+
</members>
22+
</class>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0" encoding="UTF-8" ?>
2+
<class name="SpringBoneCollisionPlane3D" inherits="SpringBoneCollision3D" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
3+
<brief_description>
4+
A infinite plane collision that interacts with [SpringBoneSimulator3D].
5+
</brief_description>
6+
<description>
7+
A infinite plane collision that interacts with [SpringBoneSimulator3D]. It is an infinite size XZ plane, and the +Y direction is treated as normal.
8+
</description>
9+
<tutorials>
10+
</tutorials>
11+
</class>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="UTF-8" ?>
2+
<class name="SpringBoneCollisionSphere3D" inherits="SpringBoneCollision3D" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
3+
<brief_description>
4+
A sphere shape collision that interacts with [SpringBoneSimulator3D].
5+
</brief_description>
6+
<description>
7+
A sphere shape collision that interacts with [SpringBoneSimulator3D].
8+
</description>
9+
<tutorials>
10+
</tutorials>
11+
<members>
12+
<member name="inside" type="bool" setter="set_inside" getter="is_inside" default="false">
13+
If [code]true[/code], the collision acts to trap the joint within the collision.
14+
</member>
15+
<member name="radius" type="float" setter="set_radius" getter="get_radius" default="0.1">
16+
The sphere's radius.
17+
</member>
18+
</members>
19+
</class>

0 commit comments

Comments
 (0)