Hello people !
Today I present to you both libraries those I'm working for several times and I'm proud to share to the community. My philosophy is to totally make the difference between the geometric aspect to the graphical rendering one, or any potential other use (such a physic engine, that I'm programming according to the fisrt lib, by the way) :
The first one is called Zoost and allows you to create some geometric objects as simply it can be, and to give them the abbility to interact each other (totally appart from the SFML).
From segments to triangles, without forgetting curves (including Bezier ones) and concav polygons, you just are spoiled for choice (and I will add others soon).
You can of course create your own customized geometries according to a low and high level system at the same time.
The second one is Zoom (based on SFML 2.0 RC) which focus on the animation aspect and the graphical one, allowing you to use a geometry from Zoost and to animate it in the way you want. But it's not all the things, because you will be able to render and display the geometries and totally custom the rendering (size of each points, segment's color, filling of the shapes, etc...). Finally, the libs includes an engine of light rendering, based on the great Gregouar's work, all cleaned for the occasion. In a not so far away future, I will add the handling of the just new way to render the 2.5D shadows (by the same author) ! I'm very impatient for that...
Example of creation of a concav polygon and its rendering :Geom geom = Geom::polygon({{0, 0}, {25, 100}, {40, 100}, {40, 0}, {100, 0}, {100, 100}, {120, 100}, {120, 0}, {180, 0}, {180, 100}, {200, 100}, {200, 0}, {260, 0}, {260, 100}, {275, 100}, {300, 0}, {300, 120}, {240, 120}, {240, 20}, {220, 20}, {220, 120}, {160, 120}, {160, 20}, {140, 20}, {140, 120}, {80, 120}, {80, 20}, {60, 20}, {60, 120}, {0, 120}});
geom.setPosition(130, 200);
geom.scale(1.5, 1.5);
Shape shape(geom);
shape.setFaceColor(Color::SpringGreen);
shape.setLiaisonColor(Color::DarkGreen);
shape.setLiaisonWidth(3);
target.draw(shape);
Example of animation of an object with a curve and a kinetic :Curve curve = Curve::bezier({767, 410, 1000, 900, 1000, 30, 500, 30, 1, 30, 50, 560, 169, 410}) + Curve({169, 410, 228, 321, 386, 571, 553, 261, 421, 218, 575, 464, 767, 410});
curve.setOrigin(500, 370);
Kinetic kinetic(curve, 400, 0, true); // 400 is the speed of the curse over the curve each, 0 means that it is starting at the begining (always inferior or equal to 1) and true that the kinetic is looping on itself.
// Main loop :
Vector2d coords = curve.convertToGlobal(kinetic.update(clock.restart())); // New point of curve tracking.
myShape.setPosition(coords);
That's it ! Both libraries are not fully complete, but bringed to be quickly improved (because I need them in my future projects). I'll tell you up to date and I'll answer here for all your questions and suggestions !
https://github.com/Zinlibs/Zoosthttps://github.com/Zinlibs/ZoomThank you (and sorry for my poor english, I'm French, you know...
) !