diff --git a/src/osgEarth/ObjectIDPicker b/src/osgEarth/ObjectIDPicker index 8358bfa261..45c985f63e 100644 --- a/src/osgEarth/ObjectIDPicker +++ b/src/osgEarth/ObjectIDPicker @@ -53,6 +53,10 @@ namespace osgEarth { namespace Util void setBuffer(int value) { _buffer = value; } int getBuffer() const { return _buffer; } + //! Size of the RTT image (pixels per side) - must call before setView() + void setRTTSize(int value) { _rttSize = value; } + int getRTTSize() const { return _rttSize; } + using Function = std::function; //! Function to call when the user hovers an object diff --git a/src/osgEarth/ObjectIDPicker.cpp b/src/osgEarth/ObjectIDPicker.cpp index 1ad6c997d2..5c5e0752dc 100644 --- a/src/osgEarth/ObjectIDPicker.cpp +++ b/src/osgEarth/ObjectIDPicker.cpp @@ -105,6 +105,8 @@ ObjectIDPicker::~ObjectIDPicker() void ObjectIDPicker::setView(osgViewer::View* view) { + OE_SOFT_ASSERT_AND_RETURN(_rttSize >= 1, void()); + if (view != _view.get()) { _view = view;