void setAzimuth( double az );
void setElevation( double el );
+ void setRoll( double rl );
void setStabilization( bool val );
void setDragArea( double a );
void setLife( double seconds );
double azimuth; // degrees true
double elevation; // degrees
+ double rotation; // degrees
double hs; // horizontal speed (fps)
bool aero_stabilized; // if true, object will point where it's going
double drag_area; // equivalent drag area in ft2
ai_ballistic->setDragArea(entity->eda);
ai_ballistic->setLife(entity->life);
ai_ballistic->setBuoyancy(entity->buoyancy);
- ai_ballistic->setWind_from_east(entity->wind_from_east);
- ai_ballistic->setWind_from_north(entity->wind_from_north);
- ai_ballistic->setWind(entity->wind);
+ ai_ballistic->setWind_from_east(entity->wind_from_east);
+ ai_ballistic->setWind_from_north(entity->wind_from_north);
+ ai_ballistic->setWind(entity->wind);
+ ai_ballistic->setRoll(entity->roll);
ai_ballistic->init();
ai_ballistic->bind();
return ai_ballistic;
-
// submodel.cxx - models a releasable submodel.
// Written by Dave Culp, started Aug 2004
//
entity.altitude = IC.alt;
entity.azimuth = IC.azimuth;
entity.elevation = IC.elevation;
+ entity.roll = IC.roll;
entity.speed = IC.speed;
entity.eda = sm->drag_area;
entity.life = sm->life;
IC.lat = _user_lat_node->getDoubleValue();
IC.lon = _user_lon_node->getDoubleValue();
IC.alt = _user_alt_node->getDoubleValue();
- IC.roll = - _user_roll_node->getDoubleValue(); // rotation about x axis (-ve)
- IC.elevation = - _user_pitch_node->getDoubleValue(); // rotation about y axis (-ve)
+ IC.roll = _user_roll_node->getDoubleValue(); // rotation about x axis
+ IC.elevation = _user_pitch_node->getDoubleValue(); // rotation about y axis
IC.azimuth = _user_heading_node->getDoubleValue(); // rotation about z axis
IC.speed = _user_speed_node->getDoubleValue();
IC.speed_down_fps = _user_speed_down_fps_node->getDoubleValue();
IC.speed_east_fps = _user_speed_east_fps_node->getDoubleValue();
- IC.speed_north_fps = _user_speed_north_fps_node ->getDoubleValue();
+ IC.speed_north_fps = _user_speed_north_fps_node->getDoubleValue();
in[0] = sm->x_offset;
// pre-process the trig functions
- cosRx = cos(IC.roll * SG_DEGREES_TO_RADIANS);
- sinRx = sin(IC.roll * SG_DEGREES_TO_RADIANS);
- cosRy = cos(IC.elevation * SG_DEGREES_TO_RADIANS);
- sinRy = sin(IC.elevation * SG_DEGREES_TO_RADIANS);
+ cosRx = cos(-IC.roll * SG_DEGREES_TO_RADIANS);
+ sinRx = sin(-IC.roll * SG_DEGREES_TO_RADIANS);
+ cosRy = cos(-IC.elevation * SG_DEGREES_TO_RADIANS);
+ sinRy = sin(-IC.elevation * SG_DEGREES_TO_RADIANS);
cosRz = cos(IC.azimuth * SG_DEGREES_TO_RADIANS);
sinRz = sin(IC.azimuth * SG_DEGREES_TO_RADIANS);
// Get submodel initial velocity vector angles in XZ and XY planes.
// This needs to be fixed. This vector should be added to aircraft's vector.
- IC.elevation += (sm->yaw_offset * sinRx) - (sm->pitch_offset * cosRx);
+ IC.elevation += (sm->yaw_offset * sinRx) + (sm->pitch_offset * cosRx);
IC.azimuth += (sm->yaw_offset * cosRx) - (sm->pitch_offset * sinRx);
// For now assume vector is close to airplane's vector. This needs to be fixed.
}
}
-
-
- IC.elevation = atan(IC.total_speed_down/sqrt(IC.total_speed_north * IC.total_speed_north +
- IC.total_speed_east * IC.total_speed_east)) * SG_RADIANS_TO_DEGREES;
+ IC.elevation = -atan(IC.total_speed_down/sqrt(IC.total_speed_north *
+ IC.total_speed_north +
+ IC.total_speed_east * IC.total_speed_east)) * SG_RADIANS_TO_DEGREES;
}
// end of submodel.cxx
+