aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/api/AI.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/crepe/api/AI.cpp')
-rw-r--r--src/crepe/api/AI.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/crepe/api/AI.cpp b/src/crepe/api/AI.cpp
index 472550b..34e1438 100644
--- a/src/crepe/api/AI.cpp
+++ b/src/crepe/api/AI.cpp
@@ -13,10 +13,10 @@ void AI::make_circle_path(float radius, const vec2 & center, float start_angle,
}
// The step size is determined by the radius (step size is in radians)
- float step = 400.0f / radius;
- // Force at least 16 steps (in case of a small radius)
- if (step > 2 * M_PI / 16) {
- step = 2 * M_PI / 16;
+ float step = RADIUS_TO_STEP / radius;
+ // Force at least MIN_STEP steps (in case of a small radius)
+ if (step > 2 * M_PI / MIN_STEP) {
+ step = 2 * M_PI / MIN_STEP;
}
// The path node distance is determined by the step size and the radius
path_node_distance = radius * step * 0.75f;
@@ -42,10 +42,10 @@ void AI::make_oval_path(float radius_x, float radius_y, const vec2 & center, flo
float max_radius = std::max(radius_x, radius_y);
// The step size is determined by the radius (step size is in radians)
- float step = 400.0f / max_radius;
- // Force at least 16 steps (in case of a small radius)
- if (step > 2 * M_PI / 16) {
- step = 2 * M_PI / 16;
+ float step = RADIUS_TO_STEP / max_radius;
+ // Force at least MIN_STEP steps (in case of a small radius)
+ if (step > 2 * M_PI / MIN_STEP) {
+ step = 2 * M_PI / MIN_STEP;
}
// The path node distance is determined by the step size and the radius
path_node_distance = max_radius * step * 0.75f;