cosmetix
[k8-jellyphysics.git] / src / jelly / ClosedShape.h
blob3fa68ead235641b38670e23e9287c341bba6e0ab
1 #ifndef _CLOSED_SHAPE_H
2 #define _CLOSED_SHAPE_H
4 #include <vector>
6 #include "JellyPrerequisites.h"
8 #include "Vector2.h"
11 namespace JellyPhysics {
13 class ClosedShape {
14 public:
15 ClosedShape () {}
16 ClosedShape (const Vector2List &input) { mLocalVertices = input; finish(); }
18 void begin ();
19 int addVertex (const Vector2 &vec);
20 void finish (bool recenter=true);
22 const Vector2List &getVertices () const { return mLocalVertices; }
24 Vector2List transformVertices (const Vector2 &worldPos, float angleInRadians, const Vector2 &scale) const;
25 void transformVertices (const Vector2 &worldPos, float angleInRadians, const Vector2 &scale, Vector2List &outList) const;
27 private:
28 Vector2List mLocalVertices;
34 #endif