vrecko
virtual reality framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
PolygonUtils.h
Go to the documentation of this file.
1 #ifndef POLYGON_UTILS_H
2 #define POLYGON_UTILS_H
3 
4 #include <vector>
5 #include <osg/Vec3>
6 #include <osg/Matrix>
7 
8 using namespace std;
9 
10 namespace APConstrainedMovement {
11  typedef vector<osg::Vec3> Vecs3;
12 
13  // Calculate the area of a triangle
14  float area(osg::Vec3 &point1, osg::Vec3 &point2, osg::Vec3 &point3);
15 
16  // Calculate the centroid of a polygon
17  osg::Vec3 centroid(Vecs3 polygon);
18 
19  // Calculate the orientation
20  int orientation(float x1, float y1, float x2, float y2, float px, float py);
21 
22  // Check whether a polygon is convex
23  bool convexPolygon(Vecs3 polygon);
24 }
25 
26 #endif
27