daynamic box problem

hi community...

I'm facing a new strange problem !!
Actually and simply i make a b2_kinematicBody box with

Code: Select all

boxShape.SetAsEdge(leftDown,rightDown);
body->CreateFixture(&newshape,2);
newshape.SetAsEdge(rightDown,rightUp);
.... and so on


Then i put inside him a b2_DynamicBody box and the gravity is b2Vec2(0,-10), then i set the

Code: Select all

boxShape->SetAngularVelocity(4.0f);


and notice that the dynamic box remind in the b2_kinematicBody for a small time and then it run away out the b2_kinematicBody !!

why this occurs ?! the b2_kinematicBody box is close and really i need the Angular Velocity stay to 4.0 and not need to decrease it

how can i fix this ??

Any idea?? 😀 😀
Since the edges of the kinematic body are so thin, it's possible that the dynamic body inside it can go right through the walls in one timestep when it is spinning fast. To fix this you could:
- slow down the kinematic body
- use thin box shapes instead of edges for the kinematic body
- use CCD for the dynamic body (SetBullet)
@irresistible force ..
thanks for replay 🙂

i did like what you said...
i used a boxes Instead of edges and the dynamic box remains inside the area that i need.
BUT the dynamic box sometimes merge with the other objects in side this area so i used
CCD like what you said
,,,the problem here that after use CCD the dynamic box sometimes
stick on edges for some other objects inside the area..


how can i fix this??
what you suggest??:D
I can't imagine what the situation is... what do you mean by 'merge with other objects'? Maybe you should post a picture or something.

Original thread: https://box2d.org/forum/viewtopic.php?t=7111