Box2D Forums

It is currently Sat May 25, 2013 5:56 pm

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Wed Dec 14, 2011 1:51 am 
Offline

Joined: Sat Feb 05, 2011 8:51 pm
Posts: 30
Very strange issue with b2ChainShape. When creating a chain with just two vertices, it works fine:
Code:
--X, Y, R, G, B, A
   {10,   5,      1,   1,   1,   1},
   {110,   5,      1,   0,   0,   1}


But I wanted to break that line into several small segments of different colours:
Code:
--X, Y, R, G, B, A
   {10,   5,      1,   1,   1,   1},
   {20,   5,      1,   0,   0,   1},
   {30,   5,      1,   1,   1,   1},
   {40,   5,      1,   0,   0,   1},
   {50,   5,      1,   1,   1,   1},
   {60,   5,      1,   0,   0,   1},
   {70,   5,      1,   1,   1,   1},
   {80,   5,      1,   0,   0,   1},
   {90,   5,      1,   1,   1,   1},
   {100,   5,      1,   0,   0,   1},
   {110,   5,      1,   1,   1,   1}

With this setup, a box falls onto the line and immediately rotates to some strange angle and gets stuck inside it.


Top
 Profile  
 
PostPosted: Mon Dec 19, 2011 12:30 am 
Offline
Site Admin

Joined: Thu Sep 06, 2007 12:34 am
Posts: 2931
I'm not seeing this problem. Please use b2World::Dump and file an issue here:

http://code.google.com/p/box2d/issues/list


Top
 Profile  
 
PostPosted: Tue Mar 06, 2012 10:57 pm 
Offline

Joined: Sat Feb 05, 2011 8:51 pm
Posts: 30
Sorry for the delay. Here's a dump of the level. I haven't been able to actually compile the testbed program, so maybe there's an obvious issue that's just not showing up in my engine?

The rectangle at the right is the player character, and falls onto the long straight line below, where it then gets stuck inside.


Attachments:
leveldump.c [8.87 KiB]
Downloaded 68 times
Top
 Profile  
 
PostPosted: Wed Mar 07, 2012 2:21 am 
Offline

Joined: Tue Jun 24, 2008 8:25 pm
Posts: 1518
Location: Tokyo
The problem seems to be caused by the first and last vertices being the same, making the final segment co-incident with the first ten segments. I think this would qualify as a self-intersecting chain which are not supported.


Top
 Profile  
 
PostPosted: Wed Mar 07, 2012 2:27 am 
Offline

Joined: Sat Feb 05, 2011 8:51 pm
Posts: 30
Aha, I knew it'd be something dumb like that. I forgot to specify an open polygon in my level definition. :oops: Thanks!


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

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: Exabot [Bot] 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