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 ¶
- 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 [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 }