Removed unused code and obsolete comments
This commit is contained in:
parent
df089b80f8
commit
791caf9fbc
2 changed files with 0 additions and 108 deletions
|
@ -53,96 +53,3 @@ void FGAIEntity::Transform() {
|
|||
aip.setOrientation(roll, pitch, hdg);
|
||||
aip.update();
|
||||
}
|
||||
|
||||
/*
|
||||
void FGAIEntity::Transform() {
|
||||
|
||||
// Translate moving object w.r.t eye
|
||||
Point3D sc = globals->get_scenery()->get_center();
|
||||
//cout << "sc0 = " << sc.x() << " sc1 = " << sc.y() << " sc2 = " << sc.z() << '\n';
|
||||
//cout << "op0 = " << obj_pos.x() << " op1 = " << obj_pos.y() << " op2 = " << obj_pos.z() << '\n';
|
||||
|
||||
sgCoord shippos;
|
||||
FastWorldCoordinate(&shippos, sc);
|
||||
position->setTransform( &shippos );
|
||||
//cout << "Transform called\n";
|
||||
}
|
||||
*/
|
||||
|
||||
#if 0
|
||||
// Taken from tileentry.cxx
|
||||
void FGAIEntity::WorldCoordinate(sgCoord *obj_pos, Point3D center) {
|
||||
// setup transforms
|
||||
Point3D geod( pos.lon() * SGD_DEGREES_TO_RADIANS,
|
||||
pos.lat() * SGD_DEGREES_TO_RADIANS,
|
||||
pos.elev() );
|
||||
|
||||
Point3D world_pos = sgGeodToCart( geod );
|
||||
Point3D offset = world_pos - center;
|
||||
|
||||
sgMat4 POS;
|
||||
sgMakeTransMat4( POS, offset.x(), offset.y(), offset.z() );
|
||||
|
||||
sgVec3 obj_rt, obj_up;
|
||||
sgSetVec3( obj_rt, 0.0, 1.0, 0.0); // Y axis
|
||||
sgSetVec3( obj_up, 0.0, 0.0, 1.0); // Z axis
|
||||
|
||||
sgMat4 ROT_lon, ROT_lat, ROT_hdg;
|
||||
sgMakeRotMat4( ROT_lon, lon, obj_up );
|
||||
sgMakeRotMat4( ROT_lat, 90 - lat, obj_rt );
|
||||
sgMakeRotMat4( ROT_hdg, hdg, obj_up );
|
||||
|
||||
sgMat4 TUX;
|
||||
sgCopyMat4( TUX, ROT_hdg );
|
||||
sgPostMultMat4( TUX, ROT_lat );
|
||||
sgPostMultMat4( TUX, ROT_lon );
|
||||
sgPostMultMat4( TUX, POS );
|
||||
|
||||
sgSetCoord( obj_pos, TUX );
|
||||
}
|
||||
#endif
|
||||
/*
|
||||
// Norman's 'fast hack' for above
|
||||
void FGAIEntity::FastWorldCoordinate(sgCoord *obj_pos, Point3D center) {
|
||||
double lon_rad = pos.lon() * SGD_DEGREES_TO_RADIANS;
|
||||
double lat_rad = pos.lat() * SGD_DEGREES_TO_RADIANS;
|
||||
double hdg_rad = hdg * SGD_DEGREES_TO_RADIANS;
|
||||
|
||||
// setup transforms
|
||||
Point3D geod( lon_rad, lat_rad, pos.elev() );
|
||||
|
||||
Point3D world_pos = sgGeodToCart( geod );
|
||||
Point3D offset = world_pos - center;
|
||||
|
||||
sgMat4 mat;
|
||||
|
||||
SGfloat sin_lat = (SGfloat)sin( lat_rad );
|
||||
SGfloat cos_lat = (SGfloat)cos( lat_rad );
|
||||
SGfloat cos_lon = (SGfloat)cos( lon_rad );
|
||||
SGfloat sin_lon = (SGfloat)sin( lon_rad );
|
||||
SGfloat sin_hdg = (SGfloat)sin( hdg_rad ) ;
|
||||
SGfloat cos_hdg = (SGfloat)cos( hdg_rad ) ;
|
||||
|
||||
mat[0][0] = cos_hdg * (SGfloat)sin_lat * (SGfloat)cos_lon - sin_hdg * (SGfloat)sin_lon;
|
||||
mat[0][1] = cos_hdg * (SGfloat)sin_lat * (SGfloat)sin_lon + sin_hdg * (SGfloat)cos_lon;
|
||||
mat[0][2] = -cos_hdg * (SGfloat)cos_lat;
|
||||
mat[0][3] = SG_ZERO;
|
||||
|
||||
mat[1][0] = -sin_hdg * (SGfloat)sin_lat * (SGfloat)cos_lon - cos_hdg * (SGfloat)sin_lon;
|
||||
mat[1][1] = -sin_hdg * (SGfloat)sin_lat * (SGfloat)sin_lon + cos_hdg * (SGfloat)cos_lon;
|
||||
mat[1][2] = sin_hdg * (SGfloat)cos_lat;
|
||||
mat[1][3] = SG_ZERO;
|
||||
|
||||
mat[2][0] = (SGfloat)cos_lat * (SGfloat)cos_lon;
|
||||
mat[2][1] = (SGfloat)cos_lat * (SGfloat)sin_lon;
|
||||
mat[2][2] = (SGfloat)sin_lat;
|
||||
mat[2][3] = SG_ZERO;
|
||||
|
||||
mat[3][0] = offset.x();
|
||||
mat[3][1] = offset.y();
|
||||
mat[3][2] = offset.z();
|
||||
mat[3][3] = SG_ONE ;
|
||||
|
||||
sgSetCoord( obj_pos, mat );
|
||||
}
|
||||
*/
|
||||
|
|
|
@ -47,10 +47,6 @@ class FGAIEntity {
|
|||
|
||||
public:
|
||||
|
||||
// We need some way for this class to display its radio transmissions if on the
|
||||
// same frequency and in the vicinity of the user's aircraft
|
||||
// This may need to be done independently of ATC eg CTAF
|
||||
|
||||
virtual ~FGAIEntity();
|
||||
|
||||
// Run the internal calculations
|
||||
|
@ -59,9 +55,6 @@ public:
|
|||
protected:
|
||||
|
||||
Point3D pos; // WGS84 lat & lon in degrees, elev above sea-level in meters
|
||||
//double lat; //WGS84
|
||||
//double lon; //WGS84
|
||||
//double elev; //Meters
|
||||
double hdg; //True heading in degrees
|
||||
double roll; //degrees
|
||||
double pitch; //degrees
|
||||
|
@ -69,15 +62,7 @@ protected:
|
|||
char* model_path; //Path to the 3D model
|
||||
FGModelPlacement aip;
|
||||
|
||||
//ssgEntity* model;
|
||||
//ssgTransform* position;
|
||||
|
||||
void Transform();
|
||||
|
||||
//void WorldCoordinate(sgCoord *obj_pos, Point3D center);
|
||||
|
||||
//void FastWorldCoordinate(sgCoord *obj_pos, Point3D center);
|
||||
|
||||
};
|
||||
|
||||
#endif // _FG_AIEntity_HXX
|
||||
|
|
Loading…
Reference in a new issue