public abstract class AbstractPosition
extends java.lang.Object
Constructor and Description |
---|
AbstractPosition()
With the currently loaded top left chunk.
|
AbstractPosition(int topleftX,
int topleftY)
With custom reference
|
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 Block |
getBlock() |
abstract Block |
getBlockSafe()
Slower than getBlock().
|
abstract Coordinate |
getCoord()
If needed calculates it and creates new instance else return itself.
|
abstract int |
getDepth(View view)
Returns the depth of the object.
|
float |
getHeight()
Geht the height (z-value) of the coordinate (game dimension).
|
abstract Point |
getPoint()
If needed calculates it and creates new instance else return itself.
|
abstract int |
getProjectedPosX(View View)
Calculate projected position.
|
abstract int |
getProjectedPosY(View View)
Calculate projected position.
|
protected int |
getReferenceX() |
protected int |
getReferenceY() |
int |
getZ()
The z coordinate is absolute even when used as relative coordinate because there are no chunks in Z direction.
|
abstract boolean |
onLoadedMap()
Checks if the position is on the chunks currently in memory.
|
abstract boolean |
onLoadedMapHorizontal()
Checks if the position is on the chunks currently in memory.
|
void |
setHeight(float height) |
public static final float SQRT2
public static final float SQRT12
public AbstractPosition(int topleftX, int topleftY)
topleftX
- the chunk's X coordinate of the chunk at the top lefttopleftY
- the chunk's Y coordinate of the chunk at the top leftpublic AbstractPosition()
public float getHeight()
public void setHeight(float height)
height
- public int getZ()
protected int getReferenceX()
protected int getReferenceY()
public abstract int getProjectedPosX(View View)
View
- public abstract int getProjectedPosY(View View)
View
- public abstract Point getPoint()
public abstract Coordinate getCoord()
public abstract Block getBlock()
getBlockSafe()
public abstract Block getBlockSafe()
getBlock()
public abstract AbstractPosition cpy()
public abstract boolean onLoadedMapHorizontal()
public abstract boolean onLoadedMap()
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 abstract int getDepth(View view)
view
-