Commit e7cc45dd authored by Jan Möbius's avatar Jan Möbius

Merge branch 'fixOpenVolumeMeshCorePicking' into 'master'

Fix open volume mesh core picking

See merge request !12
parents 09343ea1 2e0db28f
......@@ -263,21 +263,21 @@ void VolumeMeshBufferManager<VolumeMesh>::calculateVertexDeclaration()
if (mPrimitiveMode != PM_NONE) //should always be the case
{
mVertexDeclaration.addElement(GL_FLOAT, 3, ACG::VERTEX_USAGE_POSITION, reinterpret_cast<GLuint*>(currentOffset));
mVertexDeclaration.addElement(GL_FLOAT, 3, ACG::VERTEX_USAGE_POSITION, reinterpret_cast<GLuint*>(currentOffset),0, 0, mBuffer);
currentOffset += 3*sizeof(float);
}
if (mNormalMode != NM_NONE)
{
mNormalOffset = currentOffset;
mVertexDeclaration.addElement(GL_FLOAT, 3, ACG::VERTEX_USAGE_NORMAL, reinterpret_cast<GLuint*>(currentOffset));
mVertexDeclaration.addElement(GL_FLOAT, 3, ACG::VERTEX_USAGE_NORMAL, reinterpret_cast<GLuint*>(currentOffset),0, 0, mBuffer);
currentOffset += 3*sizeof(float);
}
if ((mColorMode != CM_NO_COLORS) || mShowIrregularInnerEdges || mShowIrregularOuterValence2Edges)
{
mColorOffset = currentOffset;
mVertexDeclaration.addElement(GL_UNSIGNED_BYTE, 4, ACG::VERTEX_USAGE_COLOR, reinterpret_cast<GLuint*>(currentOffset));
mVertexDeclaration.addElement(GL_UNSIGNED_BYTE, 4, ACG::VERTEX_USAGE_COLOR, reinterpret_cast<GLuint*>(currentOffset),0, 0, mBuffer);
currentOffset += 4*sizeof(char);
}
......@@ -287,7 +287,7 @@ void VolumeMeshBufferManager<VolumeMesh>::calculateVertexDeclaration()
unsigned char numOfCoords = 0;
if (mTexCoordMode == TCM_SINGLE_2D)
numOfCoords = 2;
mVertexDeclaration.addElement(GL_FLOAT, numOfCoords, ACG::VERTEX_USAGE_TEXCOORD, reinterpret_cast<GLuint*>(currentOffset));
mVertexDeclaration.addElement(GL_FLOAT, numOfCoords, ACG::VERTEX_USAGE_TEXCOORD, reinterpret_cast<GLuint*>(currentOffset),0, 0, mBuffer);
currentOffset += numOfCoords * sizeof(float);
}
......
......@@ -214,6 +214,16 @@ private:
void pickFaces(GLState& _state, unsigned int _offset);
/// pick cells
void pickCells(GLState& _state, unsigned int _offset);
/// pick vertices using opengl compatibility profile
void pickVerticesCompat(GLState& _state);
/// pick edges using opengl compatibility profile
void pickEdgesCompat(GLState& _state, unsigned int _offset);
/// pick faces using opengl compatibility profile
void pickFacesCompat(GLState& _state, unsigned int _offset);
/// pick cells using opengl compatibility profile
void pickCellsCompat(GLState& _state, unsigned int _offset);
/// picking using opengl compatibility profile
void pickCompat(GLState& _state, PickTarget _target);
/// updates face normals
void update_face_normals();
......@@ -284,6 +294,7 @@ private:
//=============================================================================
#if defined(INCLUDE_TEMPLATES) && !defined(VOLUMEMESHNODET_CC)
#include "VolumeMeshNodeT.cc"
#include "VolumeMeshNodeGLCompatT.cc"
#endif
//=============================================================================
#endif // VOLUMEMESHNODE_HH
......
This diff is collapsed.
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