Commit 2366e5bf authored by Jan Möbius's avatar Jan Möbius

Check if pick target in cache is the requested one

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@6814 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 0f3faa45
...@@ -801,6 +801,9 @@ private: ...@@ -801,6 +801,9 @@ private:
/// Should the pick cache be updated /// Should the pick cache be updated
bool updatePickCache_; bool updatePickCache_;
/// Pick target stored in pick cache
ACG::SceneGraph::PickTarget pickCacheTarget_;
/// Is pick caching supported /// Is pick caching supported
bool pickCacheSupported_; bool pickCacheSupported_;
......
...@@ -245,6 +245,7 @@ int glViewer::pickColor( ACG::SceneGraph::PickTarget _pickTarget, ...@@ -245,6 +245,7 @@ int glViewer::pickColor( ACG::SceneGraph::PickTarget _pickTarget,
{ {
pickCache_->release (); pickCache_->release ();
updatePickCache_ = false; updatePickCache_ = false;
pickCacheTarget_ = _pickTarget;
} }
// get first found pixel // get first found pixel
...@@ -294,7 +295,8 @@ int glViewer::pickFromCache( ACG::SceneGraph::PickTarget _pickTarget, ...@@ -294,7 +295,8 @@ int glViewer::pickFromCache( ACG::SceneGraph::PickTarget _pickTarget,
ACG::Vec3d* _hitPointPtr ) ACG::Vec3d* _hitPointPtr )
{ {
// do we need an update? // do we need an update?
if (!pickCacheSupported_ || updatePickCache_ || !pickCache_) if (!pickCacheSupported_ || updatePickCache_ || !pickCache_ ||
pickCacheTarget_ != _pickTarget)
return -1; return -1;
GLint x = _mousePos.x() - scenePos().x(), GLint x = _mousePos.x() - scenePos().x(),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment