Chipmunk 4.0.0 released.

Official forum for the Chipmunk2D Physics Library.

Chipmunk 4.0.0 released.

Postby slembcke » Sun Oct 28, 2007 1:29 am

Not a huge upgrade, but here it is:

http://files.slembcke.net/chipmunk/release/ChipmunkLatest.tgz

From the release notes:
  • Rational Versioning: Hopefully this will encourage me to make smaller, but more frequent releases.
  • Optimizations: Speed increases of 5-10% should be common.
  • Groove joint: Similar to a pivot joint, but one of the anchors is on a linear slide instead of being fixed.
  • Commenting/Refactoring: The code should be much easier to follow now.
  • Official build paths for Linux and Windows.

If there are any obvious issues right away let me know. I wasn't able to test the CMake files fully, or the MSVC project file. If there are still build hiccups I will try to fix those ASAP.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
User avatar
slembcke
Site Admin
 
Posts: 4164
Joined: Tue Aug 14, 2007 7:13 pm

Re: Chipmunk 4.0.0 released.

Postby lucas » Sun Oct 28, 2007 3:03 am

*Dances*
Tangame - a tangram puzzle game with physics.
http://code.google.com/p/tangame/
lucas
 
Posts: 54
Joined: Wed Sep 26, 2007 2:34 am

Re: Chipmunk 4.0.0 released.

Postby joshcryer » Sun Oct 28, 2007 3:31 am

With MSVC2k5 using the default solution I get 9 errors.


Code: Select all
problem lines (last line is the error):

   int num = 5;
   cpVect verts[num];

error:

c:\programs\chipmunk-4.0.0\demo\demo3.c(69) : error C2057: expected constant expression
c:\programs\chipmunk-4.0.0\demo\demo3.c(69) : error C2466: cannot allocate an array of constant size 0
c:\programs\chipmunk-4.0.0\demo\demo3.c(69) : error C2133: 'verts' : unknown size




Code: Select all
problem lines (last line is the error):

cpMomentForPoly(cpFloat m, const int numVerts, cpVect *verts, cpVect offset)
{
   cpVect tVerts[numVerts];

c:\programs\chipmunk-4.0.0\src\chipmunk.c(48) : error C2057: expected constant expression
c:\programs\chipmunk-4.0.0\src\chipmunk.c(48) : error C2466: cannot allocate an array of constant size 0
c:\programs\chipmunk-4.0.0\src\chipmunk.c(48) : error C2133: 'tVerts' : unknown size


Code: Select all
problem line:

   cpFloat non_zero_dist = (dist ? dist : INFINITY);

c:\programs\chipmunk-4.0.0\src\cpcollision.c(45) : error C2177: constant too big


Code: Select all
problem line:

   jnt->n = cpvmult(delta, 1.0f/(dist ? dist : INFINITY));

c:\programs\chipmunk-4.0.0\src\cpjoint.c(57) : error C2177: constant too big


Code: Select all
problem line:

   jnt->n = cpvmult(delta, 1.0f/(dist ? dist : INFINITY));

c:\programs\chipmunk-4.0.0\src\cpjoint.c(170) : error C2177: constant too big


I don't know why it's complaining about "constant arrays" since at least with regards to the function cpMomentForPoly it is indeed being passed a const, it *shouldn't* be throwing that error *at all*. It's just very weird. Also, INFINITY is defined as '(1e1000)' which MSVC doesn't like.
joshcryer
 
Posts: 18
Joined: Wed Sep 26, 2007 8:19 pm

Re: Chipmunk 4.0.0 released.

Postby X-0ut » Sun Oct 28, 2007 5:15 am

They constants are not known at compile time.
Instead use new to allocate the array. (or malloc, whatever you prefer)

Check the other post on a windows build for the INFINITY macro problem.
X-0ut
 
Posts: 28
Joined: Tue Oct 02, 2007 5:02 am

Re: Chipmunk 4.0.0 released.

Postby joshcryer » Sun Oct 28, 2007 5:21 am

Ahah, thanks. I was looking at the MSVC version from that thread and they allocate it thusly: cpVect* tVerts = new cpVect[numVerts];

I'd been looking at another version of the code which is what confused me (I thought merely changing it to 'const cpVect numVerts' was the solution!).

edit: BTW X-Out, wanted to thank you for those fixes, I would've thanked you in the other thread but didn't want to throw out a needless bump. :)
joshcryer
 
Posts: 18
Joined: Wed Sep 26, 2007 8:19 pm

Re: Chipmunk 4.0.0 released.

Postby slembcke » Sun Oct 28, 2007 10:21 am

Crud. I thought I had merged the necessary changes into trunk. Looks like I'll have to check again.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
User avatar
slembcke
Site Admin
 
Posts: 4164
Joined: Tue Aug 14, 2007 7:13 pm

Re: Chipmunk 4.0.0 released.

Postby slembcke » Sun Oct 28, 2007 1:55 pm

Ok. I think it should work now. (Crosses fingers)
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
User avatar
slembcke
Site Admin
 
Posts: 4164
Joined: Tue Aug 14, 2007 7:13 pm

Re: Chipmunk 4.0.0 released.

Postby joshcryer » Mon Oct 29, 2007 12:07 am

:shock:

I should probably leave the whole bug reporting/fixing issue to X-Out. :)

Doesn't quite work yet though. I'm going to stick to the older revision. Hopefully X-Out will be kind enough to report back the necessary changes.
joshcryer
 
Posts: 18
Joined: Wed Sep 26, 2007 8:19 pm

Re: Chipmunk 4.0.0 released.

Postby X-0ut » Mon Oct 29, 2007 4:42 am

And here it is
Was not much to alter really, just needed a cast from void* in cpMomentForPoly (I also threw in a free to deallocate the cpVect) and to comment out the timeofday calls.
X-0ut
 
Posts: 28
Joined: Tue Oct 02, 2007 5:02 am

Re: Chipmunk 4.0.0 released.

Postby joshcryer » Mon Oct 29, 2007 5:37 am

X-Out, nice! I actually was fiddling with it just now and just got it working (whew!), I did the calloc cast "(cpVect *) calloc ...", and the "always define windows.h before gl.h" thing (which is what made me sort of perplexed and not wanting to try 'fixing it' but when I googled the problem was really simple). Then I spent a stupid amount of time trying to find a gettimeofday substitute for Windows. Making a GetTickCount define for WIN32 might be a bit more elegant in the end. But yeah it's not as bad as I originally thought.

So many props to slembcke! Sorry for all the trouble, and the rambling. :)

BTW, I got it somewhat integrated into my crappy handmade collision detection (using a iterated distance to line formula that broke on certain cases) already, so yeah. Fun! :D

One last thing. It's probably a stupid thing but I went and got freeglut (which works out of the box) and am using it to do my builds. It was never any culprit in my attempts to compile it so it's just a suggestion since it's currently maintained and all and "just works."
joshcryer
 
Posts: 18
Joined: Wed Sep 26, 2007 8:19 pm

Next

Return to Chipmunk2D Physics

Who is online

Users browsing this forum: No registered users and 2 guests