Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 1, 2015, 3:08:45 PM (10 years ago)
Author:
landauf
Message:

simplified Math: temp is always positive, thus only solution1 is necessary
simplified HUDNavigation: use existing function to calculation aim-position

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/libraries/util/Math.cc

    r10289 r10291  
    360360            return orxonox::Vector3::ZERO;
    361361
    362         float temp = sqrt(discriminant);
    363         float solution1 = (-b + temp) / (2 * a);
    364         float solution2 = (-b - temp) / (2 * a);
    365         float time = 1.0f / std::max(solution1, solution2);
     362        float solution = (-b + sqrt(discriminant)) / (2 * a);
     363        float time = 1.0f / solution;
    366364
    367365        return (targetposition + targetvelocity * time);
Note: See TracChangeset for help on using the changeset viewer.