Box2D Forums

It is currently Fri May 24, 2013 9:36 am

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: daynamic box problem
PostPosted: Fri Jun 10, 2011 1:44 pm 
Offline

Joined: Mon Jun 06, 2011 2:23 am
Posts: 20
hi community...

I'm facing a new strange problem !!
Actually and simply i make a b2_kinematicBody box with
Code:
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:
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?? :D :D


Top
 Profile  
 
 Post subject: Re: daynamic box problem
PostPosted: Fri Jun 10, 2011 9:16 pm 
Offline

Joined: Tue Jun 24, 2008 8:25 pm
Posts: 1517
Location: Tokyo
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)


Top
 Profile  
 
 Post subject: Re: daynamic box problem
PostPosted: Sat Jun 11, 2011 8:55 am 
Offline

Joined: Mon Jun 06, 2011 2:23 am
Posts: 20
@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


Top
 Profile  
 
 Post subject: Re: daynamic box problem
PostPosted: Sat Jun 11, 2011 1:51 pm 
Offline

Joined: Tue Jun 24, 2008 8:25 pm
Posts: 1517
Location: Tokyo
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


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