Commit 8cebd346 authored by Christopher Tenter's avatar Christopher Tenter

fix picking for volume meshes refs #2334

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@19943 383ad7c9-94d9-4d36-a494-682f7c89f535
parent e4a8eb1b
......@@ -438,8 +438,12 @@ private:
GLuint mBuffer;
// local picking offset ?
unsigned int mCurrentPickOffset;
// global picking offset
unsigned int mGlobalPickOffset;
bool mInvalidated;
bool mGeometryChanged;
bool mNormalsChanged;
......
......@@ -65,6 +65,7 @@ VolumeMeshBufferManager<VolumeMesh>::VolumeMeshBufferManager(const VolumeMesh &m
mScale(0.8),
mBuffer(0),
mCurrentPickOffset(-1),
mGlobalPickOffset(0),
mInvalidated(true),
mGeometryChanged(true),
mNormalsChanged(true),
......@@ -1903,7 +1904,7 @@ GLuint VolumeMeshBufferManager<VolumeMesh>::getBuffer()
template <class VolumeMesh>
GLuint VolumeMeshBufferManager<VolumeMesh>::getPickBuffer(ACG::GLState &_state, unsigned int _offset)
{
if (_offset != mCurrentPickOffset)
if (_offset != mCurrentPickOffset || _state.pick_current_index() != mGlobalPickOffset)
invalidateColors();
if ((mBuffer == 0) || optionsChanged() || mInvalidated)
......
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