From 655dd7522fb60e2ef0e68437337178184109f347 Mon Sep 17 00:00:00 2001 From: sicarius Date: Thu, 22 Feb 2007 13:12:03 +0000 Subject: Codework --- source/Concept/Framework/modules/interpreter/ball_tracker.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'source/Concept/Framework/modules/interpreter/ball_tracker.c') 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 { -- cgit v1.2.3