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
Fields inherited from class ecs.Component
gameObject
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal void
applyForce
(Force force) Applies another force to the physical entity that will be added to the physical entities effective force.final boolean
removeForce
(String identifier) Removes all forces matching a given identifier.void
update
(float dt) Called once per frame for each Componentfinal org.joml.Vector2f
velocity()
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:Component
Called once per frame for each Component
-