Box2D Forums

It is currently Mon May 20, 2013 9:04 am

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 15 posts ]  Go to page Previous  1, 2
Author Message
PostPosted: Sun Feb 05, 2012 2:58 am 
Offline

Joined: Sun Dec 25, 2011 3:41 pm
Posts: 18
toucansam wrote:
can you verify which version of the engine you're using?


From the pom.xml file I find "version: 2.1.2.1".
I also use Fizzy wrapper, so creating the bodies is a little easier. I hope you don't blame Fizzy, since the wrapper is so simple that I don't think it's causing the bug. Well, I could be wrong.

Here's why I think the body's reference point has something to do with the bug:
When I create a body using the coordinates {9.6 , 2.5} , {10.0 , 2.5} , {10.0 , 10.0} , {9.6 , 10.0} with a reference point 0,0
I get the bug.
But when I use coordinates {-0.2 , -3.75} , {0.2 , -3.75} , {0.2 , 3.75} , {-0.2 , 3.75} with the reference point at 9.8 , 6.25
the bug disappears. Now the reference point (the body's origin) is at the center of the body. The body is still at the same location, with the same measurements. You can double-check the coordinates.

EDIT:
okay, just found out the bug occurs only when a box (rectangle) collides with the wall. Circles collide correctly.

The problem might be in JBox2D, since the world's physics update in Fizzy calls only two methods:
Code:
jboxWorld.step(timeStep, velocityIterations, positionIterations);
resolveOutOfBounds();

This means that Fizzy has nothing to do with the actual physics simulation. Now, this could mean that either there is a bug in JBox2D, or Fizzy gives some crazy values for the jbox bodies. What do you guys think?


Top
 Profile  
 
PostPosted: Sun Feb 05, 2012 10:06 pm 
Offline

Joined: Fri Oct 29, 2010 1:47 am
Posts: 29
I had a problem like this when my polygon shapes were not ordered right (points in wrong order)
things teleported through them. If you make a dynamic box shape for the character and static / 0 density box shape walls you shouldn't have a problem.
Try make everything dynamic out of boxes and circles (add multiple box/circle shapes to 1 body if you want), and use 0 density box shape/circle shapes or edge shapes for static stuff. Works for me.

Definitely check out the latest version (2.1.2.2), it fixed one of my bugs.
And try not using that wrapper. Make your own :)


Top
 Profile  
 
PostPosted: Sun Feb 05, 2012 10:38 pm 
Offline

Joined: Fri Oct 29, 2010 1:47 am
Posts: 29
pekhe wrote:

The problem might be in JBox2D, since the world's physics update in Fizzy calls only two methods:
Code:
jboxWorld.step(timeStep, velocityIterations, positionIterations);
resolveOutOfBounds();

This means that Fizzy has nothing to do with the actual physics simulation. Now, this could mean that either there is a bug in JBox2D, or Fizzy gives some crazy values for the jbox bodies. What do you guys think?

The problem will be in the creation of the shape, not the simulation (update) method


Top
 Profile  
 
PostPosted: Mon Feb 06, 2012 8:50 am 
Offline

Joined: Sun Dec 25, 2011 3:41 pm
Posts: 18
Okay, maybe I should study more on how JBox2D works, and then build my own wrapper.


Top
 Profile  
 
PostPosted: Mon Feb 06, 2012 8:52 am 
Offline

Joined: Mon Jun 08, 2009 12:21 pm
Posts: 353
Yes, please use the 2.1.2.2 version, it will probably fix this. I should make an official 2.1.2.2 release soon


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 15 posts ]  Go to page Previous  1, 2

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group