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 ¶
- type Advanced
- type Any
- type Extension
- type ID
- type Implementation
- type Instance
- func (self Instance) AsObject() [1]gd.Object
- func (self Instance) AsPhysicsDirectBodyState2D() PhysicsDirectBodyState2D.Instance
- func (self Instance) AsPhysicsDirectBodyState2DExtension() Instance
- func (self Instance) ID() ID
- func (self *Instance) SetObject(obj [1]gd.Object) bool
- func (self Instance) Virtual(name string) reflect.Value
- type Interface
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 Extension ¶
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]) AsPhysicsDirectBodyState2D ¶
func (self *Extension[T]) AsPhysicsDirectBodyState2D() PhysicsDirectBodyState2D.Instance
func (*Extension[T]) AsPhysicsDirectBodyState2DExtension ¶
type 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.
type Implementation ¶
type Implementation = implementation
Implementation implements Interface with empty methods.
type Instance ¶
type Instance [1]gdclass.PhysicsDirectBodyState2DExtension
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 (Instance) AsPhysicsDirectBodyState2D ¶
func (self Instance) AsPhysicsDirectBodyState2D() PhysicsDirectBodyState2D.Instance
func (Instance) AsPhysicsDirectBodyState2DExtension ¶
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 }