Box2D - missing shape->TestSegment

BlitzMax Forums/Brucey's Modules/Box2D - missing shape->TestSegment

wookie(Posted 2016) [#1]
Hello!

I've been happily building my game project based on box2d.mod for almost 2 years without any problems but now I encountered one which is BIG for me. Missing b2Shape->TestSegment function in bmax. Problem is that I need it badly - please help :(. Maybe its only few lines of code to add somewhere?


RustyKristi(Posted 2016) [#2]
Is that a new function in box2d mod?


wookie(Posted 2016) [#3]
no, it was always there


RustyKristi(Posted 2016) [#4]
probably you just need to do a rebuild all modules if you say it was there in the first place.

Are you using vanilla or NG? Maybe post a test code with that particular function so others can test it out.


wookie(Posted 2016) [#5]
I use standard Blitzmax (not NG).
b2Shape->TestSegment is in C++ source code of box2d but is not wrapped by Brucey's module.

I don't know c++ but I somehow managed to add wrapper myself looking at similar functions and after several tries and errors I finally build module without any errors BUT when I'm building my game executable I get build error:

C:/BlitzMax/mod/bah.mod/box2d.mod/box2d.release.win32.x86.a(box2d.bmx.release.win32.x86.o):(code+0x2665): undefined reference to `bmx_b2shape_testsegment'


RustyKristi(Posted 2016) [#6]
Ok I have box2d here but I don't know if there's a testsegment example. You have to post at least basic example code if you would like confirmation.


RustyKristi(Posted 2016) [#7]
In my copy and official bah.mod repo, TestSegment Doc is commented out, I guess it was done for a reason, looks like it is not supported.

https://github.com/maxmods/bah.mod/search?l=blitzmax&q=TestSegment&utf8=%E2%9C%93


wookie(Posted 2016) [#8]
OK - I did it!. After sleep I started from the beginning step by step and added TestSegment with success :).


RustyKristi(Posted 2016) [#9]
hey good for you! maybe you should submit a pull request or inform Brucey about this since he maintains the mod.