diff --git a/Demos/SliderConstraintDemo/CMakeLists.txt b/Demos/SliderConstraintDemo/CMakeLists.txt new file mode 100644 index 000000000..64e9d363a --- /dev/null +++ b/Demos/SliderConstraintDemo/CMakeLists.txt @@ -0,0 +1,62 @@ +# This is basically the overall name of the project in Visual Studio this is the name of the Solution File + + +# For every executable you have with a main method you should have an add_executable line below. +# For every add executable line you should list every .cpp and .h file you have associated with that executable. + + +# This is the variable for Windows. I use this to define the root of my directory structure. +SET(GLUT_ROOT ${BULLET_PHYSICS_SOURCE_DIR}/Glut) + +# You shouldn't have to modify anything below this line +######################################################## + + +# This is the shortcut to finding GLU, GLUT and OpenGL if they are properly installed on your system +# This should be the case. +INCLUDE (${CMAKE_ROOT}/Modules/FindGLU.cmake) +INCLUDE (${CMAKE_ROOT}/Modules/FindGLUT.cmake) +INCLUDE (${CMAKE_ROOT}/Modules/FindOpenGL.cmake) + + +IF (WIN32) + # This is the Windows code for which Opengl, and Glut are not properly installed + # since I can't install them I must cheat and copy libraries around + INCLUDE_DIRECTORIES(${GLUT_ROOT}) + # LINK_DIRECTORIES(${GLUT_ROOT}\\lib) + IF (${GLUT_glut_LIBRARY} MATCHES "GLUT_glut_LIBRARY-NOTFOUND") + SET(GLUT_glut_LIBRARY ${BULLET_PHYSICS_SOURCE_DIR}/Glut/glut32.lib) + # LINK_LIBRARIES(${GLUT_ROOT}\\lib\\glut32 ${OPENGL_gl_LIBRARY} ${OPENGL_glU_LIBRARY}) + # TARGET_LINK_LIBRARIES(table ${GLUT_ROOT}\\lib\\glut32) +# +# ADD_CUSTOM_COMMAND(TARGET table POST_BUILD COMMAND copy ${GLUT_ROOT}\\lib\\glut32.dll ${GLUT_ROOT}\\bin\\vs2005\\Debug +# COMMAND copy ${GLUT_ROOT}\\lib\\glut32.dll ${GLUT_ROOT}\\bin\\vs2003\\Debug +# COMMAND copy ${GLUT_ROOT}\\lib\\glut32.dll ${GLUT_ROOT}\\bin\\vs6\\Debug) + ELSE (${GLUT_glut_LIBRARY} MATCHES "GLUT_glut_LIBRARY-NOTFOUND") +# LINK_LIBRARIES(${GLUT_glut_LIBRARY} ${OPENGL_gl_LIBRARY} ${OPENGL_glU_LIBRARY}) +# TARGET_LINK_LIBRARIES(table ${GLUT_glut_LIBRARY}) + ENDIF(${GLUT_glut_LIBRARY} MATCHES "GLUT_glut_LIBRARY-NOTFOUND") +# TARGET_LINK_LIBRARIES(table ${OPENGL_gl_LIBRARY}) +# TARGET_LINK_LIBRARIES(table ${OPENGL_glu_LIBRARY}) +ELSE (WIN32) + # This is the lines for linux. This should always work if everything is installed and working fine. +# SET(CMAKE_BUILD_TYPE Debug) +# SET(CMAKE_CXX_FLAGS_DEBUG "-g") + INCLUDE_DIRECTORIES(/usr/include /usr/local/include ${GLUT_INCLUDE_DIR}) +# TARGET_LINK_LIBRARIES(table ${GLUT_glut_LIBRARY} ${OPENGL_gl_LIBRARY} ${OPENGL_glU_LIBRARY}) +# TARGET_LINK_LIBRARIES(checker ${GLUT_glut_LIBRARY} ${OPENGL_gl_LIBRARY} ${OPENGL_glU_LIBRARY}) +ENDIF (WIN32) + +INCLUDE_DIRECTORIES( +${BULLET_PHYSICS_SOURCE_DIR}/src ${BULLET_PHYSICS_SOURCE_DIR}/Demos/OpenGL } +) + +LINK_LIBRARIES( +LibOpenGLSupport LibBulletDynamics LibBulletCollision LibLinearMath ${GLUT_glut_LIBRARY} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} +) + +ADD_EXECUTABLE(SliderConstraintDemo + SliderConstraintDemo.cpp + main.cpp +) + diff --git a/Demos/SliderConstraintDemo/Jamfile b/Demos/SliderConstraintDemo/Jamfile new file mode 100644 index 000000000..c78fd19e0 --- /dev/null +++ b/Demos/SliderConstraintDemo/Jamfile @@ -0,0 +1,3 @@ +SubDir TOP Demos SliderConstraintDemo ; + +BulletDemo SliderConstraintDemo : [ Wildcard *.h *.cpp ] ; diff --git a/Demos/SoftDemo/SoftDemo.cpp b/Demos/SoftDemo/SoftDemo.cpp index 79b492aee..9cbc2acec 100644 --- a/Demos/SoftDemo/SoftDemo.cpp +++ b/Demos/SoftDemo/SoftDemo.cpp @@ -826,7 +826,7 @@ void SoftDemo::renderme() m_cameraTargetPosition=btVector3(0,0,0); /* Anm */ if(!isIdle()) - m_animtime=::GetTickCount()/1000.; + m_animtime=m_clock.getTimeMilliseconds()/1000.f; /* Ray cast */ if(m_raycast) { diff --git a/Demos/SoftDemo/SoftDemo.h b/Demos/SoftDemo/SoftDemo.h index 384100a51..16affffc1 100644 --- a/Demos/SoftDemo/SoftDemo.h +++ b/Demos/SoftDemo/SoftDemo.h @@ -1,3 +1,4 @@ + /* Bullet Continuous Collision Detection and Physics Library Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ diff --git a/src/BulletSoftBody/btSoftBody.cpp b/src/BulletSoftBody/btSoftBody.cpp index baca4b709..74ece5793 100644 --- a/src/BulletSoftBody/btSoftBody.cpp +++ b/src/BulletSoftBody/btSoftBody.cpp @@ -470,15 +470,7 @@ static inline btScalar RayTriangle(const btVector3& org, // Private implementation // -// -static int RaycastInternal(const btSoftBody* psb, - const btVector3& org, - const btVector3& dir, - btScalar& mint, - int& face, - bool bcountonly) -{ - struct RayCaster : btDbvt::ICollide +struct RayCaster : public btDbvt::ICollide { btVector3 o; btVector3 d; @@ -518,6 +510,16 @@ static int RaycastInternal(const btSoftBody* psb, return((ctr-(nd*prj)).length2()<=sqr); } }; + + +// +static int RaycastInternal(const btSoftBody* psb, + const btVector3& org, + const btVector3& dir, + btScalar& mint, + int& face, + bool bcountonly) +{ int cnt=0; if(bcountonly||psb->m_fdbvt.empty()) {/* Full search */ @@ -1515,6 +1517,7 @@ bool btSoftBody::rayCast(const btVector3& org, results.time, results.face,false)!=0); } + return(false); }