PhysicalBone2D
A RigidBody2D
-derived node used to make Bone2D
s in a Skeleton2D
react to physics.
class PhysicalBone2D
The PhysicalBone2D
node is a RigidBody2D
-based node that can be used to make Bone2D
s in a Skeleton2D
react to physics.
Superclasses
class RigidBody2D
A 2D physics body that is moved by a physics simulation.
Citizens in SwiftGodot
Conformances
protocol CustomStringConvertible
A type with a customized textual representation.
protocol Equatable
A type that can be compared for value equality.
protocol Hashable
A type that can be hashed into a
Hasher
to produce an integer hash value.protocol Identifiable<ID>
A class of types whose instances hold the value of an entity with stable identity.
protocol VariantRepresentable
Types that conform to VariantRepresentable can be stored directly in
Variant
with no conversion. These include all of the Variant types from Godot (for exampleGString
,Rect
,Plane
), Godot objects (those that subclass SwiftGodot.Object) as well as the built-in Swift types UInt8, Int64 and Double.protocol VariantStorable
Types that conform to VariantStorable can be stored in a Variant and can be extracted back out of a Variant.
Type members
Instance members
var autoConfigureJoint: Bool
If
true
, thePhysicalBone2D
will automatically configure the firstJoint2D
child node. The automatic configuration is limited to setting up the node properties and positioning theJoint2D
.var bone2dIndex: Int32
The index of the
Bone2D
that thisPhysicalBone2D
should simulate.var bone2dNodepath: NodePath
The
NodePath
to theBone2D
that thisPhysicalBone2D
should simulate.var followBoneWhenSimulating: Bool
If
true
, thePhysicalBone2D
will keep the transform of the bone it is bound to when simulating physics.var simulatePhysics: Bool
If
true
, thePhysicalBone2D
will start simulating using physics. Iffalse
, thePhysicalBone2D
will follow the transform of theBone2D
node.func getJoint(
) -> Joint2D? Returns the first
Joint2D
child node, if one exists. This is mainly a helper function to make it easier to get theJoint2D
that thePhysicalBone2D
is autoconfiguring.func isSimulatingPhysics(
) -> Bool Returns a boolean that indicates whether the
PhysicalBone2D
is running and simulating using the Godot 2D physics engine. Whentrue
, the PhysicalBone2D node is using physics.