KrisLibrary  1.0.0
Public Member Functions | Public Attributes | List of all members
Math3D::Polygon2D Struct Reference

An arbitrary connected polygon given by a vertex list. More...

#include <Polygon2D.h>

Inheritance diagram for Math3D::Polygon2D:
Math3D::ConvexPolygon2D

Public Member Functions

size_t next (size_t i) const
 
size_t prev (size_t i) const
 
bool ccw () const
 
bool nonCrossing () const
 
Real area () const
 
Vector2 centroid () const
 
void triangulateConvex (std::vector< Triangle2D > &tris) const
 
void setTransformed (const Polygon2D &in, const Matrix3 &T)
 
void getEdge (int i, Segment2D &ei) const
 
void getPlane (int i, Plane2D &pi) const
 The plane normals point to the right of the edge.
 
bool planeSplits (const Plane2D &p) const
 returns true if the plane intersects this polyhedron
 
bool planePos (const Plane2D &p) const
 returns true if this is entirely on the positive side of this plane
 
bool planeNeg (const Plane2D &p) const
 returns true if this is entirely on the negative side of this plane
 
bool raySplits (const Vector2 &a, const Vector2 &b) const
 returns true if the ray a->b intersects this polyhedron
 
bool rayLeft (const Vector2 &a, const Vector2 &b) const
 returns true if this poly is entirely on the left side of a->b
 
bool rayRight (const Vector2 &a, const Vector2 &b) const
 returns true if this poly is entirely on the right side of a->b
 
int residue (const Vector2 &x) const
 1 if inside, 0 if outside
 
bool intersectsBoundary (const Polygon2D &other) const
 returns true if the boundaries intersect
 
Real boundaryDistance (const Point2D &v) const
 
bool intersects (const Line2D &l, Real &tmin, Real &tmax) const
 
bool intersects (const Line2D &l) const
 
bool intersects (const Segment2D &l) const
 
void getAABB (AABB2D &) const
 
bool Read (File &f)
 
bool Write (File &f) const
 

Public Attributes

std::vector< Point2Dvertices
 a list of points around the boundary
 

Detailed Description

An arbitrary connected polygon given by a vertex list.

Vertices are numbered 0...n-1. Edge i connects verts i and i+1 (looping around to 0).


The documentation for this struct was generated from the following files: