public class Transform
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static int |
COS |
static int |
POS_X |
static int |
POS_Y |
static int |
SIN |
float[] |
vals |
| Constructor and Description |
|---|
Transform() |
Transform(com.badlogic.gdx.math.Vector2 position,
float angle)
Constructs a new Transform instance with the given position and angle
|
Transform(com.badlogic.gdx.math.Vector2 position,
com.badlogic.gdx.math.Vector2 orientation)
Constructs a new Transform instance with the given position and orientation
|
| Modifier and Type | Method and Description |
|---|---|
com.badlogic.gdx.math.Vector2 |
getOrientation() |
com.badlogic.gdx.math.Vector2 |
getPosition() |
float |
getRotation() |
com.badlogic.gdx.math.Vector2 |
mul(com.badlogic.gdx.math.Vector2 v)
Transforms the given vector by this transform
|
void |
setOrientation(com.badlogic.gdx.math.Vector2 orientation)
Set where the body should "look at"
|
void |
setPosition(com.badlogic.gdx.math.Vector2 pos)
Sets the position of this transform
|
void |
setRotation(float angle)
Sets the rotation of this transform
|
public static final int POS_X
public static final int POS_Y
public static final int COS
public static final int SIN
public float[] vals
public Transform()
public Transform(com.badlogic.gdx.math.Vector2 position,
float angle)
position - the positionangle - the angle in radianspublic Transform(com.badlogic.gdx.math.Vector2 position,
com.badlogic.gdx.math.Vector2 orientation)
position - the positionorientation - where the transform is pointingpublic com.badlogic.gdx.math.Vector2 mul(com.badlogic.gdx.math.Vector2 v)
v - the vectorpublic com.badlogic.gdx.math.Vector2 getPosition()
public void setRotation(float angle)
angle - angle in radianspublic float getRotation()
public com.badlogic.gdx.math.Vector2 getOrientation()
public void setOrientation(com.badlogic.gdx.math.Vector2 orientation)
public void setPosition(com.badlogic.gdx.math.Vector2 pos)
pos - the position