summaryrefslogtreecommitdiffstats
path: root/source/Concept/Framework/modules/interpreter/ball_tracker.c
diff options
context:
space:
mode:
Diffstat (limited to 'source/Concept/Framework/modules/interpreter/ball_tracker.c')
-rwxr-xr-xsource/Concept/Framework/modules/interpreter/ball_tracker.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/source/Concept/Framework/modules/interpreter/ball_tracker.c b/source/Concept/Framework/modules/interpreter/ball_tracker.c
index 1701121..2d85b96 100755
--- a/source/Concept/Framework/modules/interpreter/ball_tracker.c
+++ b/source/Concept/Framework/modules/interpreter/ball_tracker.c
@@ -109,9 +109,16 @@ void Ball_Tracker::Update()
break;
}
+ if(fabs(mainDirection - secondDirection) > PI)
+ {
+ min(mainDirection, secondDirection) += 2.0f * PI;
+ }
+
direction = (intensity[greatestIntensity] * mainDirection +
intensity[secondIntensity] * secondDirection) /
(intensity[greatestIntensity] + intensity[secondIntensity]);
+
+ direction = easyAngle(direction);
}
else
{