New version of Box2D

  ... the case you feel the need for a new feature or want to submit one.

Re: New version of Box2D

Postby nazgee » Wed Jan 02, 2013 12:23 am

Huh? You're saying you have to use my version of AndEngine? Strange... What happens if you use Nicolas' version?
I believe this setup should work:

- AndEnginePhysicsBox2DExtension; hrabia / RealFictionFactory
- AndEngine; nicolasgramlich
- AndEngineDebugDrawExtension; nazgee

doesn't it?
Dirt Rider Mayhem is PUBLISHED now!
Image
User avatar
nazgee
 
Posts: 527
Joined: Fri Oct 21, 2011 10:31 pm
Location: Poland, Wrocław

Re: New version of Box2D

Postby RealMayo » Wed Jan 02, 2013 12:34 am

I just tested everything again, and you're right, it works fine with Nicolas' copy of AndEngine. I don't know what I was doing before :oops:
User avatar
RealMayo
 
Posts: 1694
Joined: Sat Sep 03, 2011 9:25 pm
Location: Chicago, IL

Re: New version of Box2D

Postby lintfordpickle » Sat Jan 12, 2013 3:52 pm

Hi everyone,

Thanks a lot for taking the time to create these updates.

I don't know if I am missing the functions, but I don't seem to be able to set 'ghost vertices' on edge shapes as per the box2d manual. Can anyone let me know if t hey are included or maybe how I should be using them (if different from the manual).

thanks,
lintfordpickle
 
Posts: 54
Joined: Thu Dec 15, 2011 5:43 pm
Location: Krefeld, Germany

Re: New version of Box2D

Postby korn3l » Tue Jan 15, 2013 12:15 am

Ghost vertices are not implemented. See changelog.
EdgeShape.java (new)
- implementation
- [missing see Java stubs and commented sections], notably, no ghost edges, use ChainShape instead.
korn3l
 
Posts: 214
Joined: Thu Apr 12, 2012 4:20 pm
Location: Iasi, Romania

Re: New version of Box2D

Postby sjkm » Sat Jan 26, 2013 1:40 pm

Hey,

Could please anyone enlighten me how that multiple fixtures on a body work?
I have a "base" body:
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. Body = PhysicsFactory.createCircleBody(PhysicsWorld, CenterX, CenterY, Radius, BodyType.DynamicBody, FIXTURE_DEF);
Parsed in 0.010 seconds, using GeSHi 1.0.8.4

And I want to add a small fixture to the body like that:
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. final CircleShape headCircleShape = new CircleShape();
  2. headCircleShape .setRadius(RadiusHead);
  3. headCircleShape .setPosition(new Vector2(CenterX, CenterY));
  4. Body.createFixture(headCircleShape , FIXTURE_DEF.density);
Parsed in 0.010 seconds, using GeSHi 1.0.8.4

My issue is that the mass of the body seems to be less than without the head circle.
body.setMassData() and body.resetMassData() don't seem to take effect.

I thought by adding a fixture to a body box2d adds the mass of the fixture to the mass of the body...doesnt' it?

Thank you guys!

Regards
sjkm
sjkm
 
Posts: 25
Joined: Sun May 20, 2012 12:43 pm
Location: Zurich, Switzerland

Re: New version of Box2D

Postby Mathew » Sun Feb 03, 2013 1:41 pm

As I can see this version support rope joint, does any one tried to create verlet style rope?
User avatar
Mathew
 
Posts: 1073
Joined: Sun Jul 31, 2011 2:49 pm
Location: Tarnów, Poland

Re: New version of Box2D

Postby nazgee » Sun Feb 03, 2013 3:32 pm

I did. Works... strange. Acceptable for my case.
Dirt Rider Mayhem is PUBLISHED now!
Image
User avatar
nazgee
 
Posts: 527
Joined: Fri Oct 21, 2011 10:31 pm
Location: Poland, Wrocław

Re: New version of Box2D

Postby Mathew » Sun Feb 03, 2013 3:41 pm

Have you managed to make it NOT fixed length? allowing to resize it on runtime? I am currently using distance joint, rendering line between anchor points, but its not perfect solution (with distance joint I can easily adjust length)
User avatar
Mathew
 
Posts: 1073
Joined: Sun Jul 31, 2011 2:49 pm
Location: Tarnów, Poland

Re: New version of Box2D

Postby nazgee » Sun Feb 03, 2013 4:00 pm

I have not tried changind distance dynamically, and I do not plan to try it in future. You're on your own :)

I am planning to share my verlet rope at some point, but again- you probably do not need it right now (since you already are rendering the rope). What I do not like about verlets is how floaty they are. I would prefer them to be a little bit less elastic... Maybe it is just a matter of creating different (non-linear) verlet structure? Nevermind, let's not go off topic here :)
Dirt Rider Mayhem is PUBLISHED now!
Image
User avatar
nazgee
 
Posts: 527
Joined: Fri Oct 21, 2011 10:31 pm
Location: Poland, Wrocław

Re: New version of Box2D

Postby sjkm » Sun Feb 03, 2013 9:20 pm

I did implement a rope using the verlet algorithm.
I was able to create a solution that allows me to resize the rope.

Steps you have to do to implement this feature:
1. implement verlet
2. extend the algorthm so that the max size of a segment is changable
3. use setLength of ropejoint and update the segments with its lenght

regards
Last edited by sjkm on Tue Feb 05, 2013 11:33 am, edited 1 time in total.
sjkm
 
Posts: 25
Joined: Sun May 20, 2012 12:43 pm
Location: Zurich, Switzerland

PreviousNext

Return to Features

Who is online

Users browsing this forum: Google [Bot] and 4 guests