You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 22, 2024. It is now read-only.
If you create a body, defining it as static in BodyDef. And then you will try to transform to another position (even slightly), then it becomes completely broken. Collisions mostly stop working. Dynamic bodies don't interact with it, flying through, get pushed in random locations.
But debug draw draws them correctly.
To reproduce use this code for static bodies in Tiles Test:
float a = 0.5f;
int32 N = 200;
int32 M = 10;
b2Vec2 position;
position.y = 0.0f;
for (int32 j = 0; j < M; ++j)
{
position.x = -N * a;
for (int32 i = 0; i < N; ++i)
{
b2BodyDef bd;
bd.position = position;
b2Body* ground = m_world->CreateBody(&bd);
b2PolygonShape shape;
shape.SetAsBox(a, a);
ground->CreateFixture(&shape, 0.0f);
++m_fixtureCount;
position.x += 2.0f * a;
ground->SetTransform(position+b2Vec2(-1, -1), 0.1);
}
position.y -= 2.0f * a;
}
The text was updated successfully, but these errors were encountered:
RonYanDaik
changed the title
[bug] Static bodys get broken if its transform changed after creation.
[bug] Static bodies get broken if its transform changed after creation.
Apr 5, 2023
If you create a body, defining it as static in BodyDef. And then you will try to transform to another position (even slightly), then it becomes completely broken. Collisions mostly stop working. Dynamic bodies don't interact with it, flying through, get pushed in random locations.
But debug draw draws them correctly.
To reproduce use this code for static bodies in Tiles Test:
The text was updated successfully, but these errors were encountered: