Skip to content
0.2.0-dev Download ZIP
45 lines ·3.2 KB Raw
1<?xml version="1.0" encoding="UTF-8" ?>
2<class name="PhysicalBone2D" inherits="RigidBody2D" api_type="core" keywords="ragdoll" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
3 <brief_description>
4 A [RigidBody2D]-derived node used to make [Bone2D]s in a [Skeleton2D] react to physics.
5 </brief_description>
6 <description>
7 The [PhysicalBone2D] node is a [RigidBody2D]-based node that can be used to make [Bone2D]s in a [Skeleton2D] react to physics.
8 [b]Note:[/b] To make the [Bone2D]s visually follow the [PhysicalBone2D] node, use a [SkeletonModification2DPhysicalBones] modification on the [Skeleton2D] parent.
9 [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.
10 </description>
11 <tutorials>
12 </tutorials>
13 <methods>
14 <method name="get_joint" qualifiers="const">
15 <return type="Joint2D" />
16 <description>
17 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.
18 </description>
19 </method>
20 <method name="is_simulating_physics" qualifiers="const">
21 <return type="bool" />
22 <description>
23 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.
24 </description>
25 </method>
26 </methods>
27 <members>
28 <member name="auto_configure_joint" type="bool" setter="set_auto_configure_joint" getter="get_auto_configure_joint" default="true">
29 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].
30 </member>
31 <member name="bone2d_index" type="int" setter="set_bone2d_index" getter="get_bone2d_index" default="-1">
32 The index of the [Bone2D] that this [PhysicalBone2D] should simulate.
33 </member>
34 <member name="bone2d_nodepath" type="NodePath" setter="set_bone2d_nodepath" getter="get_bone2d_nodepath" default="NodePath(&quot;&quot;)">
35 The [NodePath] to the [Bone2D] that this [PhysicalBone2D] should simulate.
36 </member>
37 <member name="follow_bone_when_simulating" type="bool" setter="set_follow_bone_when_simulating" getter="get_follow_bone_when_simulating" default="false">
38 If [code]true[/code], the [PhysicalBone2D] will keep the transform of the bone it is bound to when simulating physics.
39 </member>
40 <member name="simulate_physics" type="bool" setter="set_simulate_physics" getter="get_simulate_physics" default="false">
41 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.
42 [b]Note:[/b] To have the [Bone2D]s visually follow the [PhysicalBone2D], use a [SkeletonModification2DPhysicalBones] modification on the [Skeleton2D] node with the [Bone2D] nodes.
43 </member>
44 </members>
45</class>