#include <cstdlib>
#include <math.h>
Go to the source code of this file.
|
float | getAngle (float startX, float startY, float destX, float destY) |
|
float | getSlopeAngle (float startX, float startY, float startZ, float destX, float destY, float destZ) |
|
float | getSlopeAngleAbs (float startX, float startY, float startZ, float destX, float destY, float destZ) |
|
double | getCircleAreaByRadius (double radius) |
|
double | getCirclePerimeterByRadius (double radius) |
|
double | getCylinderVolume (double height, double radius) |
|
◆ getAngle()
float getAngle |
( |
float |
startX, |
|
|
float |
startY, |
|
|
float |
destX, |
|
|
float |
destY |
|
) |
| |
|
inline |
Utility library to define some global function for geometric calculations
31{
32 auto dx = destX - startX;
33 auto dy = destY - startY;
34
35 auto ang = std::atan2(dy, dx);
36 ang = (ang >= 0) ? ang : 2 * float(M_PI) + ang;
37 return ang;
38}
Referenced by Position::GetAngle().
◆ getCircleAreaByRadius()
double getCircleAreaByRadius |
( |
double |
radius | ) |
|
|
inline |
◆ getCirclePerimeterByRadius()
double getCirclePerimeterByRadius |
( |
double |
radius | ) |
|
|
inline |
57{
58 return radius * M_PI;
59}
◆ getCylinderVolume()
double getCylinderVolume |
( |
double |
height, |
|
|
double |
radius |
|
) |
| |
|
inline |
◆ getSlopeAngle()
float getSlopeAngle |
( |
float |
startX, |
|
|
float |
startY, |
|
|
float |
startZ, |
|
|
float |
destX, |
|
|
float |
destY, |
|
|
float |
destZ |
|
) |
| |
|
inline |
41{
42 float floorDist = std::sqrt(pow(startY - destY, 2.0f) + pow(startX - destX, 2.0f));
43 return atan(std::abs(destZ - startZ) / std::abs(floorDist));
44}
Referenced by dtQueryFilterExt::getCost(), and getSlopeAngleAbs().
◆ getSlopeAngleAbs()
float getSlopeAngleAbs |
( |
float |
startX, |
|
|
float |
startY, |
|
|
float |
startZ, |
|
|
float |
destX, |
|
|
float |
destY, |
|
|
float |
destZ |
|
) |
| |
|
inline |
47{
48 return std::abs(
getSlopeAngle(startX, startY, startZ, destX, destY, destZ));
49}
float getSlopeAngle(float startX, float startY, float startZ, float destX, float destY, float destZ)
Definition: Geometry.h:40
References getSlopeAngle().
Referenced by PathGenerator::GetRequiredHeightToClimb().