[Documentation] Outdated "Hello World" Code

Official forum for the Chipmunk2D Physics Library.
Post Reply
Maltherd
Posts: 1
Joined: Wed Feb 04, 2015 3:12 pm
Contact:

[Documentation] Outdated "Hello World" Code

Post by Maltherd »

Hello, everyone !
I'm new to Chipmunk and have tried some programs with the old 6.2.1 version. Now that I have updated to version 7, the Hello World code available in the documentation is no longer working.

It would seem that these functions here have been renamed :

Code: Select all

// ...

cpBodySetPos(ballBody, cpv(0, 15));

// ...

cpVect pos = cpBodyGetPos(ballBody);
cpVect vel = cpBodyGetVel(ballBody);

// ...
That's easy to deal with, but still a bit annoying, and there's this :

Code: Select all

cpShape *ground = cpSegmentShapeNew(space->staticBody, cpv(-20, 5), cpv(20, -5), 0);
I get an "incomplete type" error, and realize "cpSpace.h" does not contain the struct !
I have looked around a bit and it seems the structs definitions have been moved to "chipmunk_private.h", but I saw too that it was not very safe to include it directly, so... what should I do ?
Thanks for your answers !

Sorry if the question is a bit nooby, plus sorry for my english I am not a native speaker. ;)

EDIT : I'm using the C library with G++ 4.8.1 !
Post Reply

Who is online

Users browsing this forum: No registered users and 18 guests