Box2D Forums

It is currently Fri Apr 18, 2014 4:48 pm

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Mon May 30, 2011 10:36 am 
Offline

Joined: Tue Jun 09, 2009 9:55 am
Posts: 1
Hi !
I'm using pyBox2D 2.0.2b2 and I get this error when I try to run the testbed examples:

Code:
TypeError: "DrawSolidPolygon() takes exactly 4 arguments (3 given) Swig director method error Error detected when calling 'b2DebugDraw.DrawSolidPolygon'"


Is this related to my installation of box2D ?

Thanks :)


Top
 Profile  
 
PostPosted: Tue May 31, 2011 12:54 pm 
Offline

Joined: Mon Feb 18, 2008 12:30 am
Posts: 88
Hi MrGecko,

I believe the problem is that I did not inform users properly about the upgrades I did for the old pybox2d 2.0.2b1 (I've really only been working on the 2.1 version and the pure Python port recently).

It was initially just a quick fix for the memory leak that I had found. But then I figured "what the heck", and gave it a few niceties such as removing the ugly getAsType(), and removing the redundant polygon vertex count from the parameter lists of b2DebugDraw -- which the bug you are running into now. I'll have to document these changes sometime, but my hope is that any remaining users will move to 2.1 soon.

TL;DR: Remove the vertex_count parameter, and it should work again.

kne


Top
 Profile  
 
PostPosted: Fri Jul 01, 2011 4:14 pm 
Offline

Joined: Fri Jul 01, 2011 4:07 pm
Posts: 1
Hi,
Could you be more specific about which files must be fixed? I couldn't find the VertexCount parameter you mentioned.

Cheers


Top
 Profile  
 
PostPosted: Fri Jul 08, 2011 7:07 pm 
Offline

Joined: Mon Feb 18, 2008 12:30 am
Posts: 88
midnite_cowboy,

Sorry for the late response --

As you can see in this diff, vertexCount parameters in the Draw*Polygon callbacks of b2DebugDraw have been removed. The same is also true for all other backends (pyglet, etc.). This means if you are using debug drawing you should change in either your debug drawing code or mine (e.g., pygame_main.py):
Code:
    def DrawSolidPolygon(self, vertices, vertexCount, color):   

to
Code:
    def DrawSolidPolygon(self, vertices, color):   

The same goes for DrawPolygon.


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