PhysicsDirectBodyState2DExtension

package
v0.0.0-...-e10d1cd Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2025 License: MIT Imports: 26 Imported by: 0

Documentation

Overview

This class extends PhysicsDirectBodyState2D by providing additional virtual methods that can be overridden. When these methods are overridden, they will be called instead of the internal methods of the physics server.

Intended for use with GDExtension to create custom implementations of PhysicsDirectBodyState2D.

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
	AsPhysicsDirectBodyState2DExtension() Instance
}

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]See Interface for methods that can be overridden by T.

func (*Extension[T]) AsObject

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

func (*Extension[T]) AsPhysicsDirectBodyState2D

func (self *Extension[T]) AsPhysicsDirectBodyState2D() PhysicsDirectBodyState2D.Instance

func (*Extension[T]) AsPhysicsDirectBodyState2DExtension

func (self *Extension[T]) AsPhysicsDirectBodyState2DExtension() 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 Implementation

type Implementation = implementation

Implementation implements Interface with empty methods.

type Instance

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

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

func (Instance) AsPhysicsDirectBodyState2D

func (self Instance) AsPhysicsDirectBodyState2D() PhysicsDirectBodyState2D.Instance

func (Instance) AsPhysicsDirectBodyState2DExtension

func (self Instance) AsPhysicsDirectBodyState2DExtension() Instance

func (Instance) ID

func (self Instance) ID() ID

func (*Instance) SetObject

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

func (Instance) Virtual

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

type Interface

type Interface interface {
	// Implement to override the behavior of [PhysicsDirectBodyState2D.TotalGravity] and its respective getter.
	//
	// [PhysicsDirectBodyState2D.TotalGravity]: https://pkg.go.dev/graphics.gd/classdb/PhysicsDirectBodyState2D#Instance.TotalGravity
	GetTotalGravity() Vector2.XY
	// Implement to override the behavior of [PhysicsDirectBodyState2D.TotalLinearDamp] and its respective getter.
	//
	// [PhysicsDirectBodyState2D.TotalLinearDamp]: https://pkg.go.dev/graphics.gd/classdb/PhysicsDirectBodyState2D#Instance.TotalLinearDamp
	GetTotalLinearDamp() Float.X
	// Implement to override the behavior of [PhysicsDirectBodyState2D.TotalAngularDamp] and its respective getter.
	//
	// [PhysicsDirectBodyState2D.TotalAngularDamp]: https://pkg.go.dev/graphics.gd/classdb/PhysicsDirectBodyState2D#Instance.TotalAngularDamp
	GetTotalAngularDamp() Float.X
	// Implement to override the behavior of [PhysicsDirectBodyState2D.CenterOfMass] and its respective getter.
	//
	// [PhysicsDirectBodyState2D.CenterOfMass]: https://pkg.go.dev/graphics.gd/classdb/PhysicsDirectBodyState2D#Instance.CenterOfMass
	GetCenterOfMass() Vector2.XY
	// Implement to override the behavior of [PhysicsDirectBodyState2D.CenterOfMassLocal] and its respective getter.
	//
	// [PhysicsDirectBodyState2D.CenterOfMassLocal]: https://pkg.go.dev/graphics.gd/classdb/PhysicsDirectBodyState2D#Instance.CenterOfMassLocal
	GetCenterOfMassLocal() Vector2.XY
	// Implement to override the behavior of [PhysicsDirectBodyState2D.InverseMass] and its respective getter.
	//
	// [PhysicsDirectBodyState2D.InverseMass]: https://pkg.go.dev/graphics.gd/classdb/PhysicsDirectBodyState2D#Instance.InverseMass
	GetInverseMass() Float.X
	// Implement to override the behavior of [PhysicsDirectBodyState2D.InverseInertia] and its respective getter.
	//
	// [PhysicsDirectBodyState2D.InverseInertia]: https://pkg.go.dev/graphics.gd/classdb/PhysicsDirectBodyState2D#Instance.InverseInertia
	GetInverseInertia() Float.X
	// Implement to override the behavior of [PhysicsDirectBodyState2D.LinearVelocity] and its respective setter.
	//
	// [PhysicsDirectBodyState2D.LinearVelocity]: https://pkg.go.dev/graphics.gd/classdb/PhysicsDirectBodyState2D#Instance.LinearVelocity
	SetLinearVelocity(velocity Vector2.XY)
	// Implement to override the behavior of [PhysicsDirectBodyState2D.LinearVelocity] and its respective getter.
	//
	// [PhysicsDirectBodyState2D.LinearVelocity]: https://pkg.go.dev/graphics.gd/classdb/PhysicsDirectBodyState2D#Instance.LinearVelocity
	GetLinearVelocity() Vector2.XY
	// Implement to override the behavior of [PhysicsDirectBodyState2D.AngularVelocity] and its respective setter.
	//
	// [PhysicsDirectBodyState2D.AngularVelocity]: https://pkg.go.dev/graphics.gd/classdb/PhysicsDirectBodyState2D#Instance.AngularVelocity
	SetAngularVelocity(velocity Float.X)
	// Implement to override the behavior of [PhysicsDirectBodyState2D.AngularVelocity] and its respective getter.
	//
	// [PhysicsDirectBodyState2D.AngularVelocity]: https://pkg.go.dev/graphics.gd/classdb/PhysicsDirectBodyState2D#Instance.AngularVelocity
	GetAngularVelocity() Float.X
	// Implement to override the behavior of [PhysicsDirectBodyState2D.Transform] and its respective setter.
	//
	// [PhysicsDirectBodyState2D.Transform]: https://pkg.go.dev/graphics.gd/classdb/PhysicsDirectBodyState2D#Instance.Transform
	SetTransform(transform Transform2D.OriginXY)
	// Implement to override the behavior of [PhysicsDirectBodyState2D.Transform] and its respective getter.
	//
	// [PhysicsDirectBodyState2D.Transform]: https://pkg.go.dev/graphics.gd/classdb/PhysicsDirectBodyState2D#Instance.Transform
	GetTransform() Transform2D.OriginXY
	// Overridable version of [PhysicsDirectBodyState2D.GetVelocityAtLocalPosition].
	//
	// [PhysicsDirectBodyState2D.GetVelocityAtLocalPosition]: https://pkg.go.dev/graphics.gd/classdb/PhysicsDirectBodyState2D#Instance.GetVelocityAtLocalPosition
	GetVelocityAtLocalPosition(local_position Vector2.XY) Vector2.XY
	// Overridable version of [PhysicsDirectBodyState2D.ApplyCentralImpulse].
	//
	// [PhysicsDirectBodyState2D.ApplyCentralImpulse]: https://pkg.go.dev/graphics.gd/classdb/PhysicsDirectBodyState2D#Instance.ApplyCentralImpulse
	ApplyCentralImpulse(impulse Vector2.XY)
	// Overridable version of [PhysicsDirectBodyState2D.ApplyImpulse].
	//
	// [PhysicsDirectBodyState2D.ApplyImpulse]: https://pkg.go.dev/graphics.gd/classdb/PhysicsDirectBodyState2D#Instance.ApplyImpulse
	ApplyImpulse(impulse Vector2.XY, position Vector2.XY)
	// Overridable version of [PhysicsDirectBodyState2D.ApplyTorqueImpulse].
	//
	// [PhysicsDirectBodyState2D.ApplyTorqueImpulse]: https://pkg.go.dev/graphics.gd/classdb/PhysicsDirectBodyState2D#Instance.ApplyTorqueImpulse
	ApplyTorqueImpulse(impulse Float.X)
	// Overridable version of [PhysicsDirectBodyState2D.ApplyCentralForce].
	//
	// [PhysicsDirectBodyState2D.ApplyCentralForce]: https://pkg.go.dev/graphics.gd/classdb/PhysicsDirectBodyState2D#Instance.ApplyCentralForce
	ApplyCentralForce(force Vector2.XY)
	// Overridable version of [PhysicsDirectBodyState2D.ApplyForce].
	//
	// [PhysicsDirectBodyState2D.ApplyForce]: https://pkg.go.dev/graphics.gd/classdb/PhysicsDirectBodyState2D#Instance.ApplyForce
	ApplyForce(force Vector2.XY, position Vector2.XY)
	// Overridable version of [PhysicsDirectBodyState2D.ApplyTorque].
	//
	// [PhysicsDirectBodyState2D.ApplyTorque]: https://pkg.go.dev/graphics.gd/classdb/PhysicsDirectBodyState2D#Instance.ApplyTorque
	ApplyTorque(torque Float.X)
	// Overridable version of [PhysicsDirectBodyState2D.AddConstantCentralForce].
	//
	// [PhysicsDirectBodyState2D.AddConstantCentralForce]: https://pkg.go.dev/graphics.gd/classdb/PhysicsDirectBodyState2D#Instance.AddConstantCentralForce
	AddConstantCentralForce(force Vector2.XY)
	// Overridable version of [PhysicsDirectBodyState2D.AddConstantForce].
	//
	// [PhysicsDirectBodyState2D.AddConstantForce]: https://pkg.go.dev/graphics.gd/classdb/PhysicsDirectBodyState2D#Instance.AddConstantForce
	AddConstantForce(force Vector2.XY, position Vector2.XY)
	// Overridable version of [PhysicsDirectBodyState2D.AddConstantTorque].
	//
	// [PhysicsDirectBodyState2D.AddConstantTorque]: https://pkg.go.dev/graphics.gd/classdb/PhysicsDirectBodyState2D#Instance.AddConstantTorque
	AddConstantTorque(torque Float.X)
	// Overridable version of [PhysicsDirectBodyState2D.SetConstantForce].
	//
	// [PhysicsDirectBodyState2D.SetConstantForce]: https://pkg.go.dev/graphics.gd/classdb/PhysicsDirectBodyState2D#Instance.SetConstantForce
	SetConstantForce(force Vector2.XY)
	// Overridable version of [PhysicsDirectBodyState2D.GetConstantForce].
	//
	// [PhysicsDirectBodyState2D.GetConstantForce]: https://pkg.go.dev/graphics.gd/classdb/PhysicsDirectBodyState2D#Instance.GetConstantForce
	GetConstantForce() Vector2.XY
	// Overridable version of [PhysicsDirectBodyState2D.SetConstantTorque].
	//
	// [PhysicsDirectBodyState2D.SetConstantTorque]: https://pkg.go.dev/graphics.gd/classdb/PhysicsDirectBodyState2D#Instance.SetConstantTorque
	SetConstantTorque(torque Float.X)
	// Overridable version of [PhysicsDirectBodyState2D.GetConstantTorque].
	//
	// [PhysicsDirectBodyState2D.GetConstantTorque]: https://pkg.go.dev/graphics.gd/classdb/PhysicsDirectBodyState2D#Instance.GetConstantTorque
	GetConstantTorque() Float.X
	// Implement to override the behavior of [PhysicsDirectBodyState2D.Sleeping] and its respective setter.
	//
	// [PhysicsDirectBodyState2D.Sleeping]: https://pkg.go.dev/graphics.gd/classdb/PhysicsDirectBodyState2D#Instance.Sleeping
	SetSleepState(enabled bool)
	// Implement to override the behavior of [PhysicsDirectBodyState2D.Sleeping] and its respective getter.
	//
	// [PhysicsDirectBodyState2D.Sleeping]: https://pkg.go.dev/graphics.gd/classdb/PhysicsDirectBodyState2D#Instance.Sleeping
	IsSleeping() bool
	SetCollisionLayer(layer int)
	GetCollisionLayer() int
	SetCollisionMask(mask int)
	GetCollisionMask() int
	// Overridable version of [PhysicsDirectBodyState2D.GetContactCount].
	//
	// [PhysicsDirectBodyState2D.GetContactCount]: https://pkg.go.dev/graphics.gd/classdb/PhysicsDirectBodyState2D#Instance.GetContactCount
	GetContactCount() int
	// Overridable version of [PhysicsDirectBodyState2D.GetContactLocalPosition].
	//
	// [PhysicsDirectBodyState2D.GetContactLocalPosition]: https://pkg.go.dev/graphics.gd/classdb/PhysicsDirectBodyState2D#Instance.GetContactLocalPosition
	GetContactLocalPosition(contact_idx int) Vector2.XY
	// Overridable version of [PhysicsDirectBodyState2D.GetContactLocalNormal].
	//
	// [PhysicsDirectBodyState2D.GetContactLocalNormal]: https://pkg.go.dev/graphics.gd/classdb/PhysicsDirectBodyState2D#Instance.GetContactLocalNormal
	GetContactLocalNormal(contact_idx int) Vector2.XY
	// Overridable version of [PhysicsDirectBodyState2D.GetContactLocalShape].
	//
	// [PhysicsDirectBodyState2D.GetContactLocalShape]: https://pkg.go.dev/graphics.gd/classdb/PhysicsDirectBodyState2D#Instance.GetContactLocalShape
	GetContactLocalShape(contact_idx int) int
	// Overridable version of [PhysicsDirectBodyState2D.GetContactLocalVelocityAtPosition].
	//
	// [PhysicsDirectBodyState2D.GetContactLocalVelocityAtPosition]: https://pkg.go.dev/graphics.gd/classdb/PhysicsDirectBodyState2D#Instance.GetContactLocalVelocityAtPosition
	GetContactLocalVelocityAtPosition(contact_idx int) Vector2.XY
	// Overridable version of [PhysicsDirectBodyState2D.GetContactCollider].
	//
	// [PhysicsDirectBodyState2D.GetContactCollider]: https://pkg.go.dev/graphics.gd/classdb/PhysicsDirectBodyState2D#Instance.GetContactCollider
	GetContactCollider(contact_idx int) RID.Body2D
	// Overridable version of [PhysicsDirectBodyState2D.GetContactColliderPosition].
	//
	// [PhysicsDirectBodyState2D.GetContactColliderPosition]: https://pkg.go.dev/graphics.gd/classdb/PhysicsDirectBodyState2D#Instance.GetContactColliderPosition
	GetContactColliderPosition(contact_idx int) Vector2.XY
	// Overridable version of [PhysicsDirectBodyState2D.GetContactColliderId].
	//
	// [PhysicsDirectBodyState2D.GetContactColliderId]: https://pkg.go.dev/graphics.gd/classdb/PhysicsDirectBodyState2D#Instance.GetContactColliderId
	GetContactColliderId(contact_idx int) int
	// Overridable version of [PhysicsDirectBodyState2D.GetContactColliderObject].
	//
	// [PhysicsDirectBodyState2D.GetContactColliderObject]: https://pkg.go.dev/graphics.gd/classdb/PhysicsDirectBodyState2D#Instance.GetContactColliderObject
	GetContactColliderObject(contact_idx int) Object.Instance
	// Overridable version of [PhysicsDirectBodyState2D.GetContactColliderShape].
	//
	// [PhysicsDirectBodyState2D.GetContactColliderShape]: https://pkg.go.dev/graphics.gd/classdb/PhysicsDirectBodyState2D#Instance.GetContactColliderShape
	GetContactColliderShape(contact_idx int) int
	// Overridable version of [PhysicsDirectBodyState2D.GetContactColliderVelocityAtPosition].
	//
	// [PhysicsDirectBodyState2D.GetContactColliderVelocityAtPosition]: https://pkg.go.dev/graphics.gd/classdb/PhysicsDirectBodyState2D#Instance.GetContactColliderVelocityAtPosition
	GetContactColliderVelocityAtPosition(contact_idx int) Vector2.XY
	// Overridable version of [PhysicsDirectBodyState2D.GetContactImpulse].
	//
	// [PhysicsDirectBodyState2D.GetContactImpulse]: https://pkg.go.dev/graphics.gd/classdb/PhysicsDirectBodyState2D#Instance.GetContactImpulse
	GetContactImpulse(contact_idx int) Vector2.XY
	// Implement to override the behavior of [PhysicsDirectBodyState2D.Step] and its respective getter.
	//
	// [PhysicsDirectBodyState2D.Step]: https://pkg.go.dev/graphics.gd/classdb/PhysicsDirectBodyState2D#Instance.Step
	GetStep() Float.X
	// Overridable version of [PhysicsDirectBodyState2D.IntegrateForces].
	//
	// [PhysicsDirectBodyState2D.IntegrateForces]: https://pkg.go.dev/graphics.gd/classdb/PhysicsDirectBodyState2D#Instance.IntegrateForces
	IntegrateForces()
	// Overridable version of [PhysicsDirectBodyState2D.GetSpaceState].
	//
	// [PhysicsDirectBodyState2D.GetSpaceState]: https://pkg.go.dev/graphics.gd/classdb/PhysicsDirectBodyState2D#Instance.GetSpaceState
	GetSpaceState() PhysicsDirectSpaceState2D.Instance
}

Jump to

Keyboard shortcuts

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