public abstract class AbstractPosition
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Field and Description |
---|---|
protected AbstractMap |
map |
static float |
SQRT12
half of square root of two
|
static float |
SQRT2
square root of two
|
Constructor and Description |
---|
AbstractPosition(AbstractMap map) |
Modifier and Type | Method and Description |
---|---|
abstract AbstractPosition |
addVector(float[] vector) |
abstract AbstractPosition |
addVector(float x,
float y,
float z)
Add a vector to the position.
|
abstract AbstractPosition |
addVector(com.badlogic.gdx.math.Vector3 vector) |
abstract AbstractPosition |
cpy() |
abstract CoreData |
getBlock()
Clamps positions over the map at topmost layer.
|
abstract Coordinate |
getCoord()
If needed calculates it and creates new instance else return itself.
|
int |
getDepth(GameView view)
Returns the depth of the object.
|
AbstractMap |
getMap() |
abstract Point |
getPoint()
If needed calculates it and creates new instance else return itself.
|
abstract com.badlogic.gdx.math.Vector3 |
getVector()
Get as vector
|
abstract int |
getViewSpcX(GameView View)
Calculate position in view space.
|
abstract int |
getViewSpcY(GameView View)
Calculate position in view space.
|
abstract boolean |
isInMemoryArea()
Checks if the position is on the chunks currently in memory.
|
abstract boolean |
isInMemoryAreaHorizontal()
Checks if the position is on the chunks currently in memory.
|
public static final float SQRT2
public static final float SQRT12
protected transient AbstractMap map
public AbstractPosition(AbstractMap map)
public AbstractMap getMap()
public abstract int getViewSpcX(GameView View)
View
- public abstract int getViewSpcY(GameView View)
View
- public abstract Point getPoint()
public abstract Coordinate getCoord()
public abstract com.badlogic.gdx.math.Vector3 getVector()
public abstract CoreData getBlock()
#getBlockSafe()
public abstract AbstractPosition cpy()
public abstract boolean isInMemoryAreaHorizontal()
public abstract boolean isInMemoryArea()
public abstract AbstractPosition addVector(float[] vector)
vector
- public abstract AbstractPosition addVector(com.badlogic.gdx.math.Vector3 vector)
vector
- public abstract AbstractPosition addVector(float x, float y, float z)
x
- Dependent on implementation.y
- Dependent on implementation.z
- Dependent on implementation.public int getDepth(GameView view)
view
-