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:
@@ -27,23 +27,23 @@ class SG_EXPORT Projection : public Group
|
||||
META_Node(osg, Projection);
|
||||
|
||||
/** Set the transform's matrix.*/
|
||||
void setMatrix(const Matrix& mat) { (*_matrix) = mat; }
|
||||
void setMatrix(const Matrix& mat) { _matrix = mat; }
|
||||
|
||||
/** Get the transform's matrix. */
|
||||
inline const Matrix& getMatrix() const { return *_matrix; }
|
||||
inline const Matrix& getMatrix() const { return _matrix; }
|
||||
|
||||
/** preMult transform.*/
|
||||
void preMult(const Matrix& mat) { _matrix->preMult(mat); }
|
||||
void preMult(const Matrix& mat) { _matrix.preMult(mat); }
|
||||
|
||||
/** postMult transform.*/
|
||||
void postMult(const Matrix& mat) { _matrix->postMult(mat); }
|
||||
void postMult(const Matrix& mat) { _matrix.postMult(mat); }
|
||||
|
||||
|
||||
protected :
|
||||
|
||||
virtual ~Projection();
|
||||
|
||||
ref_ptr<Matrix> _matrix;
|
||||
Matrix _matrix;
|
||||
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user