Package physics.force
Class ConstantForce
java.lang.Object
physics.force.ConstantForce
- All Implemented Interfaces:
Force
- Since:
- 21.06.2021
- Author:
- Juyas
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionorg.joml.Vector2f
The direction and strength of this force asVector2f
.A unique identifier for this force, can be used as name as well.boolean
update
(float dt) Called with the update cycle of the related object.
-
Constructor Details
-
ConstantForce
-
-
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
.
-