Box2D Forums

It is currently Sat May 25, 2013 8:19 am

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 118 posts ]  Go to page Previous  1 ... 8, 9, 10, 11, 12
Author Message
PostPosted: Thu Dec 20, 2007 4:53 pm 
Offline

Joined: Tue Dec 11, 2007 3:05 am
Posts: 106
I think you must do this manually check the b2Body.GetLinearVelocity() and take proper action.


Top
 Profile  
 
PostPosted: Fri Dec 21, 2007 1:24 am 
Offline

Joined: Wed Nov 21, 2007 5:08 am
Posts: 19
Ygryggil wrote:
I think you must do this manually check the b2Body.GetLinearVelocity() and take proper action.

it works, thanks!


Top
 Profile  
 
PostPosted: Thu Dec 27, 2007 4:43 am 
Offline

Joined: Wed Nov 21, 2007 5:08 am
Posts: 19
I'm working with polygons, but I've found that the default limit for vertices (8) is very small, is there any reason (i.e. performance, etc.) to set it so small, or can I increase it without problems?
I changed the default value to 10 (I use stars with 10 vertices), could you increase the default a bit in the next releases?

MOD:
and an other question: I'd like my star to continuosly rotate but staying in place (like I've pinned it to the wall)
how can I do this? I think I have to use a constraint but in the docs I haven't found anything about using constraints. The other way I've found is using joints, for example use a distance joint with 0 distance, but to do this I would have two bodies, and I have only my star. Or should I create a static body and use the distance joint on that body and my star?


Top
 Profile  
 
PostPosted: Thu Dec 27, 2007 6:35 am 
Offline

Joined: Sun Sep 23, 2007 3:57 am
Posts: 70
Location: Here
The reason is, because shapes must be convex, and once you get to 8 vertices in a convex shape, it looks more or less curved. To create a start shape you have to use multiple shapes ;) For a five sided star, you should use five diamond shapes in the body.


Top
 Profile  
 
PostPosted: Thu Dec 27, 2007 6:54 am 
Offline

Joined: Wed Nov 21, 2007 5:08 am
Posts: 19
Diggsey wrote:
The reason is, because shapes must be convex, and once you get to 8 vertices in a convex shape, it looks more or less curved. To create a start shape you have to use multiple shapes ;) For a five sided star, you should use five diamond shapes in the body.

oh, thanks
and you answered my not-asked question too, 'coz I noticed that collision with my non-convex star is not correct :)
so I will use five triangles instead of one star

and now I have an other question regarding Revolute joints, but I will start a new thread for it...


Top
 Profile  
 
PostPosted: Mon Dec 31, 2007 8:39 am 
Offline

Joined: Sat Dec 15, 2007 2:03 pm
Posts: 22
Hello.
In last version (1.4.3) that my machine began to go, I should make m_maxMotorTorque = 1000000000; Why it is necessary to set such large value? In the previous version (1.4.2) it is enough m_maxMotorTorque = 1000;


Top
 Profile  
 
PostPosted: Mon Dec 31, 2007 9:27 am 
Offline

Joined: Wed Nov 21, 2007 5:08 am
Posts: 19
Freeeeeeeman wrote:
Hello.
In last version (1.4.3) that my machine began to go, I should make m_maxMotorTorque = 1000000000; Why it is necessary to set such large value? In the previous version (1.4.2) it is enough m_maxMotorTorque = 1000;

I think it's because of the scale, in the previous versions by default Box2D used meters, but now it's in pixels


Top
 Profile  
 
PostPosted: Mon Dec 31, 2007 9:54 am 
Offline

Joined: Sat Dec 15, 2007 2:03 pm
Posts: 22
How find out size in meters?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 118 posts ]  Go to page Previous  1 ... 8, 9, 10, 11, 12

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 3 guests


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