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:
@@ -10,7 +10,8 @@ CullStack::CullStack()
|
||||
_frustumVolume=-1.0f;
|
||||
_bbCornerNear = 0;
|
||||
_bbCornerFar = 7;
|
||||
_currentReuseMatrixIndex=0;
|
||||
_currentReuseMatrixIndex=0;
|
||||
_identity = new RefMatrix();
|
||||
}
|
||||
|
||||
|
||||
@@ -126,7 +127,7 @@ void CullStack::popViewport()
|
||||
_MVPW_Stack.pop_back();
|
||||
}
|
||||
|
||||
void CullStack::pushProjectionMatrix(Matrix* matrix)
|
||||
void CullStack::pushProjectionMatrix(RefMatrix* matrix)
|
||||
{
|
||||
_projectionStack.push_back(matrix);
|
||||
|
||||
@@ -181,7 +182,7 @@ void CullStack::popProjectionMatrix()
|
||||
popCullingSet();
|
||||
}
|
||||
|
||||
void CullStack::pushModelViewMatrix(Matrix* matrix)
|
||||
void CullStack::pushModelViewMatrix(RefMatrix* matrix)
|
||||
{
|
||||
_modelviewStack.push_back(matrix);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user