Inheritance #
- AudioServer
- CameraServer
- ClassDB
- DisplayServer
- EditorFileSystemDirectory
- EditorInterface
- EditorPaths
- EditorSelection
- EditorUndoRedoManager
- EditorVCSInterface
- Engine
- EngineDebugger
- FramebufferCacheRD
- GDExtensionManager
- Geometry2D
- Geometry3D
- IP
- Input
- InputMap
- JNISingleton
- JSONRPC
- JavaClassWrapper
- JavaScriptBridge
- MainLoop (1)
- Marshalls
- MovieWriter
- NativeMenu
- NavigationMeshGenerator
- NavigationServer2D
- NavigationServer3D
- Node (21)
- OS
- OpenXRExtensionWrapperExtension
- OpenXRInteractionProfileMetadata
- Performance
- PhysicsDirectBodyState2D (1)
- PhysicsDirectBodyState3D (1)
- PhysicsDirectSpaceState2D (1)
- PhysicsDirectSpaceState3D (1)
- PhysicsServer2D (1)
- PhysicsServer2DManager
- PhysicsServer3D (1)
- PhysicsServer3DManager
- PhysicsServer3DRendering
ServerHandler
- ProjectSettings
- RefCounted (121)
- RenderData (2)
- RenderSceneData (2)
- RenderingDevice
- RenderingServer
- ResourceLoader
- ResourceSaver
- ResourceUID
- ScriptLanguage (1)
- ShaderIncludeDB
- TextServerManager
- ThemeDB
- TileData
- Time
- TranslationServer
- TreeItem
- UndoRedo
- UniformSetCacheRD
- WorkerThreadPool
- XRServer
- XRVRS
- AnimationMixer (2)
- AudioStreamPlayer
- CanvasItem (2)
- CanvasLayer (1)
- EditorFileSystem
- EditorPlugin (1)
- EditorResourcePreview
- HTTPRequest
- InstancePlaceholder
- MissingNode
- MultiplayerSpawner
- MultiplayerSynchronizer
- NavigationAgent2D
- NavigationAgent3D
- Node3D (31)
- ResourcePreloader
- ShaderGlobalsOverride
- StatusIndicator
- Timer
- Viewport (2)
- WorldEnvironment
- AudioListener3D
- AudioStreamPlayer3D
- BoneAttachment3D
- Camera3D (1)
- CollisionObject3D (2)
- CollisionPolygon3D
- CollisionShape3D
- GridMap
- ImporterMeshInstance3D
- Joint3D (5)
- LightmapProbe
- Marker3D
- NavigationLink3D
- NavigationObstacle3D
- NavigationRegion3D
- OpenXRCompositionLayer (3)
- OpenXRHand
- Path3D
- PathFollow3D
- RayCast3D
- RemoteTransform3D
- ShapeCast3D
- Skeleton3D
- SkeletonModifier3D (7)
- SpringArm3D
- SpringBoneCollision3D (3)
- VehicleWheel3D
- VisualInstance3D (13)
- XRFaceModifier3D
- XRNode3D (2)
- XROrigin3D
- LookAtModifier3D
- PhysicalBoneSimulator3D
- RetargetModifier3D
- SkeletonIK3D
- SpringBoneSimulator3D
- XRBodyModifier3D
- XRHandModifier3D
Table of contents
-
var setting_count: int = 0 -
const func are_all_child_collisions_enabled(index: int) -> bool -
func clear_collisions(index: int) -> void -
func clear_exclude_collisions(index: int) -> void -
func clear_settings() -> void -
const func get_center_bone(index: int) -> int -
const func get_center_bone_name(index: int) -> String -
const func get_center_from(index: int) -> intSpringBoneSimulator3D.CenterFrom -
const func get_center_node(index: int) -> NodePath -
const func get_collision_count(index: int) -> int -
const func get_collision_path(collision: int) -> NodePath -
const func get_drag(index: int) -> float -
const func get_drag_damping_curve(index: int) -> Curve -
const func get_end_bone(index: int) -> int -
const func get_end_bone_direction(index: int) -> intSpringBoneSimulator3D.BoneDirection -
const func get_end_bone_length(index: int) -> float -
const func get_end_bone_name(index: int) -> String -
const func get_exclude_collision_count(index: int) -> int -
const func get_exclude_collision_path(collision: int) -> NodePath -
const func get_gravity(index: int) -> float -
const func get_gravity_damping_curve(index: int) -> Curve -
const func get_gravity_direction(index: int) -> Vector3 -
const func get_joint_bone(joint: int) -> int -
const func get_joint_bone_name(joint: int) -> String -
const func get_joint_count(index: int) -> int -
const func get_joint_drag(joint: int) -> float -
const func get_joint_gravity(joint: int) -> float -
const func get_joint_gravity_direction(joint: int) -> Vector3 -
const func get_joint_radius(joint: int) -> float -
const func get_joint_rotation_axis(joint: int) -> intSpringBoneSimulator3D.RotationAxis -
const func get_joint_stiffness(joint: int) -> float -
const func get_radius(index: int) -> float -
const func get_radius_damping_curve(index: int) -> Curve -
const func get_root_bone(index: int) -> int -
const func get_root_bone_name(index: int) -> String -
const func get_rotation_axis(index: int) -> intSpringBoneSimulator3D.RotationAxis -
const func get_stiffness(index: int) -> float -
const func get_stiffness_damping_curve(index: int) -> Curve -
const func is_config_individual(index: int) -> bool -
const func is_end_bone_extended(index: int) -> bool -
func reset() -> void -
func set_center_bone(bone: int) -> void -
func set_center_bone_name(bone_name: String) -> void -
func set_center_from(center_from: int enumSpringBoneSimulator3D.CenterFrom) -> void -
func set_center_node(node_path: NodePath) -> void -
func set_collision_count(count: int) -> void -
func set_collision_path(node_path: NodePath) -> void -
func set_drag(drag: float) -> void -
func set_drag_damping_curve(curve: Curve) -> void -
func set_enable_all_child_collisions(enabled: bool) -> void -
func set_end_bone(bone: int) -> void -
func set_end_bone_direction(bone_direction: int enumSpringBoneSimulator3D.BoneDirection) -> void -
func set_end_bone_length(length: float) -> void -
func set_end_bone_name(bone_name: String) -> void -
func set_exclude_collision_count(count: int) -> void -
func set_exclude_collision_path(node_path: NodePath) -> void -
func set_extend_end_bone(enabled: bool) -> void -
func set_gravity(gravity: float) -> void -
func set_gravity_damping_curve(curve: Curve) -> void -
func set_gravity_direction(gravity_direction: Vector3) -> void -
func set_individual_config(enabled: bool) -> void -
func set_joint_drag(drag: float) -> void -
func set_joint_gravity(gravity: float) -> void -
func set_joint_gravity_direction(gravity_direction: Vector3) -> void -
func set_joint_radius(radius: float) -> void -
func set_joint_rotation_axis(axis: int enumSpringBoneSimulator3D.RotationAxis) -> void -
func set_joint_stiffness(stiffness: float) -> void -
func set_radius(radius: float) -> void -
func set_radius_damping_curve(curve: Curve) -> void -
func set_root_bone(bone: int) -> void -
func set_root_bone_name(bone_name: String) -> void -
func set_rotation_axis(axis: int enumSpringBoneSimulator3D.RotationAxis) -> void -
func set_stiffness(stiffness: float) -> void -
func set_stiffness_damping_curve(curve: Curve) -> void -
const BONE_DIRECTION_PLUS_X = 0 enum BoneDirection -
const BONE_DIRECTION_MINUS_X = 1 enum BoneDirection -
const BONE_DIRECTION_PLUS_Y = 2 enum BoneDirection -
const BONE_DIRECTION_MINUS_Y = 3 enum BoneDirection -
const BONE_DIRECTION_PLUS_Z = 4 enum BoneDirection -
const BONE_DIRECTION_MINUS_Z = 5 enum BoneDirection -
const BONE_DIRECTION_FROM_PARENT = 6 enum BoneDirection -
const CENTER_FROM_WORLD_ORIGIN = 0 enum CenterFrom -
const CENTER_FROM_NODE = 1 enum CenterFrom -
const CENTER_FROM_BONE = 2 enum CenterFrom -
const ROTATION_AXIS_X = 0 enum RotationAxis -
const ROTATION_AXIS_Y = 1 enum RotationAxis -
const ROTATION_AXIS_Z = 2 enum RotationAxis -
const ROTATION_AXIS_ALL = 3 enum RotationAxis -
enum BoneDirection -
enum CenterFrom -
enum RotationAxis
SpringBoneSimulator3D #
is_instantiable, Node3D, Node, core, not_builtin_classes
A SkeletonModifier3D to apply inertial wavering to bone chains.
This SkeletonModifier3D can be used to wiggle hair, cloth, and tails. This modifier behaves differently from PhysicalBoneSimulator3D as it attempts to return the original pose after modification.
If you setup set_root_bone and set_end_bone, it is treated as one bone chain. Note that it does not support a branched chain like Y-shaped chains.
When a bone chain is created, an array is generated from the bones that exist in between and listed in the joint list.
Several properties can be applied to each joint, such as set_joint_stiffness, set_joint_drag, and set_joint_gravity.
For simplicity, you can set values to all joints at the same time by using a Curve. If you want to specify detailed values individually, set set_individual_config to true.
For physical simulation, SpringBoneSimulator3D can have children as self-standing collisions that are not related to PhysicsServer3D, see also SpringBoneCollision3D.
Warning: A scaled SpringBoneSimulator3D will likely not behave as expected. Make sure that the parent Skeleton3D and its bones are not scaled.
Members #
var setting_count: int = 0#
The number of settings.
Methods #
const func are_all_child_collisions_enabled(index: int) -> bool#
Returns true if the all child SpringBoneCollision3Ds are contained in the collision list at index in the settings.
func clear_collisions(index: int) -> void#
Clears all collisions from the collision list at index in the settings when are_all_child_collisions_enabled is false.
func clear_exclude_collisions(index: int) -> void#
Clears all exclude collisions from the collision list at index in the settings when are_all_child_collisions_enabled is true.
func clear_settings() -> void#
Clears all settings.
const func get_center_bone(index: int) -> int#
Returns the center bone index of the bone chain.
const func get_center_bone_name(index: int) -> String#
Returns the center bone name of the bone chain.
const func get_center_from(index: int) -> intSpringBoneSimulator3D.CenterFrom#
Returns what the center originates from in the bone chain.
const func get_center_node(index: int) -> NodePath#
Returns the center node path of the bone chain.
const func get_collision_count(index: int) -> int#
Returns the collision count of the bone chain's collision list when are_all_child_collisions_enabled is false.
const func get_collision_path(collision: int) -> NodePath#
Returns the node path of the SpringBoneCollision3D at collision in the bone chain's collision list when are_all_child_collisions_enabled is false.
const func get_drag(index: int) -> float#
Returns the drag force damping curve of the bone chain.
const func get_drag_damping_curve(index: int) -> Curve#
Returns the drag force damping curve of the bone chain.
const func get_end_bone(index: int) -> int#
Returns the end bone index of the bone chain.
const func get_end_bone_direction(index: int) -> intSpringBoneSimulator3D.BoneDirection#
Returns the end bone's tail direction of the bone chain when is_end_bone_extended is true.
const func get_end_bone_length(index: int) -> float#
Returns the end bone's tail length of the bone chain when is_end_bone_extended is true.
const func get_end_bone_name(index: int) -> String#
Returns the end bone name of the bone chain.
const func get_exclude_collision_count(index: int) -> int#
Returns the exclude collision count of the bone chain's exclude collision list when are_all_child_collisions_enabled is true.
const func get_exclude_collision_path(collision: int) -> NodePath#
Returns the node path of the SpringBoneCollision3D at collision in the bone chain's exclude collision list when are_all_child_collisions_enabled is true.
const func get_gravity(index: int) -> float#
Returns the gravity amount of the bone chain.
const func get_gravity_damping_curve(index: int) -> Curve#
Returns the gravity amount damping curve of the bone chain.
const func get_gravity_direction(index: int) -> Vector3#
Returns the gravity direction of the bone chain.
const func get_joint_bone(joint: int) -> int#
Returns the bone index at joint in the bone chain's joint list.
const func get_joint_bone_name(joint: int) -> String#
Returns the bone name at joint in the bone chain's joint list.
const func get_joint_count(index: int) -> int#
Returns the joint count of the bone chain's joint list.
const func get_joint_drag(joint: int) -> float#
Returns the drag force at joint in the bone chain's joint list.
const func get_joint_gravity(joint: int) -> float#
Returns the gravity amount at joint in the bone chain's joint list.
const func get_joint_gravity_direction(joint: int) -> Vector3#
Returns the gravity direction at joint in the bone chain's joint list.
const func get_joint_radius(joint: int) -> float#
Returns the radius at joint in the bone chain's joint list.
const func get_joint_rotation_axis(joint: int) -> intSpringBoneSimulator3D.RotationAxis#
Returns the rotation axis at joint in the bone chain's joint list.
const func get_joint_stiffness(joint: int) -> float#
Returns the stiffness force at joint in the bone chain's joint list.
const func get_radius(index: int) -> float#
Returns the joint radius of the bone chain.
const func get_radius_damping_curve(index: int) -> Curve#
Returns the joint radius damping curve of the bone chain.
const func get_root_bone(index: int) -> int#
Returns the root bone index of the bone chain.
const func get_root_bone_name(index: int) -> String#
Returns the root bone name of the bone chain.
const func get_rotation_axis(index: int) -> intSpringBoneSimulator3D.RotationAxis#
Returns the rotation axis of the bone chain.
const func get_stiffness(index: int) -> float#
Returns the stiffness force of the bone chain.
const func get_stiffness_damping_curve(index: int) -> Curve#
Returns the stiffness force damping curve of the bone chain.
const func is_config_individual(index: int) -> bool#
Returns true if the config can be edited individually for each joint.
const func is_end_bone_extended(index: int) -> bool#
Returns true if the end bone is extended to have the tail.
func reset() -> void#
Resets a simulating state with respect to the current bone pose.
It is useful to prevent the simulation result getting violent. For example, calling this immediately after a call to AnimationPlayer.play without a fading, or within the previous SkeletonModifier3D.modification_processed signal if it's condition changes significantly.
func set_center_bone(bone: int) -> void#
Sets the center bone index of the bone chain.
func set_center_bone_name(bone_name: String) -> void#
Sets the center bone name of the bone chain.
func set_center_from(center_from: int enumSpringBoneSimulator3D.CenterFrom) -> void#
Sets what the center originates from in the bone chain.
Bone movement is calculated based on the difference in relative distance between center and bone in the previous and next frames.
For example, if the parent Skeleton3D is used as the center, the bones are considered to have not moved if the Skeleton3D moves in the world.
In this case, only a change in the bone pose is considered to be a bone movement.
func set_center_node(node_path: NodePath) -> void#
Sets the center node path of the bone chain.
func set_collision_count(count: int) -> void#
Sets the number of collisions in the collision list at index in the settings when are_all_child_collisions_enabled is false.
func set_collision_path(node_path: NodePath) -> void#
Sets the node path of the SpringBoneCollision3D at collision in the bone chain's collision list when are_all_child_collisions_enabled is false.
func set_drag(drag: float) -> void#
Sets the drag force of the bone chain. The greater the value, the more suppressed the wiggling.
The value is scaled by set_drag_damping_curve and cached in each joint setting in the joint list.
func set_drag_damping_curve(curve: Curve) -> void#
Sets the drag force damping curve of the bone chain.
func set_enable_all_child_collisions(enabled: bool) -> void#
If sets enabled to true, the all child SpringBoneCollision3Ds are collided and set_exclude_collision_path is enabled as an exclusion list at index in the settings.
If sets enabled to false, you need to manually register all valid collisions with set_collision_path.
func set_end_bone(bone: int) -> void#
Sets the end bone index of the bone chain.
func set_end_bone_direction(bone_direction: int enumSpringBoneSimulator3D.BoneDirection) -> void#
Sets the end bone tail direction of the bone chain when is_end_bone_extended is true.
func set_end_bone_length(length: float) -> void#
Sets the end bone tail length of the bone chain when is_end_bone_extended is true.
func set_end_bone_name(bone_name: String) -> void#
Sets the end bone name of the bone chain.
Note: End bone must be the root bone or a child of the root bone. If they are the same, the tail must be extended by set_extend_end_bone to jiggle the bone.
func set_exclude_collision_count(count: int) -> void#
Sets the number of exclude collisions in the exclude collision list at index in the settings when are_all_child_collisions_enabled is true.
func set_exclude_collision_path(node_path: NodePath) -> void#
Sets the node path of the SpringBoneCollision3D at collision in the bone chain's exclude collision list when are_all_child_collisions_enabled is true.
func set_extend_end_bone(enabled: bool) -> void#
If enabled is true, the end bone is extended to have the tail.
The extended tail config is allocated to the last element in the joint list.
In other words, if you set enabled is false, the config of last element in the joint list has no effect in the simulated result.
func set_gravity(gravity: float) -> void#
Sets the gravity amount of the bone chain. This value is not an acceleration, but a constant velocity of movement in set_gravity_direction.
If gravity is not 0, the modified pose will not return to the original pose since it is always affected by gravity.
The value is scaled by set_gravity_damping_curve and cached in each joint setting in the joint list.
func set_gravity_damping_curve(curve: Curve) -> void#
Sets the gravity amount damping curve of the bone chain.
func set_gravity_direction(gravity_direction: Vector3) -> void#
Sets the gravity direction of the bone chain. This value is internally normalized and then multiplied by set_gravity.
The value is cached in each joint setting in the joint list.
func set_individual_config(enabled: bool) -> void#
If enabled is true, the config can be edited individually for each joint.
func set_joint_drag(drag: float) -> void#
Sets the drag force at joint in the bone chain's joint list when is_config_individual is true.
func set_joint_gravity(gravity: float) -> void#
Sets the gravity amount at joint in the bone chain's joint list when is_config_individual is true.
func set_joint_gravity_direction(gravity_direction: Vector3) -> void#
Sets the gravity direction at joint in the bone chain's joint list when is_config_individual is true.
func set_joint_radius(radius: float) -> void#
Sets the joint radius at joint in the bone chain's joint list when is_config_individual is true.
func set_joint_rotation_axis(axis: int enumSpringBoneSimulator3D.RotationAxis) -> void#
Sets the rotation axis at joint in the bone chain's joint list when is_config_individual is true.
func set_joint_stiffness(stiffness: float) -> void#
Sets the stiffness force at joint in the bone chain's joint list when is_config_individual is true.
func set_radius(radius: float) -> void#
Sets the joint radius of the bone chain. It is used to move and slide with the SpringBoneCollision3D in the collision list.
The value is scaled by set_radius_damping_curve and cached in each joint setting in the joint list.
func set_radius_damping_curve(curve: Curve) -> void#
Sets the joint radius damping curve of the bone chain.
func set_root_bone(bone: int) -> void#
Sets the root bone index of the bone chain.
func set_root_bone_name(bone_name: String) -> void#
Sets the root bone name of the bone chain.
func set_rotation_axis(axis: int enumSpringBoneSimulator3D.RotationAxis) -> void#
Sets the rotation axis of the bone chain. If sets a specific axis, it acts like a hinge joint.
The value is cached in each joint setting in the joint list.
Note: The rotation axis and the forward vector shouldn't be colinear to avoid unintended rotation since SpringBoneSimulator3D does not factor in twisting forces.
func set_stiffness(stiffness: float) -> void#
Sets the stiffness force of the bone chain. The greater the value, the faster it recovers to its initial pose.
If stiffness is 0, the modified pose will not return to the original pose.
The value is scaled by set_stiffness_damping_curve and cached in each joint setting in the joint list.
func set_stiffness_damping_curve(curve: Curve) -> void#
Sets the stiffness force damping curve of the bone chain.
Annotations #
Constants #
const BONE_DIRECTION_PLUS_X = 0 enum BoneDirection#
Enumerated value for the +X axis.
const BONE_DIRECTION_MINUS_X = 1 enum BoneDirection#
Enumerated value for the -X axis.
const BONE_DIRECTION_PLUS_Y = 2 enum BoneDirection#
Enumerated value for the +Y axis.
const BONE_DIRECTION_MINUS_Y = 3 enum BoneDirection#
Enumerated value for the -Y axis.
const BONE_DIRECTION_PLUS_Z = 4 enum BoneDirection#
Enumerated value for the +Z axis.
const BONE_DIRECTION_MINUS_Z = 5 enum BoneDirection#
Enumerated value for the -Z axis.
const BONE_DIRECTION_FROM_PARENT = 6 enum BoneDirection#
Enumerated value for the axis from a parent bone to the child bone.
const CENTER_FROM_WORLD_ORIGIN = 0 enum CenterFrom#
The world origin is defined as center.
const CENTER_FROM_NODE = 1 enum CenterFrom#
The Node3D specified by set_center_node is defined as center.
If Node3D is not found, the parent Skeleton3D is treated as center.
const CENTER_FROM_BONE = 2 enum CenterFrom#
The bone pose origin of the parent Skeleton3D specified by set_center_bone is defined as center.
If Node3D is not found, the parent Skeleton3D is treated as center.
const ROTATION_AXIS_X = 0 enum RotationAxis#
Enumerated value for the rotation of the X axis.
const ROTATION_AXIS_Y = 1 enum RotationAxis#
Enumerated value for the rotation of the Y axis.
const ROTATION_AXIS_Z = 2 enum RotationAxis#
Enumerated value for the rotation of the Z axis.
const ROTATION_AXIS_ALL = 3 enum RotationAxis#
Enumerated value for the unconstrained rotation.
Constructors #
Enums #
BoneDirection#
enum BoneDirection {
BONE_DIRECTION_PLUS_X = 0,
BONE_DIRECTION_MINUS_X = 1,
BONE_DIRECTION_PLUS_Y = 2,
BONE_DIRECTION_MINUS_Y = 3,
BONE_DIRECTION_PLUS_Z = 4,
BONE_DIRECTION_MINUS_Z = 5,
BONE_DIRECTION_FROM_PARENT = 6,
}CenterFrom#
enum CenterFrom {
CENTER_FROM_WORLD_ORIGIN = 0,
CENTER_FROM_NODE = 1,
CENTER_FROM_BONE = 2,
}RotationAxis#
enum RotationAxis {
ROTATION_AXIS_X = 0,
ROTATION_AXIS_Y = 1,
ROTATION_AXIS_Z = 2,
ROTATION_AXIS_ALL = 3,
}