Box2d / HGE wrapper

Just starting out? Need help? Post your questions and find answers here.
User avatar
PureLeo
Enthusiast
Enthusiast
Posts: 221
Joined: Fri Jan 29, 2010 1:05 pm
Location: Brazil

Box2d / HGE wrapper

Post 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 :)
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: Box2d / HGE wrapper

Post by IdeasVacuum »

Have you tried to pm neotoma?

He is alive and kicking: http://forums.purebasic.com/german/view ... 0a#p278403
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
User avatar
PureLeo
Enthusiast
Enthusiast
Posts: 221
Joined: Fri Jan 29, 2010 1:05 pm
Location: Brazil

Re: Box2d / HGE wrapper

Post 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...
User avatar
PureLeo
Enthusiast
Enthusiast
Posts: 221
Joined: Fri Jan 29, 2010 1:05 pm
Location: Brazil

Re: Box2d / HGE wrapper

Post by PureLeo »

Yes, i will PM neotoma, thanks!
X
Enthusiast
Enthusiast
Posts: 311
Joined: Tue Apr 04, 2006 6:27 am

Re: Box2d / HGE wrapper

Post 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.
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: Box2d / HGE wrapper

Post by IdeasVacuum »

...I emailed them a few days ago to inquire the status, but no reply :(
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
User avatar
PureLeo
Enthusiast
Enthusiast
Posts: 221
Joined: Fri Jan 29, 2010 1:05 pm
Location: Brazil

Re: Box2d / HGE wrapper

Post by PureLeo »

Same here :/
User avatar
PureLeo
Enthusiast
Enthusiast
Posts: 221
Joined: Fri Jan 29, 2010 1:05 pm
Location: Brazil

Re: Box2d / HGE wrapper

Post 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...!
Last edited by PureLeo on Sun Sep 05, 2010 8:38 am, edited 1 time in total.
moogle
Enthusiast
Enthusiast
Posts: 372
Joined: Tue Feb 14, 2006 9:27 pm
Location: London, UK

Re: Box2d / HGE wrapper

Post by moogle »

Thanks for posting it!
PureLeo wrote:Any reason to use it?
Less bugs :roll: :wink: :roll:
Image
Post Reply