#include <simgear/constants.h>
+#include <osg/Matrix>
+
// #define SG_GEOD_NATIVE_DEGREE
/// Class representing a geodetic location
public:
/// Default constructor, initializes the instance to lat = lon = elev = 0
SGGeod(void);
- /// Initialize from a cartesian vector assumed to be in meters
- /// Note that this conversion is relatively expensive to compute
- /// depricated
- SGGeod(const SGVec3<double>& cart);
- /// Initialize from a geocentric position
- /// Note that this conversion is relatively expensive to compute
- /// depricated
- SGGeod(const SGGeoc& geoc);
/// Factory from angular values in radians and elevation is 0
static SGGeod fromRad(double lon, double lat);
/// Set the geodetic elevation from the argument given in feet
void setElevationFt(double elevation);
+ // Create a local coordinate frame in the earth-centered frame of
+ // reference. X points north, Z points down.
+ // makeSimulationFrameRelative() only includes rotation.
+
+ osg::Matrix makeSimulationFrameRelative();
+ osg::Matrix makeSimulationFrame();
+
+ // Create a Z-up local coordinate frame in the earth-centered frame
+ // of reference. This is what scenery models, etc. expect.
+ // makeZUpFrameRelative() only includes rotation.
+ osg::Matrix makeZUpFrameRelative();
+ osg::Matrix makeZUpFrame();
private:
/// This one is private since construction is not unique if you do
/// not know the units of the arguments. Use the factory methods for
{
}
-inline
-SGGeod::SGGeod(const SGVec3<double>& cart)
-{
- SGGeodesy::SGCartToGeod(cart, *this);
-}
-
-inline
-SGGeod::SGGeod(const SGGeoc& geoc)
-{
- SGVec3<double> cart;
- SGGeodesy::SGGeocToCart(geoc, cart);
- SGGeodesy::SGCartToGeod(cart, *this);
-}
-
inline
SGGeod
SGGeod::fromRad(double lon, double lat)