mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-24 14:23:54 +00:00
Minor fixes
Add CullVisitor include. Swap return values of cull callback.
This commit is contained in:
parent
43eb739313
commit
42711089e7
1 changed files with 5 additions and 4 deletions
|
@ -6,6 +6,7 @@
|
||||||
#include <osg/Geometry>
|
#include <osg/Geometry>
|
||||||
#include <osg/Program>
|
#include <osg/Program>
|
||||||
#include <osg/VertexAttribDivisor>
|
#include <osg/VertexAttribDivisor>
|
||||||
|
#include <osgUtil/CullVisitor>
|
||||||
|
|
||||||
#include <components/esm3/esmreader.hpp>
|
#include <components/esm3/esmreader.hpp>
|
||||||
#include <components/esm3/loadland.hpp>
|
#include <components/esm3/loadland.hpp>
|
||||||
|
@ -56,10 +57,10 @@ namespace MWRender
|
||||||
|
|
||||||
if (cnfMode != osg::CullSettings::COMPUTE_NEAR_FAR_USING_PRIMITIVES
|
if (cnfMode != osg::CullSettings::COMPUTE_NEAR_FAR_USING_PRIMITIVES
|
||||||
&& cnfMode != osg::CullSettings::COMPUTE_NEAR_USING_PRIMITIVES)
|
&& cnfMode != osg::CullSettings::COMPUTE_NEAR_USING_PRIMITIVES)
|
||||||
return true;
|
return false;
|
||||||
|
|
||||||
if (drawable->isCullingActive() && cullVisitor.isCulled(boundingBox))
|
if (drawable->isCullingActive() && cullVisitor.isCulled(boundingBox))
|
||||||
return false;
|
return true;
|
||||||
|
|
||||||
osg::Vec3 lookVector = cullVisitor.getLookVectorLocal();
|
osg::Vec3 lookVector = cullVisitor.getLookVectorLocal();
|
||||||
unsigned int bbCornerFar
|
unsigned int bbCornerFar
|
||||||
|
@ -72,7 +73,7 @@ namespace MWRender
|
||||||
std::swap(dNear, dFar);
|
std::swap(dNear, dFar);
|
||||||
|
|
||||||
if (dFar < 0)
|
if (dFar < 0)
|
||||||
return false;
|
return true;
|
||||||
|
|
||||||
value_type computedZNear = cullVisitor.getCalculatedNearPlane();
|
value_type computedZNear = cullVisitor.getCalculatedNearPlane();
|
||||||
value_type computedZFar = cullVisitor.getCalculatedFarPlane();
|
value_type computedZFar = cullVisitor.getCalculatedFarPlane();
|
||||||
|
@ -122,7 +123,7 @@ namespace MWRender
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
Loading…
Reference in a new issue