SoftBodyComponent¶
SoftBodyComponent ¶
acceleration
property
¶
acceleration: Vector3
Current acceleration of the center point mass (gravity + accumulated forces)
damping
property
writable
¶
damping: float
Damping applied to internal springs, reducing jiggle/oscillation
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)
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_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_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
set_damping ¶
set_damping(damping: SupportsFloat | SupportsIndex) -> None
Set damping. See the damping property.
set_gas_amount ¶
set_gas_amount(gas_amount: SupportsFloat | SupportsIndex) -> None
Set gas_amount. See the gas_amount property.
set_inverse_mass ¶
set_inverse_mass(inverse_mass: SupportsFloat | SupportsIndex) -> None
Set inverse_mass. See the inverse_mass property.
set_stiffness ¶
set_stiffness(stiffness: SupportsFloat | SupportsIndex) -> None
Set stiffness. See the stiffness 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)
inverse_mass
property
writable
¶
inverse_mass: float
1/mass of this individual point mass. Set to 0 to pin it in place.
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().
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_point_radius ¶
set_point_radius(point_radius: SupportsFloat | SupportsIndex) -> None
Set point_radius. See the point_radius property.
update_world_position ¶
update_world_position(position: Vector3) -> None
Move this point mass to a new world position immediately (bypasses springs)