diff --git a/examples/BasicDemo/CMakeLists.txt b/examples/BasicDemo/CMakeLists.txt index f01a03a51..fcf398b87 100644 --- a/examples/BasicDemo/CMakeLists.txt +++ b/examples/BasicDemo/CMakeLists.txt @@ -60,7 +60,7 @@ SET(AppBasicExampleGui_SRCS ADD_DEFINITIONS(-DB3_USE_STANDALONE_EXAMPLE) LINK_LIBRARIES( - BulletDynamics BulletCollision LinearMath OpenGLWindow Bullet3Common ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} + BulletDynamics BulletCollision LinearMath OpenGLWindow Bullet3Common ) #some code to support OpenGL and Glew cross platform @@ -83,7 +83,7 @@ ELSE(WIN32) ADD_DEFINITIONS("-DGLEW_STATIC") ADD_DEFINITIONS("-DGLEW_DYNAMIC_LOAD_ALL_GLX_FUNCTIONS=1") - LINK_LIBRARIES( X11 pthread dl Xext) + LINK_LIBRARIES( pthread dl ) ENDIF(APPLE) ENDIF(WIN32) diff --git a/examples/SharedMemory/PhysicsServerExample.cpp b/examples/SharedMemory/PhysicsServerExample.cpp index 4a7fa4686..d176e5d07 100644 --- a/examples/SharedMemory/PhysicsServerExample.cpp +++ b/examples/SharedMemory/PhysicsServerExample.cpp @@ -1431,6 +1431,32 @@ extern double gSubStep; extern int gHuskyId; extern btTransform huskyTr; + struct LineSegment + { + btVector3 m_from; + btVector3 m_to; + }; + + struct ColorWidth + { + btVector3FloatData m_color; + int width; + int getHash() const + { + unsigned char r = (unsigned char) m_color.m_floats[0]*255; + unsigned char g = (unsigned char) m_color.m_floats[1]*255; + unsigned char b = (unsigned char) m_color.m_floats[2]*255; + unsigned char w = width; + return r+(256*g)+(256*256*b)+(256*256*256*w); + } + bool equals(const ColorWidth& other) const + { + bool same = ((width == other.width) && (m_color.m_floats[0] == other.m_color.m_floats[0]) && + (m_color.m_floats[1] == other.m_color.m_floats[1]) && + (m_color.m_floats[2] == other.m_color.m_floats[2])); + return same; + } + }; void PhysicsServerExample::drawUserDebugLines() { @@ -1447,32 +1473,6 @@ void PhysicsServerExample::drawUserDebugLines() //if gBatchUserDebugLines is true, batch lines based on color+width, to reduce line draw calls - struct LineSegment - { - btVector3 m_from; - btVector3 m_to; - }; - - struct ColorWidth - { - btVector3FloatData m_color; - int width; - int getHash() const - { - unsigned char r = (unsigned char) m_color.m_floats[0]*255; - unsigned char g = (unsigned char) m_color.m_floats[1]*255; - unsigned char b = (unsigned char) m_color.m_floats[2]*255; - unsigned char w = width; - return r+(256*g)+(256*256*b)+(256*256*256*w); - } - bool equals(const ColorWidth& other) const - { - bool same = ((width == other.width) && (m_color.m_floats[0] == other.m_color.m_floats[0]) && - (m_color.m_floats[1] == other.m_color.m_floats[1]) && - (m_color.m_floats[2] == other.m_color.m_floats[2])); - return same; - } - }; btAlignedObjectArray< btAlignedObjectArray > sortedIndices; btAlignedObjectArray< btAlignedObjectArray > sortedLines;