Merge pull request #320 from erwincoumans/master
btTriangleMesh::addTriangleIndices, pthread link fix for OpenGLWindow
This commit is contained in:
@@ -53,6 +53,13 @@ endif ()
|
||||
|
||||
if (BUILD_SHARED_LIBS)
|
||||
target_link_libraries(OpenGLWindow Bullet3Common)
|
||||
if (WIN32 OR APPLE)
|
||||
target_link_libraries(OpenGLWindow ${OPENGL_gl_LIBRARY})
|
||||
else()
|
||||
set (CMAKE_THREAD_PREFER_PTHREAD TRUE)
|
||||
FIND_PACKAGE(Threads)
|
||||
target_link_libraries(OpenGLWindow ${CMAKE_THREAD_LIBS_INIT})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
target_link_libraries(OpenGLWindow ${OPENGL_gl_LIBRARY})
|
||||
#target_link_libraries(OpenGLWindow ${OPENGL_gl_LIBRARY})
|
||||
|
||||
@@ -75,6 +75,13 @@ void btTriangleMesh::addIndex(int index)
|
||||
}
|
||||
}
|
||||
|
||||
void btTriangleMesh::addTriangleIndices(int index1, int index2, int index3 )
|
||||
{
|
||||
m_indexedMeshes[0].m_numTriangles++;
|
||||
addIndex( index1 );
|
||||
addIndex( index2 );
|
||||
addIndex( index3 );
|
||||
}
|
||||
|
||||
int btTriangleMesh::findOrAddVertex(const btVector3& vertex, bool removeDuplicateVertices)
|
||||
{
|
||||
|
||||
@@ -52,7 +52,10 @@ class btTriangleMesh : public btTriangleIndexVertexArray
|
||||
///By default addTriangle won't search for duplicate vertices, because the search is very slow for large triangle meshes.
|
||||
///In general it is better to directly use btTriangleIndexVertexArray instead.
|
||||
void addTriangle(const btVector3& vertex0,const btVector3& vertex1,const btVector3& vertex2, bool removeDuplicateVertices=false);
|
||||
|
||||
|
||||
///Add a triangle using its indices. Make sure the indices are pointing within the vertices array, so add the vertices first (and to be sure, avoid removal of duplicate vertices)
|
||||
void addTriangleIndices(int index1, int index2, int index3 );
|
||||
|
||||
int getNumTriangles() const;
|
||||
|
||||
virtual void preallocateVertices(int numverts);
|
||||
|
||||
Reference in New Issue
Block a user