From: frohlich Date: Sun, 22 Feb 2009 09:15:44 +0000 (+0000) Subject: The scenery center is history for a long time now. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=a3e279f06f44273f5d1273163b6214f8df9c87cf;p=simgear.git The scenery center is history for a long time now. Remove that from the transforms. Modified Files: simgear/scene/model/placement.hxx simgear/scene/model/placementtrans.cxx simgear/scene/model/placementtrans.hxx --- diff --git a/simgear/scene/model/placement.hxx b/simgear/scene/model/placement.hxx index ace50b84..d8eb25d0 100644 --- a/simgear/scene/model/placement.hxx +++ b/simgear/scene/model/placement.hxx @@ -78,9 +78,6 @@ public: double heading_deg); void setOrientation(const SGQuatd& orientation); - SGPlacementTransform * getTransform(void) - { return _position.get(); } - private: // Geodetic position diff --git a/simgear/scene/model/placementtrans.cxx b/simgear/scene/model/placementtrans.cxx index dfb2f7e0..a59c24d4 100644 --- a/simgear/scene/model/placementtrans.cxx +++ b/simgear/scene/model/placementtrans.cxx @@ -64,7 +64,6 @@ public: SGPlacementTransform::SGPlacementTransform(void) : _placement_offset(0, 0, 0), - _scenery_center(0, 0, 0), _rotation(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, @@ -77,7 +76,6 @@ SGPlacementTransform::SGPlacementTransform(const SGPlacementTransform& trans, const osg::CopyOp& copyop): osg::Transform(trans, copyop), _placement_offset(trans._placement_offset), - _scenery_center(trans._scenery_center), _rotation(trans._rotation) { @@ -96,7 +94,7 @@ SGPlacementTransform::computeLocalToWorldMatrix(osg::Matrix& matrix, for (int j = 0; j < 3; ++j) { t(j, i) = _rotation(i, j); } - t(3, i) = _placement_offset(i) - _scenery_center(i); + t(3, i) = _placement_offset(i); } if (_referenceFrame == RELATIVE_RF) @@ -115,7 +113,7 @@ SGPlacementTransform::computeWorldToLocalMatrix(osg::Matrix& matrix, for (int j = 0; j < 3; ++j) { t(j, i) = _rotation(i, j); } - t(3, i) = _placement_offset(i) - _scenery_center(i); + t(3, i) = _placement_offset(i); } t = osg::Matrix::inverse(t); @@ -139,7 +137,6 @@ bool PlacementTrans_readLocalData(osg::Object& obj, osgDB::Input& fr) 0, 0, 1, 0, 0, 0, 0, 1); SGVec3d placementOffset(0, 0, 0); - SGVec3d sceneryCenter(0, 0, 0); if (fr[0].matchWord("rotation") && fr[1].isOpenBracket()) { fr += 2; @@ -163,15 +160,7 @@ bool PlacementTrans_readLocalData(osg::Object& obj, osgDB::Input& fr) else return false; } - if (fr[0].matchWord("sceneryCenter")) { - ++fr; - if (fr.readSequence(sceneryCenter.osg())) - fr += 3; - else - return false; - } trans.setTransform(placementOffset, rotation); - trans.setSceneryCenter(sceneryCenter); return true; } @@ -181,7 +170,6 @@ bool PlacementTrans_writeLocalData(const osg::Object& obj, osgDB::Output& fw) = static_cast(obj); const SGMatrixd& rotation = trans.getRotation(); const SGVec3d& placement = trans.getGlobalPos(); - const SGVec3d& sceneryCenter = trans.getSceneryCenter(); fw.indent() << "rotation {" << std::endl; fw.moveIn(); @@ -201,11 +189,6 @@ bool PlacementTrans_writeLocalData(const osg::Object& obj, osgDB::Output& fw) fw << placement(i) << " "; } fw << std::endl; - fw.indent() << "sceneryCenter "; - for (int i = 0; i < 3; i++) { - fw << sceneryCenter(i) << " "; - } - fw << std::endl; fw.precision(prec); return true; } diff --git a/simgear/scene/model/placementtrans.hxx b/simgear/scene/model/placementtrans.hxx index 21aded0a..b7d42ef3 100644 --- a/simgear/scene/model/placementtrans.hxx +++ b/simgear/scene/model/placementtrans.hxx @@ -47,13 +47,10 @@ public: { _placement_offset = off; dirtyBound(); } void setTransform(const SGVec3d& off, const SGMatrixd& rot) { _placement_offset = off; _rotation = rot; dirtyBound(); } - void setSceneryCenter(const SGVec3d& center) - { _scenery_center = center; dirtyBound(); } const SGVec3d& getGlobalPos() const { return _placement_offset; } const SGMatrixd& getRotation() const { return _rotation; } - const SGVec3d& getSceneryCenter() const { return _scenery_center; } virtual bool computeLocalToWorldMatrix(osg::Matrix&,osg::NodeVisitor*) const; virtual bool computeWorldToLocalMatrix(osg::Matrix&,osg::NodeVisitor*) const; @@ -70,7 +67,6 @@ private: ////////////////////////////////////////////////////////////////// SGVec3d _placement_offset; - SGVec3d _scenery_center; SGMatrixd _rotation; };