]> git.mxchange.org Git - simgear.git/commitdiff
The scenery center is history for a long time now.
authorfrohlich <frohlich>
Sun, 22 Feb 2009 09:15:44 +0000 (09:15 +0000)
committerTim Moore <timoore@redhat.com>
Sun, 22 Feb 2009 22:49:45 +0000 (23:49 +0100)
Remove that from the transforms.

Modified Files:
simgear/scene/model/placement.hxx
simgear/scene/model/placementtrans.cxx
simgear/scene/model/placementtrans.hxx

simgear/scene/model/placement.hxx
simgear/scene/model/placementtrans.cxx
simgear/scene/model/placementtrans.hxx

index ace50b8495f4f3dec45dab96f4bd80d4a7189dde..d8eb25d06065b99514d5af396e2d74ca0b512217 100644 (file)
@@ -78,9 +78,6 @@ public:
                                double heading_deg);
   void setOrientation(const SGQuatd& orientation);
   
-  SGPlacementTransform * getTransform(void)
-  { return _position.get(); }
-
 private:
 
                                 // Geodetic position
index dfb2f7e0f97661ab7a1620a42b422cd38b08940c..a59c24d4afdcfc2555713de894eaceebd44ef7bf 100644 (file)
@@ -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<const SGPlacementTransform&>(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;
 }
index 21aded0a59892de990065f44c689ce9c3b201f79..b7d42ef3ca69f24ca50f7b82d3ed16d32a183b9c 100644 (file)
@@ -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;
 };