Page 1 of 1

How to merge two fixtures?

Posted: Wed Nov 19, 2014 3:39 am
by genidoi
So theres a button in the "fixture" menu that allows you to join two fixtures together but its always greyed out no matter what I do. How do I ungrey it?

Re: How to merge two fixtures?

Posted: Wed Nov 19, 2014 3:45 am
by iforce2d

Re: How to merge two fixtures?

Posted: Wed Nov 19, 2014 3:47 am
by iforce2d
https://www.youtube.com/watch?v=K-VzlEtXdJM

(click the notation at the beginning to go to 29:09)

Re: How to merge two fixtures?

Posted: Thu Nov 20, 2014 1:22 am
by genidoi
Thanks for the quick response!

Also this may be specific to LibGDX but is there any way to not automatically add the bodies to the world upon loading it as a scene using RubeLoader? I'm making a game where theres lots of different obstacles (barricades, barrels, cars etc) that I need to randomly create, so I use Box2DUtils to duplicate the body in the rube scene but the problem is that when I load the scene it automatically adds the actual scene (which is just one copy of all the different obstacles arranged next to eachother) to the world.

EDIT: What I'm currently doing is moving the bodies the scene creates waaay off screen, ie

Code: Select all

for (int i = 0; i < scene.getBodies().size; i++) {
	 scene.getBodies().get(i).setTransform(1000 + 10*i, 1000 + 10*i, 0);
}
This is obviously a very bad, hacky solution though. Any alternatives?

Re: How to merge two fixtures?

Posted: Thu Nov 20, 2014 5:48 pm
by iforce2d
Maybe you would find it easier to load the obstacles from separate .json files
viewtopic.php?f=6&t=254

Let me know if none of that is useful. There would be a small time delay incurred when loading like that though - if it turned out to be a problem, the way you are doing it now might actually be the best.