java.lang.Object
de.pirckheimer_gymnasium.jbox2d.testbed.framework.TestbedTest
All Implemented Interfaces:
ContactListener, JbDeserializer.ObjectListener, JbSerializer.ObjectSigner, UnsupportedListener
Direct Known Subclasses:
ApplyForce, BlobTest4, BodyTypes, Breakable, BulletTest, Cantilever, Car, Chain, CharacterCollision, CircleStress, CollisionFiltering, CollisionProcessing, CompoundShapes, ConfinedTest, ContinuousTest, ConvexHull, ConveyorBelt, DamBreak, DistanceTest, DominoTest, DominoTower, DrawingParticles, DynamicTreeTest, EdgeShapes, EdgeTest, FixedPendulumTest, FreePendulumTest, Gears, LiquidTimer, MotorTest, OneSidedTest, Particles, ParticleTypes, PistonTest, PolyShapes, PrismaticTest, Pulleys, PyramidTest, RayCastTest, RevoluteTest, RopeTest, SensorTest, ShapeEditing, SliderCrankTest, SphereStack, TheoJansen, Tumbler, VaryingFrictionTest, VaryingRestitution, VerticalStack, WaveMachine, Web

Author:
Daniel Murphy
  • Field Details

  • Constructor Details

    • TestbedTest

      public TestbedTest()
  • Method Details

    • init

      public void init(TestbedModel model)
    • init

      public void init(World world, boolean deserialized)
    • getSerializer

      protected JbSerializer getSerializer()
    • getDeserializer

      protected JbDeserializer getDeserializer()
    • getWorld

      public World getWorld()
      Gets the current world
    • getModel

      public TestbedModel getModel()
      Gets the testbed model
    • getContactPoints

      public ContactPoint[] getContactPoints()
      Gets the contact points for the current test
    • getGroundBody

      public Body getGroundBody()
      Gets the ground body of the world, used for some joints
    • getDebugDraw

      public DebugDraw getDebugDraw()
      Gets the debug draw for the testbed
    • getWorldMouse

      public Vec2 getWorldMouse()
      Gets the world position of the mouse
    • getStepCount

      public int getStepCount()
    • getPointCount

      public int getPointCount()
      The number of contact points we're storing
    • getCamera

      public TestbedCamera getCamera()
    • getBomb

      public Body getBomb()
      Gets the 'bomb' body if it's present
    • getDefaultCameraPos

      public Vec2 getDefaultCameraPos()
      Override for a different default camera position
    • getDefaultCameraScale

      public float getDefaultCameraScale()
      Override for a different default camera scale
    • isMouseTracing

      public boolean isMouseTracing()
    • getMouseTracerPosition

      public Vec2 getMouseTracerPosition()
    • getMouseTracerVelocity

      public Vec2 getMouseTracerVelocity()
    • getFilename

      public String getFilename()
      Gets the filename of the current test. Default implementation uses the test name with no spaces".
    • setCamera

      public void setCamera(Vec2 argPos)
      Deprecated.
    • setCamera

      public void setCamera(Vec2 argPos, float scale)
      Deprecated.
    • initTest

      public abstract void initTest(boolean deserialized)
      Initializes the current test.
      Parameters:
      deserialized - if the test was deserialized from a file. If so, all physics objects are already added.
    • getTestName

      public abstract String getTestName()
      The name of the test
    • addTextLine

      public void addTextLine(String line)
      Adds a text line to the reporting area
    • exit

      public void exit()
      called when the tests exits
    • step

      public void step(TestbedSettings settings)
    • mouseUp

      public void mouseUp(Vec2 p, int button)
      Called for mouse-up
    • keyPressed

      public void keyPressed(char keyChar, int keyCode)
    • keyReleased

      public void keyReleased(char keyChar, int keyCode)
    • mouseDown

      public void mouseDown(Vec2 p, int button)
    • mouseMove

      public void mouseMove(Vec2 p)
    • mouseDrag

      public void mouseDrag(Vec2 p, int button)
    • lanchBomb

      public void lanchBomb()
    • isSaveLoadEnabled

      public boolean isSaveLoadEnabled()
      Override to enable saving and loading. Remember to also override the JbDeserializer.ObjectListener and JbSerializer.ObjectSigner methods if you need to
    • getTag

      public Long getTag(Body body)
      Specified by:
      getTag in interface JbSerializer.ObjectSigner
    • getTag

      public Long getTag(Fixture fixture)
      Specified by:
      getTag in interface JbSerializer.ObjectSigner
    • getTag

      public Long getTag(Joint joint)
      Specified by:
      getTag in interface JbSerializer.ObjectSigner
    • getTag

      public Long getTag(Shape shape)
      Specified by:
      getTag in interface JbSerializer.ObjectSigner
    • getTag

      public Long getTag(World world)
      Specified by:
      getTag in interface JbSerializer.ObjectSigner
    • processBody

      public void processBody(Body body, Long tag)
      Specified by:
      processBody in interface JbDeserializer.ObjectListener
    • processFixture

      public void processFixture(Fixture fixture, Long tag)
      Specified by:
      processFixture in interface JbDeserializer.ObjectListener
    • processJoint

      public void processJoint(Joint joint, Long tag)
      Specified by:
      processJoint in interface JbDeserializer.ObjectListener
    • processShape

      public void processShape(Shape shape, Long tag)
      Specified by:
      processShape in interface JbDeserializer.ObjectListener
    • processWorld

      public void processWorld(World world, Long tag)
      Specified by:
      processWorld in interface JbDeserializer.ObjectListener
    • isUnsupported

      public boolean isUnsupported(UnsupportedObjectException exception)
      Specified by:
      isUnsupported in interface UnsupportedListener
    • fixtureDestroyed

      public void fixtureDestroyed(Fixture fixture)
    • jointDestroyed

      public void jointDestroyed(Joint joint)
    • beginContact

      public void beginContact(Contact contact)
      Specified by:
      beginContact in interface ContactListener
    • endContact

      public void endContact(Contact contact)
      Specified by:
      endContact in interface ContactListener
    • particleDestroyed

      public void particleDestroyed(int particle)
    • particleGroupDestroyed

      public void particleGroupDestroyed(ParticleGroup group)
    • postSolve

      public void postSolve(Contact contact, ContactImpulse impulse)
      Specified by:
      postSolve in interface ContactListener
    • preSolve

      public void preSolve(Contact contact, Manifold oldManifold)
      Specified by:
      preSolve in interface ContactListener