Package com.prineside.tdi2.utils
Class FlowField
java.lang.Object
com.prineside.tdi2.utils.FlowField
- All Implemented Interfaces:
com.badlogic.gdx.ai.steer.behaviors.FollowFlowField.FlowField<com.badlogic.gdx.math.Vector2>
public final class FlowField
extends Object
implements com.badlogic.gdx.ai.steer.behaviors.FollowFlowField.FlowField<com.badlogic.gdx.math.Vector2>
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfloat
com.badlogic.gdx.math.Vector2
getDirection
(int x, int y) int
int
getWidth()
com.badlogic.gdx.math.Vector2
lookup
(com.badlogic.gdx.math.Vector2 p) Returns the flow vector for the specified position in space.void
setDirection
(int x, int y, float dX, float dY)
-
Constructor Details
-
FlowField
public FlowField(int width, int height, float cellSize)
-
-
Method Details
-
getHeight
public int getHeight() -
getWidth
public int getWidth() -
getCellSize
public float getCellSize() -
setDirection
public void setDirection(int x, int y, float dX, float dY) -
getDirection
public com.badlogic.gdx.math.Vector2 getDirection(int x, int y) -
lookup
public com.badlogic.gdx.math.Vector2 lookup(com.badlogic.gdx.math.Vector2 p) Description copied from interface:com.badlogic.gdx.ai.steer.behaviors.FollowFlowField.FlowField
Returns the flow vector for the specified position in space.- Specified by:
lookup
in interfacecom.badlogic.gdx.ai.steer.behaviors.FollowFlowField.FlowField<com.badlogic.gdx.math.Vector2>
- Parameters:
p
- the position to map
-