Box2D Forums

It is currently Mon May 20, 2013 6:36 am

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Sat Jun 09, 2012 9:38 pm 
Offline

Joined: Sat Jun 09, 2012 9:20 pm
Posts: 1
I'm a complete newbie to Box2D and I am forced to work on an older version of Jbox2d that has EdgeChainDef.
Basically I'm trying to achieve a hollow polygon ( a circle or an arc ). I have computed the points Vo..Vn in the anti-clockwise direction ( Vo is not equal to Vn ). I then try to create an EdgeChainDef with these points using the following code.

Code:
        EdgeChainDef pd = new EdgeChainDef();
      
   pd.density = density;
   for (Vec2 vertex : vertices) {
      pd.addVertex(vertex);
   }
   pd.setIsLoop(false);

        body.createShape(pd)


I then create some dynamic bodies made out of regular polygondefs that fly around the screen. These objects collide with the edgechain from only one side. I want them to collide from both sides of the edge chain. What am I doing wrong here?

Also, if the method I'm using to create a static wall like above is not good, please suggest a better way to create static shapes.


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

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