|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jbox2d.testbed.framework.TestbedTest
public abstract class TestbedTest
| Field Summary | |
|---|---|
protected static long |
BOMB_TAG
|
protected static long |
GROUND_BODY_TAG
|
protected int |
m_textLine
|
protected org.jbox2d.dynamics.World |
m_world
Only visible for compatibility. |
static int |
MAX_CONTACT_POINTS
|
protected static long |
MOUSE_JOINT_TAG
|
static ContactPoint[] |
points
|
| Constructor Summary | |
|---|---|
TestbedTest()
|
|
| Method Summary | |
|---|---|
protected void |
_load()
|
protected void |
_reset()
|
protected void |
_save()
|
void |
addTextLine(String argTextLine)
Adds a text line to the reporting area |
void |
beginContact(org.jbox2d.dynamics.contacts.Contact contact)
|
void |
completeBombSpawn(org.jbox2d.common.Vec2 p)
|
void |
endContact(org.jbox2d.dynamics.contacts.Contact contact)
|
void |
exit()
called when the tests exits |
org.jbox2d.dynamics.Body |
getBomb()
Gets the 'bomb' body if it's present |
org.jbox2d.common.Vec2 |
getCachedCameraPos()
|
float |
getCachedCameraScale()
|
static ContactPoint[] |
getContactPoints()
Gets the contact points for the current test |
org.jbox2d.callbacks.DebugDraw |
getDebugDraw()
Gets the debug draw for the testbed |
org.jbox2d.common.Vec2 |
getDefaultCameraPos()
Override for a different default camera pos |
float |
getDefaultCameraScale()
Override for a different default camera scale |
String |
getFilename()
Gets the filename of the current test. |
org.jbox2d.dynamics.Body |
getGroundBody()
Gets the ground body of the world, used for some joints |
TestbedModel |
getModel()
Gets the testbed model |
int |
getPointCount()
The number of contact points we're storing |
int |
getStepCount()
|
Long |
getTag(org.jbox2d.dynamics.Body argBody)
|
Long |
getTag(org.jbox2d.dynamics.Fixture argFixture)
|
Long |
getTag(org.jbox2d.dynamics.joints.Joint argJoint)
|
Long |
getTag(org.jbox2d.collision.shapes.Shape argShape)
|
Long |
getTag(org.jbox2d.dynamics.World argWorld)
|
abstract String |
getTestName()
The name of the test |
org.jbox2d.dynamics.World |
getWorld()
Gets the current world |
org.jbox2d.common.Vec2 |
getWorldMouse()
Gets the world position of the mouse |
void |
init(TestbedModel argModel)
|
void |
init(org.jbox2d.dynamics.World argWorld,
boolean argDeserialized)
|
abstract void |
initTest(boolean argDeserialized)
Initializes the current test |
boolean |
isDialogOnSaveLoadErrors()
|
boolean |
isHasCachedCamera()
|
boolean |
isSaveLoadEnabled()
Override to enable saving and loading. |
boolean |
isUnsupported(org.jbox2d.serialization.UnsupportedObjectException argException)
|
void |
jointDestroyed(org.jbox2d.dynamics.joints.Joint joint)
|
void |
keyPressed(char argKeyChar,
int argKeyCode)
|
void |
keyReleased(char argKeyChar,
int argKeyCode)
|
void |
lanchBomb()
|
void |
launchBomb(org.jbox2d.common.Vec2 position,
org.jbox2d.common.Vec2 velocity)
|
void |
load()
Loads the test from file |
void |
mouseDown(org.jbox2d.common.Vec2 p)
Called for mouse-down |
void |
mouseMove(org.jbox2d.common.Vec2 p)
Called when mouse is moved |
void |
mouseUp(org.jbox2d.common.Vec2 p)
Called for mouse-up |
void |
postSolve(org.jbox2d.dynamics.contacts.Contact contact,
org.jbox2d.callbacks.ContactImpulse impulse)
|
void |
preSolve(org.jbox2d.dynamics.contacts.Contact contact,
org.jbox2d.collision.Manifold oldManifold)
|
void |
processBody(org.jbox2d.dynamics.Body argBody,
Long argTag)
|
void |
processFixture(org.jbox2d.dynamics.Fixture argFixture,
Long argTag)
|
void |
processJoint(org.jbox2d.dynamics.joints.Joint argJoint,
Long argTag)
|
void |
processShape(org.jbox2d.collision.shapes.Shape argShape,
Long argTag)
|
void |
processWorld(org.jbox2d.dynamics.World argWorld,
Long argTag)
|
void |
queueKeyPressed(char c,
int code)
|
void |
queueKeyReleased(char c,
int code)
|
void |
queueMouseDown(org.jbox2d.common.Vec2 p)
|
void |
queueMouseMove(org.jbox2d.common.Vec2 p)
|
void |
queueMouseUp(org.jbox2d.common.Vec2 p)
|
void |
queueShiftMouseDown(org.jbox2d.common.Vec2 p)
|
void |
reset()
Resets the test |
void |
save()
Saves the test |
void |
setCachedCameraPos(org.jbox2d.common.Vec2 argPos)
|
void |
setCachedCameraScale(float cachedCameraScale)
|
void |
setCamera(org.jbox2d.common.Vec2 argPos,
float scale)
Sets the current testbed camera |
void |
setDialogOnSaveLoadErrors(boolean dialogOnSaveLoadErrors)
|
void |
setHasCachedCamera(boolean hasCachedCamera)
|
void |
setTitle(String argTitle)
Sets the title of the test |
void |
shiftMouseDown(org.jbox2d.common.Vec2 p)
Called when shift-mouse down occurs |
void |
spawnBomb(org.jbox2d.common.Vec2 worldPt)
|
void |
step(TestbedSettings settings)
|
void |
update()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int MAX_CONTACT_POINTS
protected static final long GROUND_BODY_TAG
protected static final long BOMB_TAG
protected static final long MOUSE_JOINT_TAG
public static final ContactPoint[] points
protected org.jbox2d.dynamics.World m_world
getWorld() instead.
protected int m_textLine
| Constructor Detail |
|---|
public TestbedTest()
| Method Detail |
|---|
public void init(TestbedModel argModel)
public void init(org.jbox2d.dynamics.World argWorld,
boolean argDeserialized)
public org.jbox2d.dynamics.World getWorld()
public TestbedModel getModel()
public static ContactPoint[] getContactPoints()
public org.jbox2d.dynamics.Body getGroundBody()
public org.jbox2d.callbacks.DebugDraw getDebugDraw()
public org.jbox2d.common.Vec2 getWorldMouse()
public int getStepCount()
public int getPointCount()
public org.jbox2d.dynamics.Body getBomb()
public float getCachedCameraScale()
public void setCachedCameraScale(float cachedCameraScale)
public org.jbox2d.common.Vec2 getCachedCameraPos()
public void setCachedCameraPos(org.jbox2d.common.Vec2 argPos)
public boolean isHasCachedCamera()
public void setHasCachedCamera(boolean hasCachedCamera)
public boolean isDialogOnSaveLoadErrors()
public void setDialogOnSaveLoadErrors(boolean dialogOnSaveLoadErrors)
public org.jbox2d.common.Vec2 getDefaultCameraPos()
public float getDefaultCameraScale()
public String getFilename()
public void reset()
public void save()
public void load()
protected void _reset()
protected void _save()
protected void _load()
public void setCamera(org.jbox2d.common.Vec2 argPos,
float scale)
argPos - scale - public abstract void initTest(boolean argDeserialized)
argDeserialized - if the test was deserialized from a file. If so, all physics
objects were already added.public abstract String getTestName()
public void exit()
public void update()
public void step(TestbedSettings settings)
public void queueShiftMouseDown(org.jbox2d.common.Vec2 p)
public void queueMouseUp(org.jbox2d.common.Vec2 p)
public void queueMouseDown(org.jbox2d.common.Vec2 p)
public void queueMouseMove(org.jbox2d.common.Vec2 p)
public void queueKeyPressed(char c,
int code)
public void queueKeyReleased(char c,
int code)
public void shiftMouseDown(org.jbox2d.common.Vec2 p)
p - public void mouseUp(org.jbox2d.common.Vec2 p)
p - public void mouseDown(org.jbox2d.common.Vec2 p)
p - public void mouseMove(org.jbox2d.common.Vec2 p)
p - public void setTitle(String argTitle)
argTitle - public void addTextLine(String argTextLine)
argTextLine - public void lanchBomb()
public void launchBomb(org.jbox2d.common.Vec2 position,
org.jbox2d.common.Vec2 velocity)
public void spawnBomb(org.jbox2d.common.Vec2 worldPt)
public void completeBombSpawn(org.jbox2d.common.Vec2 p)
public boolean isSaveLoadEnabled()
JbDeserializer.ObjectListener and JbSerializer.ObjectSigner methods if you need to
public Long getTag(org.jbox2d.dynamics.Body argBody)
getTag in interface org.jbox2d.serialization.JbSerializer.ObjectSignerpublic Long getTag(org.jbox2d.dynamics.Fixture argFixture)
getTag in interface org.jbox2d.serialization.JbSerializer.ObjectSignerpublic Long getTag(org.jbox2d.dynamics.joints.Joint argJoint)
getTag in interface org.jbox2d.serialization.JbSerializer.ObjectSignerpublic Long getTag(org.jbox2d.collision.shapes.Shape argShape)
getTag in interface org.jbox2d.serialization.JbSerializer.ObjectSignerpublic Long getTag(org.jbox2d.dynamics.World argWorld)
getTag in interface org.jbox2d.serialization.JbSerializer.ObjectSigner
public void processBody(org.jbox2d.dynamics.Body argBody,
Long argTag)
processBody in interface org.jbox2d.serialization.JbDeserializer.ObjectListener
public void processFixture(org.jbox2d.dynamics.Fixture argFixture,
Long argTag)
processFixture in interface org.jbox2d.serialization.JbDeserializer.ObjectListener
public void processJoint(org.jbox2d.dynamics.joints.Joint argJoint,
Long argTag)
processJoint in interface org.jbox2d.serialization.JbDeserializer.ObjectListener
public void processShape(org.jbox2d.collision.shapes.Shape argShape,
Long argTag)
processShape in interface org.jbox2d.serialization.JbDeserializer.ObjectListener
public void processWorld(org.jbox2d.dynamics.World argWorld,
Long argTag)
processWorld in interface org.jbox2d.serialization.JbDeserializer.ObjectListenerpublic boolean isUnsupported(org.jbox2d.serialization.UnsupportedObjectException argException)
isUnsupported in interface org.jbox2d.serialization.UnsupportedListenerpublic void jointDestroyed(org.jbox2d.dynamics.joints.Joint joint)
public void beginContact(org.jbox2d.dynamics.contacts.Contact contact)
beginContact in interface org.jbox2d.callbacks.ContactListenerpublic void endContact(org.jbox2d.dynamics.contacts.Contact contact)
endContact in interface org.jbox2d.callbacks.ContactListener
public void postSolve(org.jbox2d.dynamics.contacts.Contact contact,
org.jbox2d.callbacks.ContactImpulse impulse)
postSolve in interface org.jbox2d.callbacks.ContactListener
public void preSolve(org.jbox2d.dynamics.contacts.Contact contact,
org.jbox2d.collision.Manifold oldManifold)
preSolve in interface org.jbox2d.callbacks.ContactListener
public void keyPressed(char argKeyChar,
int argKeyCode)
public void keyReleased(char argKeyChar,
int argKeyCode)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||