/// Moves water mesh away from the camera slightly if the camera gets too close on the Z axis.
/// The offset works around graphics artifacts that occurred with the GL_DEPTH_CLAMP when the camera gets extremely close to the mesh (seen on NVIDIA at least).
/// @return Have any nodes changed since the last frame
boolhasChanged()const;
voidmarkUnchanged(){mChanged=false;}
boolhasEyePoint()const;
boolhasViewPoint()const;
voidsetEyePoint(constosg::Vec3f&eye);
constosg::Vec3f&getEyePoint()const;
voidsetViewPoint(constosg::Vec3f&viewPoint);
constosg::Vec3f&getViewPoint()const;
private:
std::vector<Entry>mEntries;
unsignedintmNumEntries;
unsigned intmFrameLastUsed;
double mLastUsageTimeStamp;
boolmChanged;
osg::Vec3fmEyePoint;
boolmHasEyePoint;
osg::Vec3fmViewPoint;
boolmHasViewPoint;
floatmReuseDistance;
};
classViewDataMap:publicosg::Referenced
{
public:
ViewData*getViewData(osg::Object*viewer);
ViewDataMap()
:mReuseDistance(300)// large value should be safe because the visibility of each node is still updated individually for each camera even if the base view was reused.
// this value also serves as a threshold for when a newly loaded LOD gets unloaded again so that if you hover around an LOD transition point the LODs won't keep loading and unloading all the time.