I recently required some vector functions to prototype a game idea in PureBasic, however there is no such thing as a built-in vector library and any of the existent community code was buggy to say the least (no offense but it’s old, ugly code that you’ll find anywhere else).
The reason for this library is quite simple, and so is the library itself. you can either include it or install the resource file and start using it right away. After taking a quick look at the source, you’ll soon familiarize with it’s naming convention; there is no need to write any documentation for this type of code, since it’s basic vector math. However a test source is included for your delight.
You can find the source in here: http://gushh.net/dev/?file=pb/vec3_macro.pbi
And some ugly test code in here: http://gushh.net/dev/?file=pb/vec3_macro_test.pb
Or, you can get “the whole package” from here: http://gushh.net/dls/vec3_macro.zip
Using this library is as easy as…
Define.VEC3 a, b, c
VEC3_SET( a, 0.1, 0.2, 0.3 )
VEC3_SET( b, 0.4, 0.5, 0.6 )
VEC3_ADD( a, b, c )
VEC3_DEBUG3( a, b, c ) ; display the vectors in the debug console.