I am not sure where this post belong, but i want to give something back to this awesome community - so i made a tiny tile-based platformer prototype using a robust physics system based on speculative contacts - including pushing of blocks and stacking ;-)
I am building a level editor for my game and doing the implementation for resizing (moving of two vectors by a given delta) of polygons right now. Grabing the side of a polygon and moving the vertices along the given delta works already, so the only problem i have right now is to doing the repositioning so that the body center match the new local center.
How do i calculate the new body center and delta for offseting my local vertices?
But what about circle shapes? They will change the position when the local offset is not zero.
//Mat2f localRotation(0f); // Circles dont have a local rotation at all
Vec2f localOffset(-100, 0);
Vec2f worldPosition(0, 0);
Vec2f pos = V2(localOffset) * worldRotation + worldPosition;
This seems to be a totally different way than the implementation above.
Is there a nice way to change the polygon drawing to use this way - so that it uses a rotated position and of course, includes the vertex rotation as well ?
It must be really easy, but right now i dont see it at all...