Package physics.force
Class IncrementalForce
java.lang.Object
physics.force.IncrementalForce
- All Implemented Interfaces:
Force
- Since:
- 07.12.2021
- Author:
- Juyas
-
Constructor Summary
ConstructorDescriptionIncrementalForce
(String identifier, org.joml.Vector2f direction, float increment, float limit) -
Method Summary
-
Constructor Details
-
IncrementalForce
public IncrementalForce(String identifier, org.joml.Vector2f direction, float increment, float limit)
-
-
Method Details
-
identifier
Description copied from interface:Force
A unique identifier for this force, can be used as name as well.- Specified by:
identifier
in interfaceForce
- Returns:
- the unique identifier
-
update
public boolean update(float dt) Description copied from interface:Force
Called with the update cycle of the related object. If assigned to multiple objects, this will be called multiple times per update cycles. The order in the calls happen is undefined and therefore its not recommended to assign a force, which changes over time or in relation to anything else, to multiple objects. Constant forces like gravity however can be reused of course. -
direction
public org.joml.Vector2f direction()Description copied from interface:Force
The direction and strength of this force asVector2f
. -
reset
public void reset()
-