Made the more of the OSG's referenced object desctructors protected to ensure

that they arn't created on the stack inappropriately.

Split the implemention of Matrix up so that it is a simple no referenced counted
class and can be safefly created on the stack.  To support referenced counting a
seperate subclass now exists, this is RefMatrix which inherits from both Matrix and
Object.
This commit is contained in:
Robert Osfield
2003-01-10 09:25:42 +00:00
parent f948a3de7c
commit f36bc69c58
53 changed files with 446 additions and 441 deletions

View File

@@ -4,6 +4,8 @@
#include <osgDB/Input>
#include <osgDB/Output>
#include "Matrix.h"
using namespace osg;
using namespace osgDB;
@@ -54,17 +56,12 @@ bool MatrixTransform_readLocalData(Object& obj, Input& fr)
iteratorAdvanced = true;
}
}
static Matrix s_matrix;
}
if (Matrix* tmpMatrix = static_cast<Matrix*>(fr.readObjectOfType(s_matrix)))
Matrix matrix;
if (readMatrix(matrix,fr))
{
transform.setMatrix(*tmpMatrix);
delete tmpMatrix;
transform.setMatrix(matrix);
iteratorAdvanced = true;
}
@@ -76,7 +73,7 @@ bool MatrixTransform_writeLocalData(const Object& obj, Output& fw)
{
const MatrixTransform& transform = static_cast<const MatrixTransform&>(obj);
fw.writeObject(transform.getMatrix());
writeMatrix(transform.getMatrix(),fw);
return true;
}