DynamicEntityο
Inherits: Entity < CharacterBody2D < PhysicsBody2D < CollisionObject2D < Node2D < CanvasItem < Node < Object
A variant of Entity with a Mass. This variant can resolve central forces and central impulses.
Propertiesο
|
||
|
Methodsο
void |
_physics_process(delta: float) |
void |
add_constant_central_force(force: Vector2) |
void |
apply_central_force(force: Vector2) |
void |
apply_central_impulse(impulse: Vector2) |
Property Descriptionsο
Mass of the DynamicEntity in kg.
Vector2 constant_force = Vector2(0, 0) π
Constant Forces being applied. Reset this with constant_force = Vector2(0, 0) to remove all constant forces.
Method Descriptionsο
void _physics_process(delta: float) π
There is currently no description for this method. Please help us by contributing one!
void add_constant_central_force(force: Vector2) π
Adds a constant directional force without affecting rotation that keeps being applied over time until cleared with constant_force = Vector2(0, 0).
void apply_central_force(force: Vector2) π
Applies a directional force without affecting rotation. A force is time dependent and meant to be applied every physics update.
void apply_central_impulse(impulse: Vector2) π
Applies a directional impulse without affecting rotation.
An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the β_forceβ functions otherwise).