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:
@@ -67,7 +67,7 @@ void CollectOccludersVisitor::apply(osg::Transform& node)
|
||||
// push the culling mode.
|
||||
pushCurrentMask();
|
||||
|
||||
ref_ptr<osg::Matrix> matrix = createOrReuseMatrix(getModelViewMatrix());
|
||||
ref_ptr<osg::RefMatrix> matrix = createOrReuseMatrix(getModelViewMatrix());
|
||||
node.getLocalToWorldMatrix(*matrix,this);
|
||||
pushModelViewMatrix(matrix.get());
|
||||
|
||||
@@ -86,7 +86,7 @@ void CollectOccludersVisitor::apply(osg::Projection& node)
|
||||
// push the culling mode.
|
||||
pushCurrentMask();
|
||||
|
||||
ref_ptr<osg::Matrix> matrix = createOrReuseMatrix(node.getMatrix());
|
||||
ref_ptr<osg::RefMatrix> matrix = createOrReuseMatrix(node.getMatrix());
|
||||
pushProjectionMatrix(matrix.get());
|
||||
|
||||
handle_cull_callbacks_and_traverse(node);
|
||||
|
||||
Reference in New Issue
Block a user