Class SkeletonModification2DPhysicalBones
- Namespace
- Godot
- Assembly
- GodotSharp.dll
This modification takes the transforms of PhysicalBone2D nodes and applies them to Bone2D nodes. This allows the Bone2D nodes to react to physics thanks to the linked PhysicalBone2D nodes.
Experimental. Physical bones may be changed in the future to perform the position update of Bone2D on their own.
public class SkeletonModification2DPhysicalBones : SkeletonModification2D, IDisposable
- Inheritance
-
SkeletonModification2DPhysicalBones
- Implements
- Inherited Members
Constructors
SkeletonModification2DPhysicalBones()
public SkeletonModification2DPhysicalBones()
Properties
PhysicalBoneChainLength
The number of PhysicalBone2D nodes linked in this modification.
public int PhysicalBoneChainLength { get; set; }
Property Value
Methods
FetchPhysicalBones()
Empties the list of PhysicalBone2D nodes and populates it with all PhysicalBone2D nodes that are children of the Skeleton2D.
public void FetchPhysicalBones()
GetPhysicalBoneNode(int)
Returns the PhysicalBone2D node at jointIdx
.
public NodePath GetPhysicalBoneNode(int jointIdx)
Parameters
jointIdx
int
Returns
HasGodotClassMethod(in godot_string_name)
Check if the type contains a method with the given name. This method is used by Godot to check if a method exists before invoking it. Do not call or override this method.
protected override bool HasGodotClassMethod(in godot_string_name method)
Parameters
method
godot_string_nameName of the method to check for.
Returns
HasGodotClassSignal(in godot_string_name)
Check if the type contains a signal with the given name. This method is used by Godot to check if a signal exists before raising it. Do not call or override this method.
protected override bool HasGodotClassSignal(in godot_string_name signal)
Parameters
signal
godot_string_nameName of the signal to check for.
Returns
InvokeGodotClassMethod(in godot_string_name, NativeVariantPtrArgs, out godot_variant)
Invokes the method with the given name, using the given arguments. This method is used by Godot to invoke methods from the engine side. Do not call or override this method.
protected override bool InvokeGodotClassMethod(in godot_string_name method, NativeVariantPtrArgs args, out godot_variant ret)
Parameters
method
godot_string_nameName of the method to invoke.
args
NativeVariantPtrArgsArguments to use with the invoked method.
ret
godot_variantValue returned by the invoked method.
Returns
SetPhysicalBoneNode(int, NodePath)
Sets the PhysicalBone2D node at jointIdx
.
Note: This is just the index used for this modification, not the bone index used in the Skeleton2D.
public void SetPhysicalBoneNode(int jointIdx, NodePath physicalbone2DNode)
Parameters
StartSimulation(Array<StringName>)
Tell the PhysicalBone2D nodes to start simulating and interacting with the physics world.
Optionally, an array of bone names can be passed to this function, and that will cause only PhysicalBone2D nodes with those names to start simulating.
public void StartSimulation(Array<StringName> bones = null)
Parameters
bones
Array<StringName>
StopSimulation(Array<StringName>)
Tell the PhysicalBone2D nodes to stop simulating and interacting with the physics world.
Optionally, an array of bone names can be passed to this function, and that will cause only PhysicalBone2D nodes with those names to stop simulating.
public void StopSimulation(Array<StringName> bones = null)
Parameters
bones
Array<StringName>