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 TypeMethodDescriptionfloatcom.badlogic.gdx.math.Vector2getDirection(int x, int y) intintgetWidth()com.badlogic.gdx.math.Vector2lookup(com.badlogic.gdx.math.Vector2 p) Returns the flow vector for the specified position in space.voidsetDirection(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.FlowFieldReturns the flow vector for the specified position in space.- Specified by:
lookupin interfacecom.badlogic.gdx.ai.steer.behaviors.FollowFlowField.FlowField<com.badlogic.gdx.math.Vector2>- Parameters:
p- the position to map
-