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

A convex connected polygon such that the vertices are in ccw order. More...

#include <Polygon2D.h>

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

Public Member Functions

bool isValid () const
 
bool intersects (const ConvexPolygon2D &other) const
 
bool contains (const Point2D &v) const
 
bool withinDistance (const Point2D &v, Real dist) const
 
bool withinEdgeDistance (const Point2D &v, Real dist) const
 
Real distance (const Point2D &v) const
 
Real edgeDistance (const Point2D &v) const
 actually the signed distance
 
bool intersects (const Line2D &l, Real &tmin, Real &tmax) const
 
bool intersects (const Line2D &l) const
 
bool intersects (const Segment2D &l) const
 
int planeIntersections (const Plane2D &p, int &e1, int &e2, Real &u1, Real &u2) const
 returns either 0,1, or 2, and the edge indices and parameters
 
void halfspaceIntersection (const Plane2D &p)
 crops the polygon to the negative side of the plane
 
void setIntersection (const ConvexPolygon2D &a, const ConvexPolygon2D &b)
 creates the polygon from the intersection of a and b
 
- Public Member Functions inherited from Math3D::Polygon2D
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
 

Additional Inherited Members

- Public Attributes inherited from Math3D::Polygon2D
std::vector< Point2Dvertices
 a list of points around the boundary
 

Detailed Description

A convex connected polygon such that the vertices are in ccw order.


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