ForceGenerator Class
A generic force generator. It applies the specified force directly to the entity.
Constructor
ForceGenerator
(
-
forceX
-
forceY
Parameters:
-
forceX
NumberThe x component of the force vector.
-
forceY
NumberThe y component of the force vector.
Item Index
Methods
Methods
applyForce
(
-
entity
Parameters:
-
entity
EntityThe entity this force should be applied to. It's required that the entity has the Movable component.
getForceVector
(
-
vector
Retrieves the force vector.
Parameters:
-
vector
Vector2DThe vector to which the force vector will be copied.
setForceVector
(
-
forceX
-
forceY
Sets new values for the force vector.
Parameters:
-
forceX
NumberThe x component of the new force vector.
-
forceY
NumberThe y component of the new force vector.