Page 1 of 1

Box2d / HGE wrapper

Posted: Fri Aug 27, 2010 7:21 am
by PureLeo
I've just tried to import functions from an other language box2d wrapper...
No success... don't know why :/
Well.. it was for Darkbasic from Diggsey, and its functions sometimes had Dword as parameter types, and i used Long instead. Dont know if it could cause the incompatibility...

No errors at all, but when i make a little test it just lags a bit when the refresh function "b2Step()" is called...

I even get the right addresses from each function (compared them loading the dll with Dllexp, which shows functions, addresses and stuff...) But still, doesnt work:

Code: Select all

;simplified
myworld = b2CreateWorld(-1000,-1000,1000,1000,0,0,0)
newbox = b2CreateBoxBody(myworld,40,40,1,0.2,0.5)
b2PositionBody(newbox,100,-100)
...
;main loop
b2Step(myworld)
debug b2GetBodyX(newbox) ;returns "-1.#IND" always (???????)



Also, i tried to compile box2d myself from the source to a DLL... Fail.
I'm stupid as hell when dealing with C/C++, and ofcourse, the functions need to be exported to make a usefull dll wrapper. I have not such skill :/

I have eddy's(i think) chipmunk port, but its TOO complicated to make stuff. My newton 3d physics wrapper for blitz3d(which works on purebasic after importing each function) is easier to use than this chipmunk wrapper. (I mean: create world, create virtual object, create sprite object, then sync sprite's position and rotation to virtual object's position and rotation after each loop)


That is. Have anyone ever made a wrapper for box2d, no matter what language for, that its functions could be imported to PB ???

Or does anyone have neotoma's HGE wrapper(which i've read somewhere that has box2d integrated(???) Because its link on its respective post is broken (2008)


Thanks all for your patience and help in advance :)

Re: Box2d / HGE wrapper

Posted: Fri Aug 27, 2010 3:28 pm
by IdeasVacuum
Have you tried to pm neotoma?

He is alive and kicking: http://forums.purebasic.com/german/view ... 0a#p278403

Re: Box2d / HGE wrapper

Posted: Sat Aug 28, 2010 8:41 am
by PureLeo
The wrapper's author sent me:

"Hi,
The commands probably don't work because in DBPro, 'float' types are cast to DWORD in a special way before being returned. Normally, float values are returned on the FPU, whereas DBPro expects them in the CPU."

Honestly, I wish i knew what does that mean and how to fix that ;] but...

Re: Box2d / HGE wrapper

Posted: Sat Aug 28, 2010 8:42 am
by PureLeo
Yes, i will PM neotoma, thanks!

Re: Box2d / HGE wrapper

Posted: Mon Aug 30, 2010 3:43 pm
by X
HGE? I was just looking at that engine Friday. It looks like it's discontinued for .. 2? years now. I haven't found a replacement yet.

Re: Box2d / HGE wrapper

Posted: Fri Sep 03, 2010 10:17 pm
by IdeasVacuum
...I emailed them a few days ago to inquire the status, but no reply :(

Re: Box2d / HGE wrapper

Posted: Sat Sep 04, 2010 12:19 pm
by PureLeo
Same here :/

Re: Box2d / HGE wrapper

Posted: Sat Sep 04, 2010 11:17 pm
by PureLeo
Alex777 kindly sent me the wrapper :)
(still, the wrapper made by 'neotoma')

It seems up to date (yet, 2008, last release.. hge 1.81)

I've uploaded it to:
http://www.4shared.com/file/fXEQ95Yz/hgePBWrapper.html

I was looking for it mainly because of its box2d integrated, and have already managed to make it work with my own sprites and stuff.

Now I'm thinking about performance... HGE isn't easier to use than PB's internal graphics (my opinion), so, would it be faster or something? Any reason to use it?

Thanks...!

Re: Box2d / HGE wrapper

Posted: Sun Sep 05, 2010 1:27 am
by moogle
Thanks for posting it!
PureLeo wrote:Any reason to use it?
Less bugs :roll: :wink: :roll: