|
libgdx API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.badlogic.gdx.physics.box2d.Transform
public class Transform
Encodes a Box2D transform. We are lazy so we only store a 4 float wide array. First two floats are the position of the b2Transform struct. Next two floats are the cosine and sine of the rotation angle.
Field Summary | |
---|---|
static int |
COS
|
static int |
POS_X
|
static int |
POS_Y
|
static int |
SIN
|
float[] |
vals
|
Constructor Summary | |
---|---|
Transform()
|
|
Transform(Vector2 position,
float angle)
Constructs a new Transform instance with the given position and angle |
Method Summary | |
---|---|
Vector2 |
getPosition()
|
float |
getRotation()
|
Vector2 |
mul(Vector2 v)
Transforms the given vector by this transform |
void |
setPosition(Vector2 pos)
Sets the position of this transform |
void |
setRotation(float angle)
Sets the rotation of this transform |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
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
Constructor Detail |
---|
public Transform()
public Transform(Vector2 position, float angle)
position
- the positionangle
- the angle in radiansMethod Detail |
---|
public Vector2 mul(Vector2 v)
v
- the vectorpublic Vector2 getPosition()
public void setRotation(float angle)
angle
- angle in radianspublic float getRotation()
public void setPosition(Vector2 pos)
pos
- the position
|
libgdx API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |