Cannot access Box2d objects in the R.U.B.E examples!!

General discussion about the R.U.B.E editor
Post Reply
arnzzz
Posts: 1
Joined: Tue Aug 26, 2014 1:51 pm

Cannot access Box2d objects in the R.U.B.E examples!!

Post by arnzzz »

Hey guys,

I am new to RUBE/LibGDX and ive purchased R.U.B.E in the hope of speeding up some development.

Unfortunately the rube loader for LibGDX that is created by tescott (https://github.com/tescott/RubeLoader), although being fantastic, is a bit to complicated for me to understand :(

I've got the example project running and displaying the palm trees etc, but the problem I have now is how to access the box2d objects to manipulate them?

For example there is a kinematic object in the scene which its Angular velocity is set at 90/second. How do I access this on a keypress to change this value during run time??

After reading the README on github I thought i would use something like "Body body3 = mScene.getNamed(Body, body3);" to access the 'body3' Body object from the rube scene. But this doesn't work!!

Please guys any help is really appreciated. Its my fault as if i had done some more research i would have realized there isn't any real documentation for this tool with regards to LibGDX.

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

Re: Cannot access Box2d objects in the R.U.B.E examples!!

Post by iforce2d »

Sorry I can't help much with that loader, but in the meantime I would encourage you to elaborate on what exactly you mean by "doesn't work". That phrase is kinda a pet-peeve of mine and I almost modified the code of these forums to reject posts that contained those two words together :D There is always a better way to describe the problem you're seeing.

Having said that though, it looks like the example for that loader uses the getNamed function here:
https://github.com/tescott/RubeLoader/b ... .java#L364
Does the example print out that "body0 count: " text ok? If so, perhaps you could try to find where your code does something differently to that example.
Post Reply