SoftBody3D

package
v0.0.0-...-535787f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 16, 2025 License: MIT Imports: 29 Imported by: 0

Documentation

Overview

A deformable 3D physics mesh. Used to create elastic or deformable objects such as cloth, rubber, or other flexible materials.

Additionally, graphics.gd/classdb/SoftBody3D is subject to wind forces defined in graphics.gd/classdb/Area3D (see graphics.gd/classdb/Area3D.Instance.WindSourcePath, graphics.gd/classdb/Area3D.Instance.WindForceMagnitude, and graphics.gd/classdb/Area3D.Instance.WindAttenuationFactor).

Note: It's recommended to use Jolt Physics when using graphics.gd/classdb/SoftBody3D instead of the default GodotPhysics3D, as Jolt Physics' soft body implementation is faster and more reliable. You can switch the physics engine using the graphics.gd/classdb/ProjectSettings "physics/3d/physics_engine" project setting.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Advanced

type Advanced = class

Advanced exposes a 1:1 low-level instance of the class, undocumented, for those who know what they are doing.

type Any

type Any interface {
	gd.IsClass
	AsSoftBody3D() Instance
}

type DisableMode

type DisableMode int //gd:SoftBody3D.DisableMode
const (
	// When [graphics.gd/classdb/Node.Instance.ProcessMode] is set to [Node.ProcessModeDisabled], remove from the physics simulation to stop all physics interactions with this [graphics.gd/classdb/SoftBody3D].
	//
	// Automatically re-added to the physics simulation when the [graphics.gd/classdb/Node] is processed again.
	DisableModeRemove DisableMode = 0
	// When [graphics.gd/classdb/Node.Instance.ProcessMode] is set to [Node.ProcessModeDisabled], do not affect the physics simulation.
	DisableModeKeepActive DisableMode = 1
)

type Expanded

type Expanded [1]gdclass.SoftBody3D

func (Expanded) SetPointPinned

func (self Expanded) SetPointPinned(point_index int, pinned bool, attachment_path string, insert_at int)

Sets the pinned state of a surface vertex. When set to true, the optional 'attachment_path' can define a graphics.gd/classdb/Node3D the pinned vertex will be attached to.

type Extension

type Extension[T gdclass.Interface] struct{ gdclass.Extension[T, Instance] }

Extension can be embedded in a new struct to create an extension of this class. T should be the type that is embedding this Extension

func (*Extension[T]) AsGeometryInstance3D

func (self *Extension[T]) AsGeometryInstance3D() GeometryInstance3D.Instance

func (*Extension[T]) AsMeshInstance3D

func (self *Extension[T]) AsMeshInstance3D() MeshInstance3D.Instance

func (*Extension[T]) AsNode

func (self *Extension[T]) AsNode() Node.Instance

func (*Extension[T]) AsNode3D

func (self *Extension[T]) AsNode3D() Node3D.Instance

func (*Extension[T]) AsObject

func (self *Extension[T]) AsObject() [1]gd.Object

func (*Extension[T]) AsSoftBody3D

func (self *Extension[T]) AsSoftBody3D() Instance

func (*Extension[T]) AsVisualInstance3D

func (self *Extension[T]) AsVisualInstance3D() VisualInstance3D.Instance

type ID

type ID Object.ID

ID is a typed object ID (reference) to an instance of this class, use it to store references to objects with unknown lifetimes, as an ID will not panic on use if the underlying object has been destroyed.

func (ID) Instance

func (id ID) Instance() (Instance, bool)

type Instance

type Instance [1]gdclass.SoftBody3D

Instance of the class with convieniently typed arguments and results.

var Nil Instance

Nil is a nil/null instance of the class. Equivalent to the zero value.

func New

func New() Instance

func (Instance) AddCollisionExceptionWith

func (self Instance) AddCollisionExceptionWith(body Node.Instance)

Adds a body to the list of bodies that this body can't collide with.

func (Instance) ApplyCentralForce

func (self Instance) ApplyCentralForce(force Vector3.XYZ)

Distributes and applies a force to all points. A force is time dependent and meant to be applied every physics update.

func (Instance) ApplyCentralImpulse

func (self Instance) ApplyCentralImpulse(impulse Vector3.XYZ)

Distributes and applies an impulse to all points.

An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "_force" functions otherwise).

func (Instance) ApplyForce

func (self Instance) ApplyForce(point_index int, force Vector3.XYZ)

Applies a force to a point. A force is time dependent and meant to be applied every physics update.

func (Instance) ApplyImpulse

func (self Instance) ApplyImpulse(point_index int, impulse Vector3.XYZ)

Applies an impulse to a point.

An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "_force" functions otherwise).

func (Instance) AsGeometryInstance3D

func (self Instance) AsGeometryInstance3D() GeometryInstance3D.Instance

func (Instance) AsMeshInstance3D

func (self Instance) AsMeshInstance3D() MeshInstance3D.Instance

func (Instance) AsNode

func (self Instance) AsNode() Node.Instance

func (Instance) AsNode3D

func (self Instance) AsNode3D() Node3D.Instance

func (Instance) AsObject

func (self Instance) AsObject() [1]gd.Object

func (Instance) AsSoftBody3D

func (self Instance) AsSoftBody3D() Instance

func (Instance) AsVisualInstance3D

func (self Instance) AsVisualInstance3D() VisualInstance3D.Instance

func (Instance) CollisionLayer

func (self Instance) CollisionLayer() int

func (Instance) CollisionMask

func (self Instance) CollisionMask() int

func (Instance) DampingCoefficient

func (self Instance) DampingCoefficient() Float.X

func (Instance) DisableMode

func (self Instance) DisableMode() DisableMode

func (Instance) DragCoefficient

func (self Instance) DragCoefficient() Float.X

func (Instance) GetCollisionExceptions

func (self Instance) GetCollisionExceptions() []PhysicsBody3D.Instance

Returns an array of nodes that were added as collision exceptions for this body.

func (Instance) GetCollisionLayerValue

func (self Instance) GetCollisionLayerValue(layer_number int) bool

Returns whether or not the specified layer of the Instance.CollisionLayer is enabled, given a 'layer_number' between 1 and 32.

func (Instance) GetCollisionMaskValue

func (self Instance) GetCollisionMaskValue(layer_number int) bool

Returns whether or not the specified layer of the Instance.CollisionMask is enabled, given a 'layer_number' between 1 and 32.

func (Instance) GetPhysicsRid

func (self Instance) GetPhysicsRid() RID.SoftBody3D

Returns the internal [Resource.ID] used by the graphics.gd/classdb/PhysicsServer3D for this body.

func (Instance) GetPointTransform

func (self Instance) GetPointTransform(point_index int) Vector3.XYZ

Returns local translation of a vertex in the surface array.

func (Instance) ID

func (self Instance) ID() ID

func (Instance) IsPointPinned

func (self Instance) IsPointPinned(point_index int) bool

Returns true if vertex is set to pinned.

func (Instance) LinearStiffness

func (self Instance) LinearStiffness() Float.X

func (Instance) ParentCollisionIgnore

func (self Instance) ParentCollisionIgnore() string

func (Instance) PressureCoefficient

func (self Instance) PressureCoefficient() Float.X

func (Instance) RayPickable

func (self Instance) RayPickable() bool

func (Instance) RemoveCollisionExceptionWith

func (self Instance) RemoveCollisionExceptionWith(body Node.Instance)

Removes a body from the list of bodies that this body can't collide with.

func (Instance) SetCollisionLayer

func (self Instance) SetCollisionLayer(value int)

func (Instance) SetCollisionLayerValue

func (self Instance) SetCollisionLayerValue(layer_number int, value bool)

Based on 'value', enables or disables the specified layer in the Instance.CollisionLayer, given a 'layer_number' between 1 and 32.

func (Instance) SetCollisionMask

func (self Instance) SetCollisionMask(value int)

func (Instance) SetCollisionMaskValue

func (self Instance) SetCollisionMaskValue(layer_number int, value bool)

Based on 'value', enables or disables the specified layer in the Instance.CollisionMask, given a 'layer_number' between 1 and 32.

func (Instance) SetDampingCoefficient

func (self Instance) SetDampingCoefficient(value Float.X)

func (Instance) SetDisableMode

func (self Instance) SetDisableMode(value DisableMode)

func (Instance) SetDragCoefficient

func (self Instance) SetDragCoefficient(value Float.X)

func (Instance) SetLinearStiffness

func (self Instance) SetLinearStiffness(value Float.X)

func (*Instance) SetObject

func (self *Instance) SetObject(obj [1]gd.Object) bool

func (Instance) SetParentCollisionIgnore

func (self Instance) SetParentCollisionIgnore(value string)

func (Instance) SetPointPinned

func (self Instance) SetPointPinned(point_index int, pinned bool)

Sets the pinned state of a surface vertex. When set to true, the optional 'attachment_path' can define a graphics.gd/classdb/Node3D the pinned vertex will be attached to.

func (Instance) SetPressureCoefficient

func (self Instance) SetPressureCoefficient(value Float.X)

func (Instance) SetRayPickable

func (self Instance) SetRayPickable(value bool)

func (Instance) SetShrinkingFactor

func (self Instance) SetShrinkingFactor(value Float.X)

func (Instance) SetSimulationPrecision

func (self Instance) SetSimulationPrecision(value int)

func (Instance) SetTotalMass

func (self Instance) SetTotalMass(value Float.X)

func (Instance) ShrinkingFactor

func (self Instance) ShrinkingFactor() Float.X

func (Instance) SimulationPrecision

func (self Instance) SimulationPrecision() int

func (Instance) TotalMass

func (self Instance) TotalMass() Float.X

func (Instance) Virtual

func (self Instance) Virtual(name string) reflect.Value

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL