demo scene avaiable?

General discussion about the R.U.B.E editor
dimecoin
Posts: 8
Joined: Tue Nov 19, 2013 2:57 am

demo scene avaiable?

Post by dimecoin »

Hi, I tried the trial version of Rube and it's really neat. I was wondering if there was a demo rube scene available for testing? I just want to verify that the loader works and what it will be like 'in-game'. Thanks.
iforce2d
Site Admin
Posts: 861
Joined: Sat Dec 22, 2012 7:20 pm

Re: demo scene avaiable?

Post by iforce2d »

There are a variety of scenes under the 'sampleLoaders' folder in the trial download. They are not all grouped together because the different loaders sometimes need to have them in different paths, but basically any .json file under the sampleLoaders folder will be an exported scene that can be used to check loading.
dimecoin
Posts: 8
Joined: Tue Nov 19, 2013 2:57 am

Re: demo scene avaiable?

Post by dimecoin »

Thanks for the info! I'm trying to load the 'car' scene as it looks fairly simple[r].

I played around with the java/libgdx loaders for a couple hours, but haven't had much luck.

For gdx-rube I had quite a time getting it compiled, I don't think it works with latest libgdx? I got it compiled and would load a scene and could add my own bodies to it's world, but couldn't see any objects from the .json file.

For RubeLoader it seems... quite involved? Or I'm understanding it wrong. The bootstrap is ~1K lines of code (actually, more like 500, but still?): https://github.com/tescott/RubeLoader/t ... udios/rube

1) Both seem to create their own Box World. What if I have my own world and just want to load models from a scene? For example, say I have an existing box2d world and just want to load a 'car' model?

2) Neither have pre built .jars? Not the end of the world, but seems like an extra step

3) What is the difference between the two (gdx-rube and RubeLoader)?

I have some free time tomorrow, and will try again. Any tips would be appreciated though!
iforce2d
Site Admin
Posts: 861
Joined: Sat Dec 22, 2012 7:20 pm

Re: demo scene avaiable?

Post by iforce2d »

I have no experience with libGDX, so I can't really answer much about these two loaders and their usage, or their differences. The only thing I might be able to help with is the first question about loading a scene into an existing world.

In the C++ version of the loader, the main readFromFile function takes a parameter which can be either an existing world to load into, or NULL. If it is NULL, everything runs as usual and a new world is created to load the scene into. If it is not NULL, the scene will be loaded into the world that you passed as a parameter.

This extra parameter version of the function was added to the C++ version quite recently, so the guys who made those Java versions would most likely not have seen it, and therefore did not include it in their port. However, it is a small modification and not such a complicated thing to add. This thread at StackOverflow should help: http://stackoverflow.com/questions/1973 ... rge-worlds
tescott
Posts: 68
Joined: Wed Feb 06, 2013 6:32 pm

Re: demo scene avaiable?

Post by tescott »

dimecoin wrote: I played around with the java/libgdx loaders for a couple hours, but haven't had much luck.
What's the problem? The RUBELoader project up on github should work for you out-of-the-box.
dimecoin wrote: For gdx-rube I had quite a time getting it compiled, I don't think it works with latest libgdx? I got it compiled and would load a scene and could add my own bodies to it's world, but couldn't see any objects from the .json file.

For RubeLoader it seems... quite involved? Or I'm understanding it wrong. The bootstrap is ~1K lines of code (actually, more like 500, but still?): https://github.com/tescott/RubeLoader/t ... udios/rube
The readme shows that you only need two lines to instantiate things. Not sure where you are getting tripped up. The test class does some verification and example rendering to show a possible implementation method.
dimecoin wrote: 1) Both seem to create their own Box World. What if I have my own world and just want to load models from a scene? For example, say I have an existing box2d world and just want to load a 'car' model?
I've updated RUBEloader to allow you to add things to a pre-existing world. You now also have the ability to load in separate RUBE .json files into a single scene.
dimecoin wrote:
2) Neither have pre built .jars? Not the end of the world, but seems like an extra step
I have no plans to support a .JAR file at the current time.
dimecoin wrote: 3) What is the difference between the two (gdx-rube and RubeLoader)?
cvayer and I started working on RUBELoader back around January timeframe. He then went in a different direction than where I wanted to take things. He's got integrated atlas support. I don't. I also wanted to include the box2dcontrollers project as part of RUBEloader so we ended up diverging a bit in our approach.

Think of it this way. If you think my approach sucks, you've always got cvayer's project as an alternative. :D

--tim
dimecoin
Posts: 8
Joined: Tue Nov 19, 2013 2:57 am

Re: demo scene avaiable?

Post by dimecoin »

tescott wrote: The readme shows that you only need two lines to instantiate things. Not sure where you are getting tripped up. The test class does some verification and example rendering to show a possible implementation method.
Hi tescott, thanks for the reply (and keeping runtimes up to date! :)). I'm just trying to load the car from the test examples into my own world and verify it though the debug renderer.

Code: Select all

		RubeSceneLoader loader = new RubeSceneLoader(myBoxWorld);
		RubeScene scene = loader.loadScene(Gdx.files.internal("res/rubes/car.json"));
		createFloor();  // Creates static box across bottom.

In my debug renderer I see my floor (green box); but not the car. myBoxWorld says their is only 1 body in the world. scene.printstats also says 0 bodies. Maybe I'm mis understanding, but I don't think the car body is being loaded?

I've been playing around with some other editors/runtimes and a lot of them return a body definition which is then turned into a body with myBoxWorld.createBody(bodyDef); Is that what I'm suppose to be doing here or is loadScene creating the actual bodies? I guess I don't really understand the high level overview of how the json gets turned into box2d bodies.
tescott
Posts: 68
Joined: Wed Feb 06, 2013 6:32 pm

Re: demo scene avaiable?

Post by tescott »

Hrm. Something is obviously wrong. If you would be willing to .zip up your project and send it to me, I could take a look at what's up.

--tim
dimecoin
Posts: 8
Joined: Tue Nov 19, 2013 2:57 am

Re: demo scene avaiable?

Post by dimecoin »

Here is a quick and dirty example. I'm using libgdx 0.9.9 and your Rube Loader from today.

scene.printStats() says 0 bodies and boxWorld.getBodyCount is 1 (the floor).

Code: Select all

import com.badlogic.gdx.ApplicationListener;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.backends.lwjgl.LwjglApplication;
import com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration;
import com.badlogic.gdx.graphics.OrthographicCamera;
import com.badlogic.gdx.math.Matrix4;
import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.physics.box2d.Body;
import com.badlogic.gdx.physics.box2d.BodyDef;
import com.badlogic.gdx.physics.box2d.BodyDef.BodyType;
import com.badlogic.gdx.physics.box2d.Box2DDebugRenderer;
import com.badlogic.gdx.physics.box2d.Fixture;
import com.badlogic.gdx.physics.box2d.FixtureDef;
import com.badlogic.gdx.physics.box2d.PolygonShape;
import com.badlogic.gdx.physics.box2d.World;
import com.gushikustudios.rube.RubeScene;
import com.gushikustudios.rube.loader.RubeSceneLoader;

public class TestScreen implements ApplicationListener {

	float BOX2D_MAX_STEP = 0.20f;
	float BOX2D_STEP = 1 / 60f;
	float WORLD_TO_BOX = 0.01f;
	float BOX_TO_WORLD = 100f;

	private OrthographicCamera camera;
	private World boxWorld;
	private Box2DDebugRenderer box2dDebugRenderer;
	private Matrix4 box2dMatrix;
	private float boxStep;
	private int velocityIterations = 8, positionIterations = 3;

	public static void main (String[] arg) {

		LwjglApplicationConfiguration cfg = new LwjglApplicationConfiguration();

		cfg.title = "Test Screen";

		new LwjglApplication(new TestScreen(), cfg);

	}

	@Override
	public void create () {

		camera = new OrthographicCamera(Gdx.graphics.getWidth(), Gdx.graphics.getHeight());

		box2dDebugRenderer = new Box2DDebugRenderer();
		box2dMatrix = new Matrix4(camera.combined);

		boxWorld = new com.badlogic.gdx.physics.box2d.World(new Vector2(0, -10), true);

		RubeSceneLoader loader = new RubeSceneLoader(boxWorld);
		RubeScene scene = loader.loadScene(Gdx.files.internal("res/rubes/car.json"));

		createFloor();

		scene.printStats();
		Gdx.app.log("boxWorld Body Count", "" + boxWorld.getBodyCount());

	}

	@Override
	public void dispose () {

	}

	@Override
	public void pause () {

	}

	@Override
	public void render () {

		// boxStep += delta;

		boxStep += Gdx.graphics.getDeltaTime();
		if (boxStep >= BOX2D_MAX_STEP) {
			boxStep = BOX2D_STEP;
		}

		while (boxStep >= BOX2D_STEP) {
			boxWorld.step(BOX2D_STEP, velocityIterations, positionIterations);
			boxStep -= BOX2D_STEP;

		}

		box2dMatrix.set(camera.combined);
		box2dMatrix.scale(BOX_TO_WORLD, BOX_TO_WORLD, 1f);
		box2dDebugRenderer.render(boxWorld, box2dMatrix);

	}

	@Override
	public void resize (int arg0, int arg1) {

	}

	@Override
	public void resume () {

	}

	public void createFloor () {

		BodyDef bodyDef = new BodyDef();
		bodyDef.type = BodyType.StaticBody;
		Body body = boxWorld.createBody(bodyDef);

		PolygonShape rectangle = new PolygonShape();

		float width = Gdx.graphics.getWidth();
		float height = 20;
		rectangle.setAsBox(width * WORLD_TO_BOX, height / 2 * WORLD_TO_BOX);

		FixtureDef fixtureDef = new FixtureDef();
		fixtureDef.shape = rectangle;
		fixtureDef.density = 0.5f;
		fixtureDef.friction = 0.4f;
		fixtureDef.restitution = 0.6f;

		Fixture fixture = body.createFixture(fixtureDef);

		rectangle.dispose();
	}
}


Here is the car.json from example projects

Code: Select all

{
  "activeScript" : "for (int n = 0; n< 8; n++)\n\tgetFixture(\"fixture\"+n).setName(\"playerfoot\"+n);\n",
  "metaworld" : 
  {
    "allowSleep" : true,
    "autoClearForces" : true,
    "continuousPhysics" : true,
    "gravity" : 
    {
      "x" : 0,
      "y" : -10.0
    },
    "metabody" : 
    [
      
      {
        "angle" : 0,
        "angularVelocity" : 0,
        "awake" : true,
        "fixture" : 
        [
          
          {
            "density" : 1,
            "friction" : 0.2000000029802322,
            "id" : 9,
            "name" : "playerfoot1",
            "shapes" : 
            [
              
              {
                "type" : "line"
              }
            ],
            "vertices" : 
            {
              "x" : [ -4.119325637817383, 9.119326591491699 ],
              "y" : [ 0.06462776660919189, 0.06462776660919189 ]
            }
          }
        ],
        "id" : 5,
        "linearVelocity" : 0,
        "name" : "ground",
        "position" : 
        {
          "x" : 0.002097775693982840,
          "y" : 0.0008306311792694032
        },
        "type" : "static"
      },
      
      {
        "angle" : 0,
        "angularVelocity" : 0,
        "awake" : true,
        "fixture" : 
        [
          
          {
            "density" : 1,
            "friction" : 0.2000000029802322,
            "id" : 10,
            "name" : "antenna2",
            "shapes" : 
            [
              
              {
                "type" : "polygon"
              }
            ],
            "vertices" : 
            {
              "x" : 
              [
                -0.01557338237762451,
                0.01557314395904541,
                0.01557314395904541,
                -0.01557338237762451
              ],
              "y" : 
              [
                -0.1605185270309448,
                -0.1605185270309448,
                0.2251464128494263,
                0.2251464128494263
              ]
            }
          }
        ],
        "id" : 6,
        "linearVelocity" : 0,
        "massData-I" : 0.0001624017459107563,
        "massData-center" : 
        {
          "x" : -1.192092895507812e-07,
          "y" : 0.03231394290924072
        },
        "massData-mass" : 0.01201212313026190,
        "name" : "antenna2",
        "position" : 
        {
          "x" : -1.805367946624756,
          "y" : 1.814880132675171
        },
        "type" : "dynamic"
      },
      
      {
        "angle" : 0,
        "angularVelocity" : 0,
        "awake" : true,
        "fixture" : 
        [
          
          {
            "density" : 1.250,
            "filter-categoryBits" : 8,
            "friction" : 0.9800000190734863,
            "id" : 19,
            "name" : "playerfoot4",
            "shapes" : 
            [
              
              {
                "radius" : 0.1042968779802322,
                "type" : "circle"
              }
            ],
            "vertices" : 
            {
              "x" : [ -0.1802209466695786 ],
              "y" : [ 0.1802209317684174 ]
            }
          },
          
          {
            "density" : 1.250,
            "filter-categoryBits" : 8,
            "friction" : 0.9800000190734863,
            "id" : 12,
            "name" : "playerfoot2",
            "shapes" : 
            [
              
              {
                "radius" : 0.1042968779802322,
                "type" : "circle"
              }
            ],
            "vertices" : 
            {
              "x" : [ -1.924221670890347e-08 ],
              "y" : [ 0.2548708915710449 ]
            }
          },
          
          {
            "density" : 1.250,
            "filter-categoryBits" : 8,
            "friction" : 0.9800000190734863,
            "id" : 18,
            "name" : "playerfoot6",
            "shapes" : 
            [
              
              {
                "radius" : 0.1042968779802322,
                "type" : "circle"
              }
            ],
            "vertices" : 
            {
              "x" : [ 0.1802209168672562 ],
              "y" : [ 0.1802209615707397 ]
            }
          },
          
          {
            "density" : 1.250,
            "filter-categoryBits" : 8,
            "friction" : 0.9800000190734863,
            "id" : 11,
            "name" : "fixture1",
            "shapes" : 
            [
              
              {
                "radius" : 0.1042968779802322,
                "type" : "circle"
              }
            ],
            "vertices" : 
            {
              "x" : [ 0.2548708915710449 ],
              "y" : [ -5.247950321063399e-05 ]
            }
          },
          
          {
            "density" : 1.250,
            "filter-categoryBits" : 8,
            "friction" : 0.9800000190734863,
            "id" : 13,
            "name" : "playerfoot0",
            "shapes" : 
            [
              
              {
                "radius" : 0.1042968779802322,
                "type" : "circle"
              }
            ],
            "vertices" : 
            {
              "x" : [ -0.2548708915710449 ],
              "y" : [ 0.0 ]
            }
          },
          
          {
            "density" : 1.250,
            "filter-categoryBits" : 8,
            "friction" : 0.9800000190734863,
            "id" : 15,
            "name" : "playerfoot3",
            "shapes" : 
            [
              
              {
                "radius" : 0.1042968779802322,
                "type" : "circle"
              }
            ],
            "vertices" : 
            {
              "x" : [ -5.246026194072329e-05 ],
              "y" : [ -0.2548708915710449 ]
            }
          },
          
          {
            "density" : 1.250,
            "filter-categoryBits" : 8,
            "friction" : 0.9800000190734863,
            "id" : 1,
            "name" : "playerfoot7",
            "shapes" : 
            [
              
              {
                "radius" : 0.1042968779802322,
                "type" : "circle"
              }
            ],
            "vertices" : 
            {
              "x" : [ -0.1802580207586288 ],
              "y" : [ -0.1801838576793671 ]
            }
          },
          
          {
            "density" : 1.250,
            "filter-categoryBits" : 8,
            "friction" : 0.9800000190734863,
            "id" : 14,
            "name" : "playerfoot5",
            "shapes" : 
            [
              
              {
                "radius" : 0.1042968779802322,
                "type" : "circle"
              }
            ],
            "vertices" : 
            {
              "x" : [ 0.1801838427782059 ],
              "y" : [ -0.180258035659790 ]
            }
          }
        ],
        "id" : 7,
        "linearVelocity" : 0,
        "massData-I" : 0.02405765838921070,
        "massData-center" : 
        {
          "x" : -1.583783705427777e-05,
          "y" : -6.561058853549184e-06
        },
        "massData-mass" : 0.3417373895645142,
        "name" : "playerlower",
        "position" : 
        {
          "x" : 1.279839158058167,
          "y" : 2.483422040939331
        },
        "type" : "dynamic"
      },
      
      {
        "angle" : 0,
        "angularVelocity" : 0,
        "awake" : true,
        "fixture" : 
        [
          
          {
            "density" : 1,
            "friction" : 0.2000000029802322,
            "id" : 8,
            "name" : "antenna1",
            "shapes" : 
            [
              
              {
                "type" : "polygon"
              }
            ],
            "vertices" : 
            {
              "x" : 
              [
                -0.01943159103393555,
                0.0194314718246460,
                0.0194314718246460,
                -0.01943159103393555
              ],
              "y" : 
              [
                -0.2002876996994019,
                -0.2002876996994019,
                0.2002875804901123,
                0.2002875804901123
              ]
            }
          }
        ],
        "id" : 4,
        "linearVelocity" : 0,
        "massData-I" : 0.0002101245918311179,
        "massData-center" : 
        {
          "x" : -5.960464477539062e-08,
          "y" : -5.960464477539062e-08
        },
        "massData-mass" : 0.01556758210062981,
        "name" : "antenna1",
        "position" : 
        {
          "x" : -1.805551290512085,
          "y" : 1.473527073860168
        },
        "type" : "dynamic"
      },
      
      {
        "angle" : 0,
        "angularVelocity" : 0,
        "awake" : true,
        "fixture" : 
        [
          
          {
            "density" : 4.0,
            "friction" : 1,
            "id" : 4,
            "name" : "rearwheel",
            "shapes" : 
            [
              
              {
                "radius" : 0.4391508996486664,
                "type" : "circle"
              }
            ],
            "vertices" : 
            {
              "x" : [ 0.0 ],
              "y" : [ 0.0 ]
            }
          }
        ],
        "id" : 2,
        "linearVelocity" : 0,
        "massData-I" : 0.2336872369050980,
        "massData-mass" : 2.423468828201294,
        "name" : "rearwheel",
        "position" : 
        {
          "x" : -1.281174421310425,
          "y" : 0.4994073510169983
        },
        "type" : "dynamic"
      },
      
      {
        "angle" : 0,
        "angularVelocity" : 0,
        "awake" : true,
        "fixture" : 
        [
          
          {
            "density" : 4.0,
            "friction" : 1,
            "id" : 2,
            "name" : "frontwheel",
            "shapes" : 
            [
              
              {
                "radius" : 0.4391508996486664,
                "type" : "circle"
              }
            ],
            "vertices" : 
            {
              "x" : [ 0.0 ],
              "y" : [ 0.0 ]
            }
          }
        ],
        "id" : 1,
        "linearVelocity" : 0,
        "massData-I" : 0.2336872369050980,
        "massData-mass" : 2.423468828201294,
        "name" : "frontwheel",
        "position" : 
        {
          "x" : 1.646994829177856,
          "y" : 0.4994073510169983
        },
        "type" : "dynamic"
      },
      
      {
        "angle" : 0,
        "angularVelocity" : 0,
        "awake" : true,
        "fixture" : 
        [
          
          {
            "density" : 0.750,
            "friction" : 0.8000000119209290,
            "id" : 6,
            "name" : "carlower",
            "restitution" : 0.1000000014901161,
            "shapes" : 
            [
              
              {
                "type" : "polygon"
              }
            ],
            "vertices" : 
            {
              "x" : 
              [
                2.391760110855103,
                2.371400117874146,
                2.033610105514526,
                -1.823310017585754,
                -2.200170040130615,
                -2.240900039672852,
                -2.064899921417236,
                2.104389905929565
              ],
              "y" : 
              [
                -0.2876459956169128,
                0.1395390033721924,
                0.2991139888763428,
                0.5205680131912231,
                0.334744006395340,
                -0.2985900044441223,
                -0.3891539871692657,
                -0.3894709944725037
              ]
            }
          },
          
          {
            "density" : 0.750,
            "friction" : 0.8000000119209290,
            "id" : 7,
            "name" : "carupper",
            "restitution" : 0.1000000014901161,
            "shapes" : 
            [
              
              {
                "type" : "polygon"
              }
            ],
            "vertices" : 
            {
              "x" : 
              [
                1.208260059356689,
                0.6846150159835815,
                0.419759988784790,
                -0.4459980130195618,
                -0.7959259748458862,
                -1.103929996490479,
                -1.367390036582947
              ],
              "y" : 
              [
                0.3468869924545288,
                0.8653119802474976,
                0.9186699986457825,
                1.001880049705505,
                0.9778829813003540,
                0.8607249855995178,
                0.4947359859943390
              ]
            }
          }
        ],
        "id" : 3,
        "linearVelocity" : 0,
        "massData-I" : 5.389615058898926,
        "massData-center" : 
        {
          "x" : -0.06040599942207336,
          "y" : 0.1643623560667038
        },
        "massData-mass" : 3.529048681259155,
        "name" : "car",
        "position" : 
        {
          "x" : 0.02885369956493378,
          "y" : 0.7808920145034790
        },
        "type" : "dynamic"
      },
      
      {
        "angle" : 0,
        "angularVelocity" : 0,
        "awake" : true,
        "fixedRotation" : true,
        "fixture" : 
        [
          
          {
            "density" : 1.789999961853027,
            "friction" : 0.250,
            "id" : 23,
            "name" : "playerupper",
            "shapes" : 
            [
              
              {
                "type" : "polygon"
              }
            ],
            "vertices" : 
            {
              "x" : 
              [
                0.3002238869667053,
                0.3002237379550934,
                0.2154128700494766,
                -0.2113303095102310,
                -0.3002237379550934,
                -0.3002237081527710,
                -0.2218291610479355,
                0.2283110022544861
              ],
              "y" : 
              [
                -0.4160324931144714,
                0.3051185309886932,
                0.4533979892730713,
                0.4528201818466187,
                0.3051185309886932,
                -0.4160327315330505,
                -0.5100000500679016,
                -0.5108833909034729
              ]
            }
          }
        ],
        "id" : 8,
        "linearVelocity" : 0,
        "massData-I" : 0.001082192873582244,
        "massData-center" : 
        {
          "x" : 0.0003362183924764395,
          "y" : -0.03289639577269554
        },
        "massData-mass" : 0.9999140501022339,
        "name" : "playerupper",
        "position" : 
        {
          "x" : 1.279839158058167,
          "y" : 3.114712476730347
        },
        "type" : "dynamic"
      }
    ],
    "metaimage" : 
    [
      
      {
        "body" : 3,
        "center" : 
        {
          "x" : 0.01010882854461670,
          "y" : 0.2893288135528564
        },
        "file" : "images/carbody.png",
        "filter" : 1,
        "id" : 3,
        "name" : "carbody",
        "opacity" : 0.50,
        "renderOrder" : 1,
        "scale" : 2.507289886474609
      },
      
      {
        "body" : 1,
        "center" : 
        {
          "x" : -0.001794457435607910,
          "y" : -0.004129886627197266
        },
        "file" : "images/carwheel.png",
        "filter" : 1,
        "id" : 2,
        "name" : "frontwheel",
        "opacity" : 1,
        "scale" : 1
      },
      
      {
        "body" : 2,
        "center" : 
        {
          "x" : -0.001794457435607910,
          "y" : -0.004129886627197266
        },
        "file" : "images/carwheel.png",
        "filter" : 1,
        "id" : 1,
        "name" : "rearwheel",
        "opacity" : 1,
        "scale" : 1
      }
    ],
    "metajoint" : 
    [
      
      {
        "anchorA" : 
        {
          "x" : -1.310029983520508,
          "y" : -0.3029899895191193
        },
        "anchorB" : 
        {
          "x" : -0.000221252441406250,
          "y" : 0
        },
        "bodyA" : 3,
        "bodyB" : 2,
        "collideConnected" : false,
        "enableMotor" : true,
        "id" : 1,
        "localAxisA" : 
        {
          "x" : 0,
          "y" : 1
        },
        "maxMotorTorque" : 1,
        "motorSpeed" : 0,
        "name" : "rearwheel",
        "springDampingRatio" : 0.07500000298023224,
        "springFrequency" : 4.0,
        "type" : "wheel"
      },
      
      {
        "anchorA" : 
        {
          "x" : -1.834210038185120,
          "y" : 0.4997670054435730
        },
        "anchorB" : 
        {
          "x" : 0.0001915524917421862,
          "y" : -0.1928684562444687
        },
        "bodyA" : 3,
        "bodyB" : 4,
        "collideConnected" : false,
        "enableLimit" : true,
        "enableMotor" : false,
        "id" : 3,
        "lowerLimit" : -0.4363323152065277,
        "maxMotorTorque" : 0,
        "motorSpeed" : 0,
        "name" : "antennapivot1",
        "referenceAngle" : 0,
        "type" : "revolute",
        "upperLimit" : 0.4363323152065277
      },
      
      {
        "anchorA" : 
        {
          "x" : 1.618139982223511,
          "y" : -0.3086310029029846
        },
        "anchorB" : 
        {
          "x" : 0.001029968261718750,
          "y" : 0
        },
        "bodyA" : 3,
        "bodyB" : 1,
        "collideConnected" : false,
        "enableMotor" : true,
        "id" : 2,
        "localAxisA" : 
        {
          "x" : 0,
          "y" : 1
        },
        "maxMotorTorque" : 1,
        "motorSpeed" : 0,
        "name" : "frontwheel",
        "springDampingRatio" : 0.07500000298023224,
        "springFrequency" : 4.0,
        "type" : "wheel"
      },
      
      {
        "anchorA" : 
        {
          "x" : -2.409670114517212,
          "y" : 0.8091080188751221
        },
        "anchorB" : 
        {
          "x" : 0.001631259918212891,
          "y" : 0.1164729595184326
        },
        "bodyA" : 3,
        "bodyB" : 4,
        "collideConnected" : false,
        "dampingRatio" : 0.6999999880790710,
        "frequency" : 5.0,
        "id" : 5,
        "length" : 0.5768910050392151,
        "name" : "antennaspring1",
        "type" : "distance"
      },
      
      {
        "anchorA" : 
        {
          "x" : 0.0003599907504394650,
          "y" : 0.1867433339357376
        },
        "anchorB" : 
        {
          "x" : 0.0001534871698822826,
          "y" : -0.1545725017786026
        },
        "bodyA" : 4,
        "bodyB" : 6,
        "collideConnected" : false,
        "enableLimit" : true,
        "enableMotor" : false,
        "id" : 4,
        "lowerLimit" : -0.4363323152065277,
        "maxMotorTorque" : 0,
        "motorSpeed" : 0,
        "name" : "antennapivot2",
        "referenceAngle" : 0,
        "type" : "revolute",
        "upperLimit" : 0.4363323152065277
      },
      
      {
        "anchorA" : 
        {
          "x" : 0,
          "y" : -0.7027311325073242
        },
        "anchorB" : 0,
        "bodyA" : 8,
        "bodyB" : 7,
        "collideConnected" : false,
        "enableMotor" : false,
        "id" : 7,
        "localAxisA" : 
        {
          "x" : 0,
          "y" : 1
        },
        "maxMotorTorque" : 0,
        "motorSpeed" : 0,
        "name" : "playerfoot",
        "springDampingRatio" : 0.8000000119209290,
        "springFrequency" : 4.0,
        "type" : "wheel"
      },
      
      {
        "anchorA" : 
        {
          "x" : -0.5752646923065186,
          "y" : 0.4278329610824585
        },
        "anchorB" : 
        {
          "x" : -0.0003728568553924561,
          "y" : 0.0870840996503830
        },
        "bodyA" : 4,
        "bodyB" : 6,
        "collideConnected" : false,
        "dampingRatio" : 0.6999999880790710,
        "frequency" : 5.0,
        "id" : 6,
        "length" : 0.5768910050392151,
        "name" : "antennaspring2",
        "type" : "distance"
      }
    ],
    "positionIterations" : 3,
    "stepsPerSecond" : 60.0,
    "subStepping" : false,
    "velocityIterations" : 8,
    "warmStarting" : true
  }
}
dimecoin
Posts: 8
Joined: Tue Nov 19, 2013 2:57 am

Re: demo scene avaiable?

Post by dimecoin »

Is it a problem with car.json? I took that from version 1.5.2 of the Rube Trail from sameScenes/car.rube. Your readme says that it can't load .rube files directly so I think that is probably the problem.

Unfortunately the trial version doesn't let me export it and doesn't look like it has any "raw/exported" .json to use :(

I guess we are back at my first post :) Anyone have a raw/export .json I could use to test with?
tescott
Posts: 68
Joined: Wed Feb 06, 2013 6:32 pm

Re: demo scene avaiable?

Post by tescott »

Ah. That may be it. You referenced "car.json". Did you just rename the .rube file to a .json then?

See attached for the car.json file.

--tim
Attachments
car.zip
(3.22 KiB) Downloaded 731 times
Last edited by tescott on Tue Nov 26, 2013 3:47 am, edited 1 time in total.
Post Reply