How to merge two fixtures?

General discussion about the R.U.B.E editor
Post Reply
genidoi
Posts: 3
Joined: Sun May 04, 2014 9:37 pm

How to merge two fixtures?

Post 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?
iforce2d
Site Admin
Posts: 861
Joined: Sat Dec 22, 2012 7:20 pm

Re: How to merge two fixtures?

Post by iforce2d »

iforce2d
Site Admin
Posts: 861
Joined: Sat Dec 22, 2012 7:20 pm

Re: How to merge two fixtures?

Post by iforce2d »

https://www.youtube.com/watch?v=K-VzlEtXdJM

(click the notation at the beginning to go to 29:09)
genidoi
Posts: 3
Joined: Sun May 04, 2014 9:37 pm

Re: How to merge two fixtures?

Post 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?
iforce2d
Site Admin
Posts: 861
Joined: Sat Dec 22, 2012 7:20 pm

Re: How to merge two fixtures?

Post 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.
Post Reply