Changeset View
Changeset View
Standalone View
Standalone View
source/simulation2/helpers/Geometry.h
Show First 20 Lines • Show All 135 Lines • ▼ Show 20 Lines | |||||
/** | /** | ||||
* Used in Footprint when spawning units: | * Used in Footprint when spawning units: | ||||
* This returns the grid point on the rectangle [-x_max, x_max] x [-y_max, y_max] | * This returns the grid point on the rectangle [-x_max, x_max] x [-y_max, y_max] | ||||
* reached after starting at (x_max, 0) and walking a distance k | * reached after starting at (x_max, 0) and walking a distance k | ||||
* counter-clockwise along the perimeter of the rectangle. | * counter-clockwise along the perimeter of the rectangle. | ||||
*/ | */ | ||||
std::pair<int, int> GetPerimeterCoordinates(int x_max, int y_max, int k); | std::pair<int, int> GetPerimeterCoordinates(int x_max, int y_max, int k); | ||||
} // namespace | /** | ||||
* Returns the minimum Euclidean distance from the given point to | |||||
* any point on the given segment. | |||||
* | |||||
* @a and @b represents segment's points. | |||||
* | |||||
*/ | |||||
fixed DistanceToSegment( | |||||
const CFixedVector2D& point, const CFixedVector2D& a, const CFixedVector2D& b); | |||||
} // namespace Geometry | |||||
#endif // INCLUDED_HELPER_GEOMETRY | #endif // INCLUDED_HELPER_GEOMETRY |
Wildfire Games · Phabricator