#include "PfieldGeometry.h"
Include dependency graph for PfieldGeometry.cpp:
Go to the source code of this file.
Functions | |
bool | pointPerpendicularToLine (const PfVec &l1, const PfVec &l2, const PfVec &p, double &distance, PfVec &perpendicularPoint) |
Determines if a point is perpendicular to a line. | |
double | theta (const PfVec &p1, const PfVec &p2) |
Only used by reduceToConvexHullByWrapping. | |
void | reduceToConvexHullByWrapping (Polygon &p) |
Reduces the points of a polygon to its convex hull. | |
int | ccw (const PfVec &p0, const PfVec &p1, const PfVec &p2) |
Checks if three points are ordered counter clockwise. | |
bool | testIntersection (const Line &l1, const Line &l2) |
void | intersectLineAndLine (const Line &l1, const Line &l2, std::vector< PfVec > &intersections) |
Intersects a line with another line (basic intersection checking has to be done before). | |
void | intersectLineAndPolygon (const Line &line, const Polygon &poly, std::vector< PfVec > &intersections) |
void | intersectLineAndCircle (const Line &line, const Circle &circle, std::vector< PfVec > &intersections) |
Intersects a line with a circle (basic intersection checking has to be done before). | |
void | intersectPolygonAndCircle (const Polygon &polygon, const Circle &circle, std::vector< PfVec > &intersections) |
Intersects a polygon with a circle (basic intersection checking has to be done before). | |
void | intersectCircleAndCircle (const Circle &circle1, const Circle &circle2, std::vector< PfVec > &intersections) |
Intersects a circle with a circle (basic intersection checking has to be done before). | |
void | intersectGeometricObjects (PfieldGeometricObject *g1, PfieldGeometricObject *g2, std::vector< PfVec > &intersections) |
Intersects two geometric objects and returns the intersection points as well as significant points of the second object inside the intersection. |
Definition in file PfieldGeometry.cpp.
|
Determines if a point is perpendicular to a line.
Definition at line 14 of file PfieldGeometry.cpp. References PfVec::distanceTo(), EPSILON, PfVec::scalarProduct(), PfVec::x, and PfVec::y. Referenced by Line::distanceTo(), and Polygon::distanceTo(). |
Here is the call graph for this function:
|
Only used by reduceToConvexHullByWrapping.
Definition at line 34 of file PfieldGeometry.cpp. References EPSILON, pi_2, PfVec::x, and PfVec::y. Referenced by reduceToConvexHullByWrapping(). |
|
Reduces the points of a polygon to its convex hull.
Definition at line 61 of file PfieldGeometry.cpp. References pi2, Polygon::pts, and theta(). Referenced by BetweenFormation::updateGeometry(), and AmongFormation::updateGeometry(). |
Here is the call graph for this function:
|
Checks if three points are ordered counter clockwise.
Definition at line 105 of file PfieldGeometry.cpp. References PfVec::x, and PfVec::y. Referenced by testIntersection(). |
|
Definition at line 132 of file PfieldGeometry.cpp. References ccw(), Line::p1, and Line::p2. Referenced by intersectLineAndLine(). |
Here is the call graph for this function:
|
Intersects a line with another line (basic intersection checking has to be done before).
Definition at line 139 of file PfieldGeometry.cpp. References Line::p1, Line::p2, testIntersection(), PfVec::x, and PfVec::y. Referenced by intersectGeometricObjects(), and intersectLineAndPolygon(). |
Here is the call graph for this function:
|
Definition at line 161 of file PfieldGeometry.cpp. References intersectLineAndLine(), Line::p1, Line::p2, and Polygon::pts. Referenced by intersectGeometricObjects(). |
Here is the call graph for this function:
|
Intersects a line with a circle (basic intersection checking has to be done before).
Definition at line 175 of file PfieldGeometry.cpp. References Line::p1, Line::p2, PfieldGeometricObject::position, PfieldGeometricObject::radiusOfCollisionCircle, and PfVec::scalarProduct(). Referenced by intersectGeometricObjects(), and intersectPolygonAndCircle(). |
Here is the call graph for this function:
|
Intersects a polygon with a circle (basic intersection checking has to be done before).
Definition at line 215 of file PfieldGeometry.cpp. References intersectLineAndCircle(), Line::p1, Line::p2, and Polygon::pts. Referenced by intersectGeometricObjects(). |
Here is the call graph for this function:
|
Intersects a circle with a circle (basic intersection checking has to be done before).
Definition at line 229 of file PfieldGeometry.cpp. References EPSILON, pi, PfieldGeometricObject::position, Circle::radius, PfVec::x, and PfVec::y. Referenced by intersectGeometricObjects(). |
|
Intersects two geometric objects and returns the intersection points as well as significant points of the second object inside the intersection.
Definition at line 297 of file PfieldGeometry.cpp. References CIRCLE, PfieldGeometricObject::getType(), PfieldGeometricObject::intersectable, intersectCircleAndCircle(), intersectLineAndCircle(), intersectLineAndLine(), intersectLineAndPolygon(), intersectPolygonAndCircle(), PfVec::length(), LINE, POLYGON, PfieldGeometricObject::position, and PfieldGeometricObject::radiusOfCollisionCircle. Referenced by FutureWorldModelGenerator::getMaxRotationForObject(), and FutureWorldModelGenerator::getMaxTranslationForObject(). |
Here is the call graph for this function: