Game Develop C++ Platform: Polygon.h Source File

| Game Develop C++ Platform Platform for developing native games based on OpenGL and SFML with Game Develop

- Main Page
- Modules
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Groups Pages
Polygon.h
Go to the documentation of this file.
1
5 #ifndef POLYGON_H
6 #define POLYGON_H
7 #include <vector>
8 #include <SFML/System.hpp>
9
18 class GD_API Polygon2d
19 {
20 public:
21 Polygon2d() {};
22 virtual ~Polygon2d() {};
23
24 std::vector<sf::Vector2f> vertices;
25 mutable std::vector<sf::Vector2f> edges;
26
32 void Move(float x, float y);
33
41 void Rotate(float angle);
42
46 void ComputeEdges() const;
47
52 bool IsConvex() const;
53
57 sf::Vector2f ComputeCenter() const;
58
62
66 static Polygon2d CreateRectangle(float width, float height);
68 };
69
70 #endif // POLYGON_H
71