mirror of
https://github.com/godotengine/godot.git
synced 2024-11-27 06:33:16 +00:00
5911a12db1
More should be added in future PRs, wherever there is demand.
46 lines
3.2 KiB
XML
46 lines
3.2 KiB
XML
<?xml version="1.0" encoding="UTF-8" ?>
|
|
<class name="PhysicalBone2D" inherits="RigidBody2D" keywords="ragdoll" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
|
|
<brief_description>
|
|
A [RigidBody2D]-derived node used to make [Bone2D]s in a [Skeleton2D] react to physics.
|
|
</brief_description>
|
|
<description>
|
|
The [PhysicalBone2D] node is a [RigidBody2D]-based node that can be used to make [Bone2D]s in a [Skeleton2D] react to physics.
|
|
[b]Note:[/b] To make the [Bone2D]s visually follow the [PhysicalBone2D] node, use a [SkeletonModification2DPhysicalBones] modification on the [Skeleton2D] parent.
|
|
[b]Note:[/b] The [PhysicalBone2D] node does not automatically create a [Joint2D] node to keep [PhysicalBone2D] nodes together. They must be created manually. For most cases, you want to use a [PinJoint2D] node. The [PhysicalBone2D] node will automatically configure the [Joint2D] node once it's been added as a child node.
|
|
</description>
|
|
<tutorials>
|
|
</tutorials>
|
|
<methods>
|
|
<method name="get_joint" qualifiers="const">
|
|
<return type="Joint2D" />
|
|
<description>
|
|
Returns the first [Joint2D] child node, if one exists. This is mainly a helper function to make it easier to get the [Joint2D] that the [PhysicalBone2D] is autoconfiguring.
|
|
</description>
|
|
</method>
|
|
<method name="is_simulating_physics" qualifiers="const">
|
|
<return type="bool" />
|
|
<description>
|
|
Returns a boolean that indicates whether the [PhysicalBone2D] is running and simulating using the Godot 2D physics engine. When [code]true[/code], the PhysicalBone2D node is using physics.
|
|
</description>
|
|
</method>
|
|
</methods>
|
|
<members>
|
|
<member name="auto_configure_joint" type="bool" setter="set_auto_configure_joint" getter="get_auto_configure_joint" default="true">
|
|
If [code]true[/code], the [PhysicalBone2D] will automatically configure the first [Joint2D] child node. The automatic configuration is limited to setting up the node properties and positioning the [Joint2D].
|
|
</member>
|
|
<member name="bone2d_index" type="int" setter="set_bone2d_index" getter="get_bone2d_index" default="-1">
|
|
The index of the [Bone2D] that this [PhysicalBone2D] should simulate.
|
|
</member>
|
|
<member name="bone2d_nodepath" type="NodePath" setter="set_bone2d_nodepath" getter="get_bone2d_nodepath" default="NodePath("")">
|
|
The [NodePath] to the [Bone2D] that this [PhysicalBone2D] should simulate.
|
|
</member>
|
|
<member name="follow_bone_when_simulating" type="bool" setter="set_follow_bone_when_simulating" getter="get_follow_bone_when_simulating" default="false">
|
|
If [code]true[/code], the [PhysicalBone2D] will keep the transform of the bone it is bound to when simulating physics.
|
|
</member>
|
|
<member name="simulate_physics" type="bool" setter="set_simulate_physics" getter="get_simulate_physics" default="false">
|
|
If [code]true[/code], the [PhysicalBone2D] will start simulating using physics. If [code]false[/code], the [PhysicalBone2D] will follow the transform of the [Bone2D] node.
|
|
[b]Note:[/b] To have the [Bone2D]s visually follow the [PhysicalBone2D], use a [SkeletonModification2DPhysicalBones] modification on the [Skeleton2D] node with the [Bone2D] nodes.
|
|
</member>
|
|
</members>
|
|
</class>
|