I'm using Box2D and Kobold2D to make an iPhone game. It involves b2ChainShape "roads" that an object will slide down. However, the object snags on certain vertices, and I can't figure out why.
The object is a body with two fixtures attached to it. The shapes of the fixtures are b2PolygonShapes defined as such:
Occasionally, when passing over a peak in the b2ChainShape road, it snags and is pushed back. Any advice on how to fix this problem would be appreciated.
The object is a body with two fixtures attached to it. The shapes of the fixtures are b2PolygonShapes defined as such:
Code: Select all
b2Vec2 b[6] = {
b2Vec2(-5.5f, -1.0f),
b2Vec2(-5.5f, -2.0f),
b2Vec2(-3.5f, -3.0f),
b2Vec2(3.5f, -3.0f),
b2Vec2(5.5, -2.0f),
b2Vec2(5.5, -1.0f)
};
shape1.Set(b, 6);
b2Vec2 d[4] = {
b2Vec2(-2.5f, 3.0f),
b2Vec2(-2.5f, -1.0f),
b2Vec2(2.5f, -1.0f),
b2Vec2(2.5f, 3.0f)
};
shape2.Set(d, 4);
Occasionally, when passing over a peak in the b2ChainShape road, it snags and is pushed back. Any advice on how to fix this problem would be appreciated.