Skip to content

SoftBodyComponent

SoftBodyComponent

acceleration property

acceleration: Vector3

Current acceleration of the center point mass (gravity + accumulated forces)

center_point_mass property

center_point_mass: PointMass

The center point mass of this soft body

damping property writable

damping: float

Damping applied to internal springs, reducing jiggle/oscillation

enable property writable

enable: bool

Whether this component is active

gas_amount property writable

gas_amount: float

Amount of internal gas pressure applied when gas_pressure_enabled is True. Higher values push outward more strongly.

gas_pressure_enabled property writable

gas_pressure_enabled: bool

Enable gas pressure mode, which pushes the body's outline outward to maintain internal volume (balloon-like)

inverse_mass property writable

inverse_mass: float

1/mass for the whole soft body. Setting this redistributes evenly across every point mass, same as the mass property.

mass property writable

mass: float

Total mass of the soft body. Values <= 0 are ignored. Setting this redistributes mass evenly across every point mass.

mass_aggregate property

mass_aggregate: list[PointMass]

All point masses in this soft body, in order (the last one is always the center)

owner property

owner: Object

The Object that owns this component

point_mass_count property

point_mass_count: int

Number of point masses making up this soft body, including the center point mass

stiffness property writable

stiffness: float

How strongly internal springs resist deformation. Higher values make the body feel more rigid.

velocity property writable

velocity: Vector3

Bulk velocity applied to the soft body's center point mass

add_child

add_child(obj: Object) -> Object

Add obj as a child of this component's owning Object

add_component

add_component(component_class: Any) -> typing.Any

Attach a new component of the given type to this component's owning Object.

Example
render = self.add_component(RenderComponent)

add_force

add_force(force: Vector3) -> None

Apply a uniform force across every point mass in the soft body

add_force_at_center

add_force_at_center(force: Vector3) -> None

Apply a force to the center point mass only

add_force_at_local_point

add_force_at_local_point(force: Vector3, point: Vector3) -> None

Apply a force distributed across the point masses nearest the given local/model-space point

add_force_at_world_point

add_force_at_world_point(force: Vector3, point: Vector3) -> None

Apply a force distributed across the point masses nearest the given world-space point

add_object

add_object(obj: Object, parent: Object = None) -> Object

Add a newly created Object to the scene, optionally parented to another Object

add_point_mass

add_point_mass(local_point: Vector3) -> None

Add a new point mass at the given local/model position

get_component

get_component(component_class: Any) -> typing.Any

Look up a component on this Object

get_owner

get_owner() -> Object

The Object that owns this component

get_point_mass

get_point_mass(index: SupportsInt | SupportsIndex) -> PointMass

Get a point mass by index. Index (size - 1) is always the center point mass.

has_component

has_component(component_class: Any) -> bool

Check whether this component's owning Object has a component of the given type

remove_component

remove_component(component_class: Any) -> None

Remove a component of the given type from this component's owning Object

remove_object

remove_object(obj: Object) -> None

Remove an object from the scene

set_damping

set_damping(damping: SupportsFloat | SupportsIndex) -> None

Set damping. See the damping property.

set_enable

set_enable(arg0: bool) -> None

Set enable. See the enable property.

set_gas_amount

set_gas_amount(gas_amount: SupportsFloat | SupportsIndex) -> None

Set gas_amount. See the gas_amount property.

set_gas_pressure_enabled

set_gas_pressure_enabled(enabled: bool) -> None

Enable gas pressue mode

set_inverse_mass

set_inverse_mass(inverse_mass: SupportsFloat | SupportsIndex) -> None

Set inverse_mass. See the inverse_mass property.

set_mass

set_mass(mass: SupportsFloat | SupportsIndex) -> None

Set mass. See the mass property.

set_stiffness

set_stiffness(stiffness: SupportsFloat | SupportsIndex) -> None

Set stiffness. See the stiffness property.

set_velocity

set_velocity(velocity: Vector3) -> None

Set velocity. See the velocity property.

PointMass

A single mass point within a SoftBodyComponent's mass-spring aggregate.

acceleration property

acceleration: Vector3

Total acceleration this frame (gravity/base + accumulated forces)

base_acceleration property writable

base_acceleration: Vector3

Persistent acceleration such as gravity.

Example
Vector3(0, -9.8, 0)

index property

index: int

Index of this point mass within its SoftBodyComponent.mass_aggregate

inverse_mass property writable

inverse_mass: float

1/mass of this individual point mass. Set to 0 to pin it in place.

is_center property

is_center: bool

Whether this is the soft body's center point mass

local_pos property

local_pos: Vector3

Rest position in the parent object's local/model space

mass property writable

mass: float

Mass of this individual point mass. Values <= 0 are ignored.

point_radius property writable

point_radius: float

Collision radius of this individual point mass

soft_body property

soft_body: SoftBodyComponent

The SoftBodyComponent this point mass belongs to

velocity property writable

velocity: Vector3

Linear velocity of this individual point mass

world_pos property writable

world_pos: Vector3

Current world-space position of this point mass. Setting this teleports it immediately, bypassing springs — same as update_world_position().

__repr__

__repr__() -> str

get_world_position

get_world_position() -> Vector3

Get world_pos. See the world_pos property.

set_base_acceleration

set_base_acceleration(base_acceleration: Vector3) -> None

Set base_acceleration. See the base_acceleration property.

set_inverse_mass

set_inverse_mass(inverse_mass: SupportsFloat | SupportsIndex) -> None

Set inverse_mass. See the inverse_mass property.

set_mass

set_mass(mass: SupportsFloat | SupportsIndex) -> None

Set mass. See the mass property.

set_point_radius

set_point_radius(point_radius: SupportsFloat | SupportsIndex) -> None

Set point_radius. See the point_radius property.

set_velocity

set_velocity(velocity: Vector3) -> None

Set velocity. See the velocity property.

update_world_position

update_world_position(position: Vector3) -> None

Move this point mass to a new world position immediately (bypasses springs)