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
This commit is contained in:
frohlich
2009-02-22 09:15:44 +00:00
committed by Tim Moore
parent d11954e80c
commit a3e279f06f
3 changed files with 2 additions and 26 deletions

View File

@@ -78,9 +78,6 @@ public:
double heading_deg);
void setOrientation(const SGQuatd& orientation);
SGPlacementTransform * getTransform(void)
{ return _position.get(); }
private:
// Geodetic position

View 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;
}

View 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;
};