Search found 8 matches

by notnowlewis
Mon Aug 26, 2013 10:54 pm
Forum: Bug reports
Topic: Removing a body does not remove it from mBodiesByName (java)
Replies: 3
Views: 9666

Re: Removing a body does not remove it from mBodiesByName (j

Sorry, my mistake, it's the java rube loader linked to from your blog, my sleep deprived mind thought this would be the place to submit a bug for it... ignore me! :)
by notnowlewis
Mon Aug 26, 2013 7:02 pm
Forum: Bug reports
Topic: Removing a body does not remove it from mBodiesByName (java)
Replies: 3
Views: 9666

Removing a body does not remove it from mBodiesByName (java)

This seems pretty simple to reproduce: scene.putNamed("mybody", myBody); System.println.out(scene.getNamed(Body.class, "mybody").size); // 1 scene.getWorld.destroyBody(myBody); System.println.out(scene.getNamed(Body.class, "mybody").size); // should be 0, is still 1 Thi...
by notnowlewis
Fri Aug 02, 2013 10:13 am
Forum: Box2D tutorial discussion
Topic: libgdx + rub + noob questions ... :P
Replies: 1
Views: 8292

Re: libgdx + rub + noob questions ... :P

Quick solution to your first question: In RUBE, you have a list of bodies on the left. You'll see them as body0, body1, body2... Double click one of them. Then you can type a new name, so you can change it to ball Then you can get the ball in your code this way: Body ball = scene.getNamed(Body.class...
by notnowlewis
Thu Aug 01, 2013 10:06 pm
Forum: R.U.B.E discussion
Topic: Merging fixtures
Replies: 1
Views: 4847

Merging fixtures

Simple question (I think!)

I have two line fixtures, both parts of my terrain. I want to merge them together so they are a single line instead of two lines. Is there a way to do that?

Thanks!
by notnowlewis
Thu Jul 11, 2013 4:47 pm
Forum: Box2D tutorial discussion
Topic: Fill a fixture with a texture
Replies: 5
Views: 14615

Re: Fill a fixture with a texture

Ok, after lots of reading I found a solution! You have to draw each triangle in turn, setting the texture coords after each vertex so that the texture doesn't get warped. I'll end up writing a class that acts like an SFML Drawable, but is constructed with a box2d fixture and a texture, and will draw...
by notnowlewis
Thu Jul 11, 2013 11:27 am
Forum: Box2D tutorial discussion
Topic: Fill a fixture with a texture
Replies: 5
Views: 14615

Re: Fill a fixture with a texture

So, after reading through your LD entry and the opengl red book, I almost have this working :) I use poly2tri to carry out the Delaunay triangulation, and I have the following // three points and an associated box2d body struct myTriangle { b2Body* m_body; b2Vec2 m_points[3]; }; ... lots of vertex/c...
by notnowlewis
Wed Jul 10, 2013 11:54 am
Forum: Box2D tutorial discussion
Topic: Fill a fixture with a texture
Replies: 5
Views: 14615

Re: Fill a fixture with a texture

Wow, thank you! That's the single most useful thing I've read so far! I really need to learn more low level OpenGL, I've been spoiled by cocos2d for too long...
by notnowlewis
Tue Jul 09, 2013 7:54 pm
Forum: Box2D tutorial discussion
Topic: Fill a fixture with a texture
Replies: 5
Views: 14615

Fill a fixture with a texture

I know this is a bit off topic, but this is the best site I've found about box2d, drawing polygons, etc. so hopefully someone will know the answer to this... I have drawn my terrain using RUBE, saved to json, and loaded it into my world in my C++ code. Now I want to fill that terrain with my texture...