// Next, calculate time-based precession
double offset = _offset_node->getDoubleValue();
offset -= dt * (0.25 / 60.0); // 360deg/day
- SG_NORMALIZE_RANGE(offset, -360.0, 360.0);
+ offset = SGMiscd::normalizePeriodic(-360.0,360.0,offset);
_offset_node->setDoubleValue(offset);
// No magvar - set the alignment manually
double yaw_rate = _yaw_rate_node->getDoubleValue();
double error = _error_node->getDoubleValue();
double g = _g_node->getDoubleValue();
- int sign = 0;
if ( fabs ( yaw_rate ) > 5 ) {
error += 0.033 * -yaw_rate * dt ;
_last_heading_deg = heading;
heading += offset + align + error;
- SG_NORMALIZE_RANGE(heading, 0.0, 360.0);
+ heading = SGMiscd::normalizePeriodic(0.0,360.0,heading);
_heading_out_node->setDoubleValue(heading);