Skip to main content

Helper classes

The node is split into a few small classes. You normally only touch SoftBody2D; these are here for scripts that want more.

SoftBody2DPhysics

Static wrapper around the extra APIs of Godot Rapier Physics, called through ClassDB.class_call_static so there is no hard dependency on the extension. Every call is a no-op (returns zero) without Rapier.

MethodDescription
has_rapier() -> boolRapier is installed and selected as the 2D physics engine. Cached.
joint_reaction_impulse(joint: Joint2D) -> Vector2Linear impulse the joint applied last step; divide by the step delta for a force.
joint_reaction_angular_impulse(joint: Joint2D) -> floatAngular impulse the joint applied last step.
joint_set_softness(joint, natural_frequency, damping_ratio)Make a joint compliant.
joint_set_enabled(joint, enabled)Enable or disable a joint without freeing it.
body_max_contact_impulse(body: PhysicsBody2D) -> floatStrongest contact impulse on a body last step.
body_set_extra_param(body, param: BodyParam, value)CONTACT_SKIN, DOMINANCE, SOFT_CCD, MASSLESS, ADDITIONAL_SOLVER_ITERATIONS.

SoftBody2DRigidBody

Extend your rigidbody_scene root from this to get signal rigidbody_created(collision_shape: CollisionShape2D, is_center: bool) when the softbody builds it.

Voronoi2D

The region grid generator, also usable as a standalone node that draws its regions: set size, type and distance_between_points, then click Bake.