diff options
Diffstat (limited to 'source/Concept/Framework/modules/interpreter/ball_tracker.c')
-rwxr-xr-x | source/Concept/Framework/modules/interpreter/ball_tracker.c | 7 |
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
{
|