Hi folks,
for a first try I want to IMPORT chipmunk physics into GLB. Of course, as external libraries usually depend on standard libs you need to have a C/Cpp environment installed. As I don't want to reinvent the wheel, so I have a few questions:
Which C/CPP compiler environment do you have installed and how did you set it up so GLB can use it's libraries and header files?
Does it work also cross platform, like for Iphone development?
Before I had BlitzMax and MingW installed but deinstalled it a while ago. There it was easy to use CPP files.
Thanks for any info
Michael
Entscheide dich mal f?r eine Sprache...
Unter news findest du header iund libs f?r ein paar platformen. Runterladen in platform rein und voila geht.
mfg
Warum? Ist doch ein zweisprachiges Forum, oder? Oder hab ich da irgendeine Forumregel ?bersehen? Aber kein Problem. Von nun an nur noch Englisch. ;/
Anyway, thank you for the information.
German:
Du kannst den Chipmunk-Source benutzen, nur sind da mehrere *.c Dateien drin.
Musst alle *.c Dateien in eine packen dann kannst du es mit REQUIRE aufrufen.
Brauchst allerdings trotzdem ein wenig Cpp/Inlinecode in GLB wegen den structs.
Sollten Probleme auftauchen einfach melden und zwar auf deutsch ;)
Ich kann nur Deutsch deswegen hilft mir englisch so rein null weiter.
Chipmunc.c kann schranzor dir hochladen funktioniert und linkt. keine problem.e
Jow da hast du, hab schonmal die cpVect's eingebaut um dir zu zeigen wie das geht. ( falls du es noch nicht kannst :) )
Aufrufen des DGArrays im INLINE:
cpVectArray(handle)
so kannst du auch nochmal auf die Werte x und y zugreifen
cpVectArray(handle).x
cpVectArray(handle).y
[attachment deleted by admin]
Guten Morgen,
jetzt ist mir das mit der Sprachwahl klar. Und auch vielen Dank f?r den Quellcode.
Wird mit Sicherheit hilf- und lehrreich sein. :)
Michael
Ist Chipmunk besser als Box2D?
26 or so odd years ago I could read, write and (to a certain extent, but I never was much good at that bit) speak German, but now it's all just odd looking words to me now. =D
I think I get some of the simpler stuff still, like I think Gernot asked if Chipmunk was better than Box2D, and I think I get some of what Ocean said, but it's a long way from being able to read and write it. :S
Oh, very nice. I always wonder why any native English speaker would want to bother learning German, though...
Because when you go to school here they make you learn at least one other language for at least a year (or was the case when I went through school). I ended up going with my choice longer than you are forced to though because I enjoyed it -- despite the fact that my teacher (who was German) looked like a Nazi in hiding (actually no my violin teacher was more like that, he even used to show me the salute which was a bit odd). In my day it was a choice between French and German. I wasn't much good at French and it wasn't helped by a friend of mine from Belgium who was doing the class just as a joke and made it a bit hard to concentrate, so ended up going with German for about 3 years. Then a year or so later we had a German exchange student live with us for about a year and she pushed me on it a bit. These days I think the choices are more along the Asian side of things eg. Japanese, Chinese and Malay or Indonesian. One of my cousins who is a lot younger than me studied Japanese at High School then university. She ended up teaching English in Japan for a while. Guess it's to do with the multi-cultural aspects of being an Aussie. Our Govt does or did push that angle a lot.
Now I can understand 'Inspector Rex' at times without having to watch the show (my family is into it, don't pick on me please) but that's about it. Mind you I'm guessing it's not exactly packed full of complicated German dialog as far as Austrian (it is Austrian isn't it?) productions go. Bit like our Skippy maybe but for a more adult audience. :)
Even being a german, living and working in germany, speaking english is now more native to me than using the german language. After being married to my wonderful american wife now for over 10 yrs i think now in english too.
Most of the forums i visit are english only. So it is my first choice. That i posted here was motivated by the thought that i would have a bigger chance of getting an answer to my problem as i thint the chances are higher that a german speaks english than a native english speaker knows german.
Sorry, if i caused confusion.
Gernot, i don't thing it is better but it looked easier to implement to me as it is pure c.
I was looking for a GLB file for Box2D but found nothing.
OK, go for Chipmunk then. I don't care, but I wish we had some of the 2D physics engines wrapped multiplatform. Newton _is_ brilliant for 3D, but at 2D it sort of sucks. (See my CogWork attempt).
We had a wrapper to Box2D, but it was not very promising and the debugging geometry was really complicated to get. Means - it's missing.
Port Chipmunk with IMPORT and make us all happy, please :D
Yes please!
I can't find a helpfile for chipmunks :S
Or a simple tutorial...
EDIT:
You have to wrapp some things into the chipmunks.c...
You must have clear datatypes ( int, long, float .... ) to SET and to RETURN !
like this:
#include "stdlib.h"
#include "chipmunk.h"
// important to use it easier!
#include "glb.h"
...
// All the functions
...
// at the end of the file:
/* ##################################################################*\
GLBasic things
/* ##################################################################*/
extern "C"{
// a DGArray to save the vectors
DGArray<cpVect> cpVectArray;
int CP_Vect( float x, float y){
cpVect tmp; // create a 2D-Vector
tmp.x = x; // set x
tmp.y = y; // set y
// push it to the DGArray cpVectArray
DIMPUSH(cpVectArray, tmp);
// return the number of entrys 1 to X (10 entrys = real 9 entrys)
// thats a handle to it!
return LEN(cpVectArray())-1;
}
}
I beg therefor too!
http://code.google.com/p/chipmunk-physics/wiki/Documentation
Quote from: trucidare on 2009-Aug-13
http://code.google.com/p/chipmunk-physics/wiki/Documentation
Yepp but this help is some kind of sh*t ;)
Has anybody managed to wrap Chipmunk or box2d?? I have tried to get box2d working but the c environment is a real pain in the arse to setup for inclusion into Glbasic. I am really knocking my head on this, any help will be good.
http://www.glbasic.com/showroom.php?site=games&game=box2dinterfaceinglbasic (http://www.glbasic.com/showroom.php?site=games&game=box2dinterfaceinglbasic)
Neseir has ported parts of Box2D. No idea how far that is, but it should be possible to extend that.
Thanks. I will have a look. =D Has Neseir made his code available??
Hi
The source was not included in the zip-file. Have uploaded a new zip file with source. It is also now possible to manipulate the objects using the mouse in the test program. Have fun =D
@Neseir
Thank you, much appreciated.
I am fairly new to GLBASIC and dont have anything of any real use to give the community, but when I do, I will gladly contribute. =D
This community rocks and the developer is such a nice guy :whistle:
Quote from: neseir on 2009-Oct-03
Hi
The source was not included in the zip-file. Have uploaded a new zip file with source. It is also now possible to manipulate the objects using the mouse in the test program. Have fun =D
This is really excellent, thanks neseir! :good: