public TestBedGame(TestbedModel model) { _model = model; IsMouseVisible = true; graphics = new GraphicsDeviceManager(this); Content.RootDirectory = "Content"; }
public TestbedController(TestbedModel argModel, UpdateBehavior behavior, MouseBehavior mouseBehavior, TestbedErrorHandler errorHandler) { model = argModel; inputQueue = new LinkedList<QueueItem>(); setFrameRate(DEFAULT_FPS); //animator = new Thread(s => run()); updateBehavior = behavior; this.errorHandler = errorHandler; this.mouseBehavior = mouseBehavior; addListeners(); }
public void init(TestbedModel model) { this.model = model; Vec2 gravity = new Vec2(0, -10f); m_world = model.getWorldCreator().createWorld(gravity); m_world.setParticleGravityScale(0.4f); m_world.setParticleDensity(1.2f); bomb = null; mouseJoint = null; mouseTracing = false; mouseTracerPosition.setZero(); mouseTracerVelocity.setZero(); BodyDef bodyDef = new BodyDef(); groundBody = m_world.createBody(bodyDef); init(m_world, false); }
// private static final Logger log = LoggerFactory.getLogger(TestbedMain.class); public static void Main(string[] args) { // try { // UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel"); // } catch (Exception e) { // log.warn("Could not set the look and feel to nimbus. " // + "Hopefully you're on a mac so the window isn't ugly as crap."); // } TestbedModel model = new TestbedModel(); TestbedController controller = new TestbedController(model, UpdateBehavior.UPDATE_CALLED, MouseBehavior.NORMAL, new MonoGameTestbedError()); using (var game = new TestBedGame(model)) { game.Run(); } // ; // TestPanelJ2D panel = new TestPanelJ2D(model, controller); // model.setPanel(panel); // model.setDebugDraw(new DebugDrawJ2D(panel, true)); // TestList.populateModel(model); // JFrame testbed = new JFrame(); // testbed.setTitle("JBox2D Testbed"); // testbed.setLayout(new BorderLayout()); // TestbedSidePanel side = new TestbedSidePanel(model, controller); // testbed.add((Component) panel, "Center"); // testbed.add(new JScrollPane(side), "East"); // testbed.pack(); // testbed.setVisible(true); // testbed.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); // System.out. // println(System.getProperty("java.home")); // SwingUtilities.invokeLater(new Runnable() // { // @Override // public void run() { //controller.playTest(0); //controller.start(); // } // } // ) // ; // } }
public static void populateModel(TestbedModel model) { // particles model.addCategory("Particles"); model.addTest(new BulletTest()); model.addTest(new DamBreak()); model.addTest(new DrawingParticles()); model.addTest(new LiquidTimer()); model.addTest(new WaveMachine()); model.addTest(new Particles()); model.addCategory("Featured"); model.addTest(new DominoTest()); model.addTest(new Car()); model.addTest(new CompoundShapes()); model.addTest(new BlobTest4()); model.addTest(new TheoJansen()); // watching... model.addCategory("Collision Watching"); model.addTest(new VaryingRestitution()); model.addTest(new VaryingFrictionTest()); model.addTest(new ConveyorBelt()); model.addTest(new SphereStack()); model.addTest(new Tumbler()); model.addTest(new PistonTest()); model.addTest(new PyramidTest()); model.addTest(new CircleStress()); model.addTest(new DominoTower()); // more interactive.. model.addCategory("Interactive"); model.addTest(new VerticalStack()); model.addTest(new Breakable()); model.addTest(new ShapeEditing()); model.addTest(new OneSidedTest()); model.addTest(new PolyShapes()); model.addTest(new BodyTypes()); model.addTest(new CharacterCollision()); model.addTest(new ApplyForce()); // processing/filtering model.addCategory("Processing/Filtering"); model.addTest(new CollisionFiltering()); model.addTest(new CollisionProcessing()); model.addTest(new SensorTest()); // joints model.addCategory("Joints"); model.addTest(new PrismaticTest()); model.addTest(new RevoluteTest()); model.addTest(new FixedPendulumTest(true)); model.addTest(new FreePendulumTest(true)); model.addTest(new MotorTest()); model.addTest(new Chain()); model.addTest(new RopeTest()); model.addTest(new Pulleys()); model.addTest(new Gears()); model.addTest(new Web()); model.addTest(new Cantilever()); model.addTest(new SliderCrankTest()); // ccd model.addCategory("CCD"); model.addTest(new ContinuousTest()); model.addTest(new ConfinedTest()); // raycast model.addCategory("Raycast"); model.addTest(new RayCastTest()); model.addTest(new EdgeShapes()); // misc model.addCategory("Misc"); model.addTest(new ConvexHull()); model.addTest(new DynamicTreeTest()); model.addTest(new DistanceTest()); }