1
0
Fork 0

Adapt to simgear SGMath change.

Simgears SGMath has lost its dependency on osg.
Update includes and code using these methods.
This commit is contained in:
Mathias Froehlich 2012-03-03 13:37:43 +01:00
parent 60e49130b2
commit c71c9aee0a
6 changed files with 7 additions and 4 deletions

View file

@ -1298,7 +1298,7 @@ static void WorldCoordinate(osg::Matrix& obj_pos, double lat,
double lon, double elev, double hdg, double slope)
{
SGGeod geod = SGGeod::fromDegM(lon, lat, elev);
obj_pos = geod.makeZUpFrame();
obj_pos = makeZUpFrame(geod);
// hdg is not a compass heading, but a counter-clockwise rotation
// around the Z axis
obj_pos.preMult(osg::Matrix::rotate(hdg * SGD_DEGREES_TO_RADIANS,

View file

@ -1327,7 +1327,7 @@ static void WorldCoordinate(osg::Matrix& obj_pos, double lat,
double lon, double elev, double hdg, double slope)
{
SGGeod geod = SGGeod::fromDegM(lon, lat, elev);
obj_pos = geod.makeZUpFrame();
obj_pos = makeZUpFrame(geod);
// hdg is not a compass heading, but a counter-clockwise rotation
// around the Z axis
obj_pos.preMult(osg::Matrix::rotate(hdg * SGD_DEGREES_TO_RADIANS,

View file

@ -33,9 +33,9 @@
#include <osg/MatrixTransform>
#include <simgear/constants.h>
#include <simgear/math/SGMath.hxx>
#include <simgear/scene/sky/sky.hxx>
#include <simgear/scene/sky/cloud.hxx>
#include <simgear/scene/util/OsgMath.hxx>
#include <Main/fg_props.hxx>
#include <Main/globals.hxx>
@ -81,7 +81,7 @@ void FGPrecipitationMgr::init()
SGGeod geod = SGGeod::fromDegM(fgGetDouble("/position/longitude-deg", 0.0),
fgGetDouble("/position/latitude-deg", 0.0),
0.0);
osg::Matrix position(geod.makeZUpFrame());
osg::Matrix position(makeZUpFrame(geod));
// Move the precipitation object to player position
transform->setMatrix(position);
// Add to scene graph

View file

@ -29,6 +29,7 @@
#include <simgear/sg_inlines.h>
#include <simgear/math/sg_geodesy.hxx>
#include <simgear/structure/exception.hxx>
#include <simgear/scene/util/OsgMath.hxx>
using std::auto_ptr;
using std::string;

View file

@ -21,6 +21,7 @@
#ifndef FG_POSITIONED_HXX
#define FG_POSITIONED_HXX
#include <string>
#include <vector>
#include <simgear/structure/SGSharedPtr.hxx>

View file

@ -41,6 +41,7 @@
#include <simgear/misc/sg_path.hxx>
#include <simgear/scene/material/EffectCullVisitor.hxx>
#include <simgear/scene/material/matlib.hxx>
#include <simgear/scene/util/OsgMath.hxx>
#include <simgear/scene/util/SGReaderWriterOptions.hxx>
#include <simgear/scene/tgdb/userdata.hxx>
#include <simgear/scene/tgdb/TileEntry.hxx>