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.
|
||||
*/
|
||||
|
||||
@@ -32,8 +32,8 @@ class OSG_EXPORT CullingSet : public Referenced
|
||||
public:
|
||||
|
||||
typedef std::pair< osg::ref_ptr<osg::StateSet>, osg::Polytope > StateFrustumPair;
|
||||
typedef std::vector< StateFrustumPair > StateFrustumList;
|
||||
|
||||
typedef std::vector< StateFrustumPair > StateFrustumList;
|
||||
|
||||
CullingSet();
|
||||
|
||||
CullingSet(const CullingSet& cs):
|
||||
@@ -63,18 +63,18 @@ class OSG_EXPORT CullingSet : public Referenced
|
||||
itr->transformProvidingInverse(matrix);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
CullingSet& operator = (const CullingSet& cs)
|
||||
{
|
||||
if (this==&cs) return *this;
|
||||
|
||||
|
||||
_mask = cs._mask;
|
||||
_frustum = cs._frustum;
|
||||
_stateFrustumList = cs._stateFrustumList;
|
||||
_occluderList = cs._occluderList;
|
||||
_pixelSizeVector = cs._pixelSizeVector;
|
||||
_smallFeatureCullingPixelSize = cs._smallFeatureCullingPixelSize;
|
||||
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@ class OSG_EXPORT CullingSet : public Referenced
|
||||
_pixelSizeVector = cs._pixelSizeVector;
|
||||
_smallFeatureCullingPixelSize = cs._smallFeatureCullingPixelSize;
|
||||
}
|
||||
|
||||
|
||||
inline void set(const CullingSet& cs,const Matrix& matrix, const Vec4& pixelSizeVector)
|
||||
{
|
||||
_mask = cs._mask;
|
||||
@@ -99,9 +99,9 @@ class OSG_EXPORT CullingSet : public Referenced
|
||||
|
||||
//_frustum = cs._frustum;
|
||||
//_frustum.transformProvidingInverse(matrix);
|
||||
|
||||
|
||||
_frustum.setAndTransformProvidingInverse(cs._frustum,matrix);
|
||||
|
||||
|
||||
for(StateFrustumList::iterator sitr=_stateFrustumList.begin();
|
||||
sitr!=_stateFrustumList.end();
|
||||
++sitr)
|
||||
@@ -115,9 +115,9 @@ class OSG_EXPORT CullingSet : public Referenced
|
||||
{
|
||||
oitr->transformProvidingInverse(matrix);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
typedef std::vector<ShadowVolumeOccluder> OccluderList;
|
||||
|
||||
typedef int Mask;
|
||||
@@ -147,10 +147,10 @@ class OSG_EXPORT CullingSet : public Referenced
|
||||
void setFrustum(Polytope& cv) { _frustum = cv; }
|
||||
|
||||
Polytope& getFrustum() { return _frustum; }
|
||||
const Polytope& getFrustum() const { return _frustum; }
|
||||
|
||||
const Polytope& getFrustum() const { return _frustum; }
|
||||
|
||||
void addStateFrustum(StateSet* stateset, Polytope& polytope) { _stateFrustumList.push_back(StateFrustumPair(stateset,polytope)); }
|
||||
|
||||
|
||||
void getStateFrustumList(StateFrustumList& sfl) { _stateFrustumList = sfl; }
|
||||
StateFrustumList& getStateFrustumList() { return _stateFrustumList; }
|
||||
|
||||
@@ -164,12 +164,12 @@ class OSG_EXPORT CullingSet : public Referenced
|
||||
/** Threshold at which small features are culled.
|
||||
\param value Boulding volume size in screen space. Default is 2.0. */
|
||||
void setSmallFeatureCullingPixelSize(float value) { _smallFeatureCullingPixelSize=value; }
|
||||
|
||||
|
||||
float& getSmallFeatureCullingPixelSize() { return _smallFeatureCullingPixelSize; }
|
||||
|
||||
float getSmallFeatureCullingPixelSize() const { return _smallFeatureCullingPixelSize; }
|
||||
|
||||
|
||||
|
||||
|
||||
/** Compute the pixel of an object at position v, with specified radius.*/
|
||||
float pixelSize(const Vec3& v,float radius) const { return radius/(v*_pixelSizeVector); }
|
||||
|
||||
@@ -190,7 +190,7 @@ class OSG_EXPORT CullingSet : public Referenced
|
||||
// is it outside the view frustum...
|
||||
if (!_frustum.contains(vertices)) return true;
|
||||
}
|
||||
|
||||
|
||||
if (_mask&SMALL_FEATURE_CULLING)
|
||||
{
|
||||
}
|
||||
@@ -208,10 +208,10 @@ class OSG_EXPORT CullingSet : public Referenced
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
inline bool isCulled(const BoundingBox& bb)
|
||||
{
|
||||
if (_mask&VIEW_FRUSTUM_CULLING)
|
||||
@@ -219,7 +219,7 @@ class OSG_EXPORT CullingSet : public Referenced
|
||||
// is it outside the view frustum...
|
||||
if (!_frustum.contains(bb)) return true;
|
||||
}
|
||||
|
||||
|
||||
if (_mask&SMALL_FEATURE_CULLING)
|
||||
{
|
||||
}
|
||||
@@ -237,10 +237,10 @@ class OSG_EXPORT CullingSet : public Referenced
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
inline bool isCulled(const BoundingSphere& bs)
|
||||
{
|
||||
if (_mask&VIEW_FRUSTUM_CULLING)
|
||||
@@ -248,7 +248,7 @@ class OSG_EXPORT CullingSet : public Referenced
|
||||
// is it outside the view frustum...
|
||||
if (!_frustum.contains(bs)) return true;
|
||||
}
|
||||
|
||||
|
||||
if (_mask&SMALL_FEATURE_CULLING)
|
||||
{
|
||||
if (((bs.center()*_pixelSizeVector)*_smallFeatureCullingPixelSize)>bs.radius()) return true;
|
||||
@@ -267,14 +267,14 @@ class OSG_EXPORT CullingSet : public Referenced
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
inline void pushCurrentMask()
|
||||
{
|
||||
_frustum.pushCurrentMask();
|
||||
|
||||
|
||||
if (!_stateFrustumList.empty())
|
||||
{
|
||||
for(StateFrustumList::iterator itr=_stateFrustumList.begin();
|
||||
@@ -298,7 +298,7 @@ class OSG_EXPORT CullingSet : public Referenced
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
inline void popCurrentMask()
|
||||
{
|
||||
_frustum.popCurrentMask();
|
||||
@@ -325,23 +325,23 @@ class OSG_EXPORT CullingSet : public Referenced
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
void disableAndPushOccludersCurrentMask(NodePath& nodePath);
|
||||
|
||||
void popOccludersCurrentMask(NodePath& nodePath);
|
||||
|
||||
|
||||
static osg::Vec4 computePixelSizeVector(const Viewport& W, const Matrix& P, const Matrix& M);
|
||||
|
||||
virtual ~CullingSet();
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
Mask _mask;
|
||||
Polytope _frustum;
|
||||
StateFrustumList _stateFrustumList;
|
||||
OccluderList _occluderList;
|
||||
StateFrustumList _stateFrustumList;
|
||||
OccluderList _occluderList;
|
||||
Vec4 _pixelSizeVector;
|
||||
float _smallFeatureCullingPixelSize;
|
||||
|
||||
@@ -349,4 +349,4 @@ class OSG_EXPORT CullingSet : public Referenced
|
||||
|
||||
} // end of namespace
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user