Ran script to remove trailing spaces and tabs
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
|
||||
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
|
||||
*
|
||||
* This library is open source and may be redistributed and/or modified under
|
||||
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
|
||||
* This library is open source and may be redistributed and/or modified under
|
||||
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
|
||||
* (at your option) any later version. The full license is in LICENSE file
|
||||
* included with this distribution, and on the openscenegraph.org website.
|
||||
*
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* OpenSceneGraph Public License for more details.
|
||||
*/
|
||||
#include <osg/CullStack>
|
||||
@@ -28,7 +28,7 @@ CullStack::CullStack()
|
||||
|
||||
_index_modelviewCullingStack = 0;
|
||||
_back_modelviewCullingStack = 0;
|
||||
|
||||
|
||||
_referenceViewPoints.push_back(osg::Vec3(0.0f,0.0f,0.0f));
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ CullStack::CullStack(const CullStack& cs):
|
||||
|
||||
_index_modelviewCullingStack = 0;
|
||||
_back_modelviewCullingStack = 0;
|
||||
|
||||
|
||||
_referenceViewPoints.push_back(osg::Vec3(0.0f,0.0f,0.0f));
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ void CullStack::reset()
|
||||
|
||||
_referenceViewPoints.clear();
|
||||
_referenceViewPoints.push_back(osg::Vec3(0.0f,0.0f,0.0f));
|
||||
|
||||
|
||||
_eyePointStack.clear();
|
||||
_viewPointStack.clear();
|
||||
|
||||
@@ -78,13 +78,13 @@ void CullStack::reset()
|
||||
_back_modelviewCullingStack = 0;
|
||||
|
||||
osg::Vec3 lookVector(0.0,0.0,-1.0);
|
||||
|
||||
|
||||
_bbCornerFar = (lookVector.x()>=0?1:0) |
|
||||
(lookVector.y()>=0?2:0) |
|
||||
(lookVector.z()>=0?4:0);
|
||||
|
||||
_bbCornerNear = (~_bbCornerFar)&7;
|
||||
|
||||
|
||||
_currentReuseMatrixIndex=0;
|
||||
}
|
||||
|
||||
@@ -93,31 +93,31 @@ void CullStack::pushCullingSet()
|
||||
{
|
||||
_MVPW_Stack.push_back(0L);
|
||||
|
||||
if (_index_modelviewCullingStack==0)
|
||||
if (_index_modelviewCullingStack==0)
|
||||
{
|
||||
if (_modelviewCullingStack.empty())
|
||||
_modelviewCullingStack.push_back(CullingSet());
|
||||
|
||||
_modelviewCullingStack[_index_modelviewCullingStack++].set(_projectionCullingStack.back());
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
|
||||
|
||||
const osg::Viewport& W = *_viewportStack.back();
|
||||
const osg::Matrix& P = *_projectionStack.back();
|
||||
const osg::Matrix& M = *_modelviewStack.back();
|
||||
|
||||
osg::Vec4 pixelSizeVector = CullingSet::computePixelSizeVector(W,P,M);
|
||||
|
||||
if (_index_modelviewCullingStack>=_modelviewCullingStack.size())
|
||||
|
||||
if (_index_modelviewCullingStack>=_modelviewCullingStack.size())
|
||||
{
|
||||
_modelviewCullingStack.push_back(CullingSet());
|
||||
}
|
||||
|
||||
|
||||
_modelviewCullingStack[_index_modelviewCullingStack++].set(_projectionCullingStack.back(),*_modelviewStack.back(),pixelSizeVector);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
_back_modelviewCullingStack = &_modelviewCullingStack[_index_modelviewCullingStack-1];
|
||||
|
||||
// const osg::Polytope& polytope = _modelviewCullingStack.back()->getFrustum();
|
||||
@@ -136,7 +136,7 @@ void CullStack::pushCullingSet()
|
||||
void CullStack::popCullingSet()
|
||||
{
|
||||
_MVPW_Stack.pop_back();
|
||||
|
||||
|
||||
--_index_modelviewCullingStack;
|
||||
if (_index_modelviewCullingStack>0) _back_modelviewCullingStack = &_modelviewCullingStack[_index_modelviewCullingStack-1];
|
||||
|
||||
@@ -157,20 +157,20 @@ void CullStack::popViewport()
|
||||
void CullStack::pushProjectionMatrix(RefMatrix* matrix)
|
||||
{
|
||||
_projectionStack.push_back(matrix);
|
||||
|
||||
|
||||
_projectionCullingStack.push_back(osg::CullingSet());
|
||||
osg::CullingSet& cullingSet = _projectionCullingStack.back();
|
||||
|
||||
|
||||
// set up view frustum.
|
||||
cullingSet.getFrustum().setToUnitFrustum(((_cullingMode&NEAR_PLANE_CULLING)!=0),((_cullingMode&FAR_PLANE_CULLING)!=0));
|
||||
cullingSet.getFrustum().transformProvidingInverse(*matrix);
|
||||
|
||||
|
||||
// set the culling mask ( There should be a more elegant way!) Nikolaus H.
|
||||
cullingSet.setCullingMask(_cullingMode);
|
||||
|
||||
// set the small feature culling.
|
||||
cullingSet.setSmallFeatureCullingPixelSize(_smallFeatureCullingPixelSize);
|
||||
|
||||
|
||||
// set up the relevant occluders which a related to this projection.
|
||||
for(ShadowVolumeOccluderList::iterator itr=_occluderList.begin();
|
||||
itr!=_occluderList.end();
|
||||
@@ -183,8 +183,8 @@ void CullStack::pushProjectionMatrix(RefMatrix* matrix)
|
||||
cullingSet.addOccluder(*itr);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// need to recompute frustum volume.
|
||||
_frustumVolume = -1.0f;
|
||||
@@ -210,13 +210,13 @@ void CullStack::pushModelViewMatrix(RefMatrix* matrix, Transform::ReferenceFrame
|
||||
osg::RefMatrix* originalModelView = _modelviewStack.empty() ? 0 : _modelviewStack.back().get();
|
||||
|
||||
_modelviewStack.push_back(matrix);
|
||||
|
||||
|
||||
pushCullingSet();
|
||||
|
||||
|
||||
osg::Matrix inv;
|
||||
inv.invert(*matrix);
|
||||
|
||||
|
||||
|
||||
switch(referenceFrame)
|
||||
{
|
||||
case(Transform::RELATIVE_RF):
|
||||
@@ -232,7 +232,7 @@ void CullStack::pushModelViewMatrix(RefMatrix* matrix, Transform::ReferenceFrame
|
||||
case(Transform::ABSOLUTE_RF_INHERIT_VIEWPOINT):
|
||||
{
|
||||
_eyePointStack.push_back(inv.getTrans());
|
||||
|
||||
|
||||
osg::Vec3 referenceViewPoint = getReferenceViewPoint();
|
||||
if (originalModelView)
|
||||
{
|
||||
@@ -249,20 +249,20 @@ void CullStack::pushModelViewMatrix(RefMatrix* matrix, Transform::ReferenceFrame
|
||||
}
|
||||
|
||||
|
||||
osg::Vec3 lookVector = getLookVectorLocal();
|
||||
|
||||
osg::Vec3 lookVector = getLookVectorLocal();
|
||||
|
||||
_bbCornerFar = (lookVector.x()>=0?1:0) |
|
||||
(lookVector.y()>=0?2:0) |
|
||||
(lookVector.z()>=0?4:0);
|
||||
|
||||
_bbCornerNear = (~_bbCornerFar)&7;
|
||||
|
||||
|
||||
}
|
||||
|
||||
void CullStack::popModelViewMatrix()
|
||||
{
|
||||
_modelviewStack.pop_back();
|
||||
|
||||
|
||||
_eyePointStack.pop_back();
|
||||
_referenceViewPoints.pop_back();
|
||||
_viewPointStack.pop_back();
|
||||
@@ -299,5 +299,5 @@ void CullStack::computeFrustumVolume()
|
||||
|
||||
_frustumVolume = computeVolume(f1,f2,f3,b1,b2,b3)+
|
||||
computeVolume(f2,f3,f4,b1,b3,b4);
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user