SoftBody3D

package
v0.0.0-...-503a9e4 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 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: There are many known bugs in graphics.gd/classdb/SoftBody3D. Therefore, it's not recommended to use them for things that can affect gameplay (such as trampolines).

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) 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) SetSimulationPrecision

func (self Instance) SetSimulationPrecision(value int)

func (Instance) SetTotalMass

func (self Instance) SetTotalMass(value 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