45 template <
typename Real>
56 int const*
indices,
bool counterClockwise);
61 inline operator bool()
const;
66 inline std::vector<int>
const&
GetIndices()
const;
99 template <
typename Real>
101 int const*
indices,
bool counterClockwise)
106 if (numIndices >= 3 && vertexPool && indices)
108 for (
int i = 0; i < numIndices; ++i)
113 if (numIndices == static_cast<int>(
mVertices.size()))
116 std::copy(indices, indices + numIndices,
mIndices.begin());
130 template <
typename Real>
inline 136 template <
typename Real>
inline 142 template <
typename Real>
inline 148 template <
typename Real>
inline 154 template <
typename Real>
inline 160 template <
typename Real>
170 average /=
static_cast<Real
>(mVertices.size());
175 template <
typename Real>
185 length +=
Length(v1 - v0);
192 template <
typename Real>
198 int const numIndices =
static_cast<int>(
mIndices.size());
201 for (
int index : mIndices)
204 area += v1[0] * (v2[1] - v0[1]);
213 template <
typename Real>
223 int const numIndices =
static_cast<int>(
mIndices.size());
233 template <
typename Real>
243 int const numIndices =
static_cast<int>(
mIndices.size());
253 template <
typename Real>
260 int const numIndices =
static_cast<int>(
mIndices.size());
261 for (
int i0 = 0; i0 < numIndices; ++i0)
263 int i0p1 = (i0 + 1) % numIndices;
267 int i1min = (i0 + 2) % numIndices;
268 int i1max = (i0 - 2 + numIndices) % numIndices;
269 for (
int i1 = i1min; i1 <= i1max; ++i1)
271 int i1p1 = (i1 + 1) % numIndices;
275 result =
query(seg0, seg1);
276 if (result.intersect)
285 template <
typename Real>
289 int const numIndices =
static_cast<int>(
mIndices.size());
290 for (
int i = 0; i < numIndices; ++i)
292 int iPrev = (i + numIndices - 1) % numIndices;
293 int iNext = (i + 1) % numIndices;
299 Real test = sign *
DotPerp(edge0, edge1);
std::vector< int > mIndices
Vector2< Real > ComputeVertexAverage() const
bool CounterClockwise() const
bool IsSimpleInternal() const
std::array< Vector< N, Real >, 2 > p
Vector2< Real > const * mVertexPool
Vector2< Real > const * GetVertexPool() const
GLsizei GLenum const void * indices
Real DotPerp(Vector2< Real > const &v0, Vector2< Real > const &v1)
std::set< int > mVertices
Polygon2(Vector2< Real > const *vertexPool, int numIndices, int const *indices, bool counterClockwise)
GLuint GLsizei GLsizei * length
DualQuaternion< Real > Length(DualQuaternion< Real > const &d, bool robust=false)
bool IsConvexInternal() const
GLfloat GLfloat GLfloat v2
std::set< int > const & GetVertices() const
std::vector< int > const & GetIndices() const
Real ComputePerimeterLength() const