public class Box2DWorld extends World implements PhysicsWorld
Modifier and Type | Class and Description |
---|---|
class |
Box2DWorld.TestQueryCallback |
Modifier and Type | Field and Description |
---|---|
static float |
MAX_FRAME_TIME |
protected float |
mDt |
protected Handler |
mHandler |
protected float |
mPixelsPerMeter |
protected boolean |
mPlaying |
protected int |
mPositionIterations |
protected int |
mVelocityIterations |
static int |
TARGET_FPS |
static java.lang.String |
THREAD_NAME |
static float |
TIME_STEP |
static int |
TIME_STEP_MS |
Constructor and Description |
---|
Box2DWorld(Vec2 gravity,
boolean doSleep) |
Modifier and Type | Method and Description |
---|---|
Fixture |
getFixtureAt(float x,
float y) |
Body |
getGroundBody() |
float |
m2P(float meters) |
float |
p2M(float pixels) |
void |
post(java.lang.Runnable r) |
protected void |
render(float alpha) |
void |
setStepParams(float dt,
int velocityIterations,
int positionIterations) |
void |
start() |
void |
stop() |
protected void |
update()
Handle fixed time-step
|
public static final java.lang.String THREAD_NAME
public static final int TARGET_FPS
public static final float MAX_FRAME_TIME
public static final float TIME_STEP
public static final int TIME_STEP_MS
protected float mDt
protected int mVelocityIterations
protected int mPositionIterations
protected boolean mPlaying
protected float mPixelsPerMeter
protected Handler mHandler
public void start()
public void stop()
public void setStepParams(float dt, int velocityIterations, int positionIterations)
protected void update()
protected void render(float alpha)
public void post(java.lang.Runnable r)
public float p2M(float pixels)
public float m2P(float meters)
public Body getGroundBody()
public Fixture getFixtureAt(float x, float y)