Box2D User data for shapes?

BlitzMax Forums/Brucey's Modules/Box2D User data for shapes?

Rico(Posted 2008) [#1]
Hello. I wanted to set the UserData for shapes on a body. (I have already done so for the bodys). However I am having trouble finding the command. The manual indicates that you can set user data for shapes - but no command is listed in the list of functions. I have tried shapeDef.SetUserData(data) - but it says 'SetUserData' not found.

How do I set the UserData for a shape? Thank you very much.


Brucey(Posted 2008) [#2]
The current in SVN has a shapedef SetUserData() method.


Rico(Posted 2008) [#3]
Ok - Thanks Brucey.


Rico(Posted 2008) [#4]
Brucey - I am trying to get the lastest SVN version from

http://maxmods.googlecode.com/svn/trunk/box2d.mod/

I am using Tortoise SVN - I haven't done it before. Anyway it says I need a user name and a password (when I use the above URL) . How do I get these - Do i have to register somewhere?

Thanks


Brucey(Posted 2008) [#5]
You don't need a username/password to checkout the code.

It usually does it without asking.


Brucey(Posted 2008) [#6]
...not that my answer appears to be very helpful. :-p

I'll see if I can't do a release tonight sometime. But it's in a bit of a mess at the moment, as I need to finish adding some new functionality. Will see how I get on with it.


Rico(Posted 2008) [#7]
Its ok - I was using the Import option when I should have been using the 'SVN Checkout' option. (Import sounded like the right option at the time) I've now got the SVN folder in my Box2d one. I presume I just replace the existing Box2D folder with this one and then re-compile. Is this right?

Thank you.


Brucey(Posted 2008) [#8]
I presume I just replace the existing Box2D folder with this one and then re-compile.

Yep. Everything should look the same as before (except you'll have some extra .svn folders in places).

From now on, as long as you keep those .svn bits, you can simply right-click on the box2d.mod folder and choose SVN Update from the context menu - to keep yourself up-to-date with the latest code.

The reason I don't build releases so often is there's a bit more work involved in getting everything packaged up and tested everywhere. And I'm finding there are barely enough hours in the day as it is... Dunno how everyone else does everything in 24... :-p


Rico(Posted 2008) [#9]
Brucey - I am having trouble compiling the module. I have gone into the command line. Then I set the current directory to the BlitzMax bin directory. I then type 'bmk makemods bah.box2d'

I don't get an error message - there is just a long pause and nothing happens. I think normally a long list comes up saying what files are being compiled. Do you know what I am doing wrong?

I only recently compiled the Fmod module (a couple of weeks ago) and that worked ok. However now when I try to recompile the other modules I have like FMod the same thing happens - just a pause and nothing. Not sure whats wrong. Do you have any idea?


Brucey(Posted 2008) [#10]
I'm guessing you have things in the wrong places.

You should be able to see this path structure : BlitzMax/mod/bah.mod/box2d.mod/box2d.bmx

If you add -a it will *force* a rebuild of the module too - just in case it thinks there's nothing to do.
If still nothing happens, then things are definitely in the wrong place.


Rico(Posted 2008) [#11]
I'm still having trouble. I have got everything in the right place. I managed to get the old box2d to recompile by using the -a parameter. When I changed it to the new folder with the subversion code in it - nothing happened again - just a pause and then nothing.

Currently it won't even recompile the old version of box2d (even using the -a parameter). I have no idea why this is. All I have done is rename the folders (when switching to different folders) and then rename them back again. All the other modules will compile - Chipmunk (with errors), Fmod, FmodAudio.

Do you have any ideas?


Rico(Posted 2008) [#12]
Its Ok - Its started working now. I had called the folder Box2d with a capital b - but I was typing 'box2d' in the command window. It never occured to me that it would be case sensitive! :)

At least I can finally use SVN updates!


Brucey(Posted 2008) [#13]
Ah, yes... when you see my example path structure, it should look *exactly* like it is written - including case :-)