mirror of https://github.com/OpenMW/openmw.git
Move structs into separate headers, cleanup includes, cleanup forwarders
parent
5078b6822a
commit
ddf43ec42f
@ -0,0 +1,62 @@
|
||||
#ifndef COMPONENTS_TERRAIN_HEIGHTCULL_H
|
||||
#define COMPONENTS_TERRAIN_HEIGHTCULL_H
|
||||
|
||||
#include <osg/ref_ptr>
|
||||
#include <osg/Referenced>
|
||||
|
||||
#include <limits>
|
||||
|
||||
#include <components/sceneutil/nodecallback.hpp>
|
||||
|
||||
namespace osg
|
||||
{
|
||||
class Node;
|
||||
class NodeVisitor;
|
||||
}
|
||||
|
||||
namespace Terrain
|
||||
{
|
||||
class HeightCullCallback : public SceneUtil::NodeCallback<HeightCullCallback>
|
||||
{
|
||||
public:
|
||||
void setLowZ(float z)
|
||||
{
|
||||
mLowZ = z;
|
||||
}
|
||||
float getLowZ() const
|
||||
{
|
||||
return mLowZ;
|
||||
}
|
||||
|
||||
void setHighZ(float highZ)
|
||||
{
|
||||
mHighZ = highZ;
|
||||
}
|
||||
float getHighZ() const
|
||||
{
|
||||
return mHighZ;
|
||||
}
|
||||
|
||||
void setCullMask(unsigned int mask)
|
||||
{
|
||||
mMask = mask;
|
||||
}
|
||||
unsigned int getCullMask() const
|
||||
{
|
||||
return mMask;
|
||||
}
|
||||
|
||||
void operator()(osg::Node* node, osg::NodeVisitor* nv)
|
||||
{
|
||||
if (mLowZ <= mHighZ)
|
||||
traverse(node, nv);
|
||||
}
|
||||
private:
|
||||
float mLowZ{ -std::numeric_limits<float>::max() };
|
||||
float mHighZ{ std::numeric_limits<float>::max() };
|
||||
unsigned int mMask{ ~0u };
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
@ -0,0 +1,25 @@
|
||||
#ifndef COMPONENTS_TERRAIN_VIEW_H
|
||||
#define COMPONENTS_TERRAIN_VIEW_H
|
||||
|
||||
#include <osg/ref_ptr>
|
||||
#include <osg/Referenced>
|
||||
#include <osg/Vec3f>
|
||||
|
||||
namespace Terrain
|
||||
{
|
||||
/**
|
||||
* @brief A View is a collection of rendering objects that are visible from a given camera/intersection.
|
||||
* The base View class is part of the interface for usage in conjunction with preload feature.
|
||||
*/
|
||||
class View : public osg::Referenced
|
||||
{
|
||||
public:
|
||||
virtual ~View() {}
|
||||
|
||||
/// Reset internal structure so that the next addition to the view will override the previous frame's contents.
|
||||
virtual void reset() = 0;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
Loading…
Reference in New Issue