0xtob wrote:
Hardwire, I merged your fixes into my box2d tree, so they'll be in the next release.
It turns out merging changes by hand diffing against the official SVN and uploading the diff to my website certainly isn't an easy or clean way to manage the fixed "branch" of Box2D. Also, it's impossible to keep up with the official SVN, since every time SVN is updated, I would have to check out the new revision, apply the fixed point patch to it and make sure it compiles and runs. Luckily, Erin agreed to accept a patch once Box2D 2.0 is final, which is probably going to make things easier. I'm not sure though if the fixed point changes should be in the official main branch, since I'm still struggling with several numerical problems and would not consider the fixed-point version very stable.
So, a question for the SCM savvy prople in here: What would be a good way to manage the fixed point changes such that they are easy to maintain?
I detected another problem with the fixed-point version.
I set 30hz and 10 iterations. Gravity -10.0f. Then I set up the pyramid demo, but with only 10 rows and columns:
Code:
{
b2PolygonDef sd;
sd.SetAsBox(50.0f, 10.0f);
b2BodyDef bd;
bd.position.Set(0.0f, -10.0f);
bd.AddShape(m_world->Create(&sd));
m_world->Create(&bd);
}
{
b2PolygonDef sd;
float32 a = 0.5f;
sd.SetAsBox(a, a);
sd.density = 5.0f;
b2Vec2 x(-10.0f, 0.75f);
b2Vec2 y;
b2Vec2 deltaX(0.5625f, 2.0f);
b2Vec2 deltaY(1.125f, 0.0f);
for (int32 i = 0; i < 10; ++i)
{
y = x;
for (int32 j = i; j < 10; ++j)
{
b2BodyDef bd;
bd.AddShape(m_world->Create(&sd));
bd.position = y;
m_world->Create(&bd);
y += deltaY;
}
x += deltaX;
}
}
One thing is that with TARGET_FLOAT32_IS_FIXED the pyramid falls and doesn't sleep. But it's ok, I expected this kind of problems:)
Another thing is that after few seconds an assert is raised. It is on line 145. denom is <0. If I removed this assert, nothing bad happened, but probably it is not very ok
😛If you won't be able to reproduce this problem, just ignore it, because I use a bit different version of Box2D with same changes regarding Symbian platform.