Package ecs
Class Dynamics
java.lang.Object
ecs.Component
ecs.Dynamics
- All Implemented Interfaces:
Comparable<Component>
The
Dynamics manage movement of a GameObject.- Since:
- 06.12.2021
- Author:
- Juyas
-
Nested Class Summary
Nested classes/interfaces inherited from class ecs.Component
Component.ComponentOrder -
Field Summary
FieldsFields inherited from class ecs.Component
gameObject -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal voidapplyForce(Force force) Applies another force to the physical entity that will be added to the physical entities effective force.final booleanremoveForce(String identifier) Removes all forces matching a given identifier.voidupdate(float dt) Called once per frame for each Componentfinal org.joml.Vector2fvelocity()The current directional velocity of the physical entity.
-
Field Details
-
DEFAULT_FORCE_CAPACITY
public static final int DEFAULT_FORCE_CAPACITY- See Also:
-
-
Constructor Details
-
Dynamics
public Dynamics()
-
-
Method Details
-
velocity
public final org.joml.Vector2f velocity()The current directional velocity of the physical entity.- Returns:
- the current directional velocity
-
applyForce
Applies another force to the physical entity that will be added to the physical entities effective force.- Parameters:
force- a new force effecting this entity
-
removeForce
Removes all forces matching a given identifier. They will no longer effect the force of the entity.- Parameters:
identifier- the identifier to find all matching forces- Returns:
- true if any force got removed
-
update
public void update(float dt) Description copied from class:ComponentCalled once per frame for each Component
-