Chipmunk 6.0.0 Released.

Official forum for the Chipmunk2D Physics Library.
User avatar
slembcke
Site Admin
Posts: 4166
Joined: Tue Aug 14, 2007 7:13 pm
Contact:

Re: Chipmunk 6.0.0 Released.

Post by slembcke »

I'm confused. In trunk and the 6.0.0 download that line looks like this:

Code: Select all

space->staticBody = &space->_staticBody;
Where is the code from where you are seeing that line?
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
TomorrowPlusX
Posts: 28
Joined: Tue Jul 12, 2011 6:31 am
Contact:

Re: Chipmunk 6.0.0 Released.

Post by TomorrowPlusX »

I just figured out what happened. I did a global search and replace in my project for &space->staticBody and since chipmunk is a sub-project of my game, I think I must have clobbered the correct code.

Sorry.

I'm still really awkward around Xcode 4. Its global search and replace is much more dangerous than Xcode 3's.
User avatar
slembcke
Site Admin
Posts: 4166
Joined: Tue Aug 14, 2007 7:13 pm
Contact:

Re: Chipmunk 6.0.0 Released.

Post by slembcke »

Apple sure knows how to make their IDE "better" and "better" with each version they put out eh?
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
otibom
Posts: 8
Joined: Sat Mar 26, 2011 7:45 am
Contact:

Re: Chipmunk 6.0.0 Released.

Post by otibom »

All right, I've been looking at the source for the getters/setters for a moment now. It hurts. So many macros >.<

The reason is I have a bug when building the following program, in C++ linked against libchipmunk.a built as C++.

Code: Select all

#include <chipmunk/chipmunk.h>

int main()
{
	cpBody* body = cpBodyNew(1,1);
	cpBodySetVelLimit(body, 42.0);
	cpBodyFree(body);
}

Code: Select all

Undefined symbols:
  "_cpBodySanityCheck", referenced from:
      _cpBodySetVelLimit in ccqErTfq.o
(It doesn't happen in C, yay for sorcery).
I found that it goes away if I #define NDEBUG.
Is that intended ? That is, should the user define NDEBUG if compiling in release ?

Or am I doing something wrong here ?

PS: I just saw the new demos, awesome !
TomorrowPlusX
Posts: 28
Joined: Tue Jul 12, 2011 6:31 am
Contact:

Re: Chipmunk 6.0.0 Released.

Post by TomorrowPlusX »

slembcke wrote:Apple sure knows how to make their IDE "better" and "better" with each version they put out eh?
Seriously. Xcode 4's clearly all full of awesome, but I still can't figure out how to use it correctly. :roll:
User avatar
slembcke
Site Admin
Posts: 4166
Joined: Tue Aug 14, 2007 7:13 pm
Contact:

Re: Chipmunk 6.0.0 Released.

Post by slembcke »

@otibom: Heh. Sorry about that. It's *way* easier than writing them all by hand. Maintaining getters and setters in Java always made me want to slit my wrists. -_- It is only 10 lines of macros though, you should see some of my Scheme macros, heh.

Anyway, cpBodyAssertSane() checks that the body doesn't have any properties set to infinity, NaN or other improper values. When NDEBUG is set, it replaces the function prototype with a do-nothing statement.

Using GCC it compiles fine as C++ code so I'm having a little trouble figuring out what the problem is exactly.

edit: Ooooh. I see what the issue is. I'll have a fix shortly.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
User avatar
slembcke
Site Admin
Posts: 4166
Joined: Tue Aug 14, 2007 7:13 pm
Contact:

Re: Chipmunk 6.0.0 Released.

Post by slembcke »

@otibom: I committed the fix. I've temporarily moved the project to GitHub to see how that goes. So check it out from there.
https://github.com/slembcke/Chipmunk-Physics
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
otibom
Posts: 8
Joined: Sat Mar 26, 2011 7:45 am
Contact:

Re: Chipmunk 6.0.0 Released.

Post by otibom »

I just tried it. works fine =)

I don't really understand though. Is it meant to be defined (or not) when I compile chipmunk, or my project ? Both I guess. Because I see it's being used both in the .c and .h. It's not really important, i'm just curious :)

edit: Yay for Git & Github ! Good choice.
By the way why does a body with a moment of zero doesn't collide ?
Post Reply

Who is online

Users browsing this forum: No registered users and 9 guests