PhysicsDirectBodyState2DExtension

package
v0.0.0-...-e1beaa7 Latest Latest
Warning

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

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

Documentation

Overview

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