T - Type of vector, either 2D or 3D, implementing the Vector interfacepublic interface Location<T extends com.badlogic.gdx.math.Vector<T>>
Location interface represents any game object having a position and an orientation.| Modifier and Type | Method and Description |
|---|---|
T |
angleToVector(T outVector,
float angle)
Returns the unit vector in the direction of the specified angle expressed in radians.
|
float |
getOrientation()
Returns the float value indicating the orientation of this location.
|
T |
getPosition()
Returns the vector indicating the position of this location.
|
Location<T> |
newLocation()
Creates a new location.
|
void |
setOrientation(float orientation)
Sets the orientation of this location, i.e.
|
float |
vectorToAngle(T vector)
Returns the angle in radians pointing along the specified vector.
|
T getPosition()
float getOrientation()
void setOrientation(float orientation)
orientation - the orientation in radiansfloat vectorToAngle(T vector)
vector - the vectorT angleToVector(T outVector, float angle)
outVector - the output vector.angle - the angle in radians.Location<T> newLocation()
This method is used internally to instantiate locations of the correct type parameter T. This technique keeps the API
simple and makes the API easier to use with the GWT backend because avoids the use of reflection.