[Update] Github link:
https://github.com/Eren121/SFML-MathPrevious download link
https://www.dropbox.com/s/tp0w90qd1mj0ul1/SFMLMath.zip?dl=0Hello all!
To debug and avoid repeated stuff, Ii coded a tiny header only lib in C++11.
It add basic math stuff and printable Vectors and Color of the form (X, Y [, Z] ) or (R, G, B, A) to debug better
And Vectors/Colors are now... iterables!
Sample :
#include <SFML/Math.h>
#include <iostream>
#include <vector>
using namespace std;
int main()
{
sf::Vector3f myVec3(1, 1, 0);
sf::Vector2f myVec2(1, 1);
cout << myVec2 << endl;
cout << length(myVec2) << ", " << length(myVec3) << endl;
cout << length2(myVec2) << endl;
cout << distance({1, 2}, myVec2) << endl;
cout << dot(myVec3, {0, 0, 1}) << endl;
for(float & f : myVec2) {
f += 1;
}
cout << myVec2 << endl;
return 0;
}
Output :
(1, 1)
1.41421, 1.41421
2
1
0
(2, 2)
If you have any suggestion ^^