added serialization support for gimpact mesh

improved cmake build system for updating the serialization structures
This commit is contained in:
erwin.coumans
2010-01-29 02:50:34 +00:00
parent 701bc64ab7
commit 37f6df2c32
25 changed files with 721 additions and 459 deletions

View File

@@ -27,6 +27,22 @@ IF (USE_GLUT)
BasicDemo.cpp
BasicDemo.h
)
IF (WIN32)
IF (CMAKE_CL_64)
ADD_CUSTOM_COMMAND(
TARGET AppBasicDemo
POST_BUILD
COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${BULLET_PHYSICS_SOURCE_DIR}/glut64.dll ${CMAKE_CURRENT_BINARY_DIR}
)
ELSE(CMAKE_CL_64)
ADD_CUSTOM_COMMAND(
TARGET AppBasicDemo
POST_BUILD
COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${BULLET_PHYSICS_SOURCE_DIR}/GLUT32.DLL ${CMAKE_CURRENT_BINARY_DIR}
)
ENDIF(CMAKE_CL_64)
ENDIF(WIN32)
ELSE (USE_GLUT)
LINK_LIBRARIES(

View File

@@ -1,4 +1,4 @@
SUBDIRS( OpenGL BasicDemo Benchmarks Box2dDemo ConcaveDemo ConstraintDemo ConvexDecompositionDemo GenericJointDemo SerializeDemo )
SUBDIRS( OpenGL BasicDemo Benchmarks Box2dDemo ConcaveDemo ConstraintDemo ConvexDecompositionDemo GimpactTestDemo GenericJointDemo SerializeDemo )
#todo: re-enable the rest of the demos again

View File

@@ -19,9 +19,6 @@ ${BULLET_PHYSICS_SOURCE_DIR}/Extras/Serialize/BulletWorldImporter
)
IF (USE_GLUT)
LINK_LIBRARIES(
OpenGLSupport BulletWorldImporter BulletDynamics BulletCollision LinearMath BulletFileLoader ${GLUT_glut_LIBRARY} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY}
@@ -29,6 +26,7 @@ IF (USE_GLUT)
ADD_EXECUTABLE(AppConstraintDemo
ConstraintDemo.cpp
ConstraintDemo.h
main.cpp
)
ELSE (USE_GLUT)

View File

@@ -26,6 +26,7 @@ IF (USE_GLUT)
main.cpp
)
ELSE(USE_GLUT)
INCLUDE_DIRECTORIES(

View File

@@ -17,7 +17,6 @@ Originally Written by: Marten Svanfeldt
ReWritten by: Francisco León
*/
//#define USE_ODE_QUICKSTEP 1
#include "btBulletDynamicsCommon.h"
@@ -29,9 +28,6 @@ ReWritten by: Francisco Le
#include "GLDebugDrawer.h"
#include "GenericJointDemo.h"
#ifdef USE_ODE_QUICKSTEP
#include "OdeConstraintSolver.h"
#endif
GLDebugDrawer debugDrawer;
@@ -56,12 +52,7 @@ void GenericJointDemo::initPhysics()
btVector3 worldAabbMax(10000,10000,10000);
btBroadphaseInterface* overlappingPairCache = new btAxisSweep3 (worldAabbMin, worldAabbMax);
#ifdef USE_ODE_QUICKSTEP
btConstraintSolver* constraintSolver = new OdeConstraintSolver();
#else
btConstraintSolver* constraintSolver = new btSequentialImpulseConstraintSolver;
#endif
m_dynamicsWorld = new btDiscreteDynamicsWorld(dispatcher,overlappingPairCache,constraintSolver,collision_config);

View File

@@ -9,17 +9,35 @@
# You shouldn't have to modify anything below this line
########################################################
IF (USE_GLUT)
INCLUDE_DIRECTORIES(
${BULLET_PHYSICS_SOURCE_DIR}/src ${BULLET_PHYSICS_SOURCE_DIR}/Demos/OpenGL
)
INCLUDE_DIRECTORIES(
${BULLET_PHYSICS_SOURCE_DIR}/src ${BULLET_PHYSICS_SOURCE_DIR}/Demos/OpenGL
)
LINK_LIBRARIES(
OpenGLSupport BulletDynamics BulletCollision LinearMath GIMPACTUtils ConvexDecomposition ${GLUT_glut_LIBRARY} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY}
)
LINK_LIBRARIES(
OpenGLSupport BulletDynamics BulletCollision LinearMath GIMPACTUtils ConvexDecomposition ${GLUT_glut_LIBRARY} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY}
)
ADD_EXECUTABLE(AppGimpactTestDemo
GimpactTestDemo.cpp
GimpactTestDemo.h
main.cpp
)
ELSE(USE_GLUT)
ADD_EXECUTABLE(AppGimpactTestDemo
GimpactTestDemo.cpp
main.cpp
)
INCLUDE_DIRECTORIES(
${BULLET_PHYSICS_SOURCE_DIR}/src ${BULLET_PHYSICS_SOURCE_DIR}/Demos/OpenGL
)
LINK_LIBRARIES(
OpenGLSupport BulletDynamics BulletCollision LinearMath GIMPACTUtils ConvexDecomposition ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY}
)
ADD_EXECUTABLE(AppGimpactTestDemo
WIN32
GimpactTestDemo.cpp
GimpactTestDemo.h
../OpenGL/Win32AppMain.cpp
Win32GimpactDemo.cpp
)
ENDIF(USE_GLUT)

View File

@@ -626,7 +626,7 @@ void GimpactConcaveDemo::clientMoveAndDisplay()
renderme();
glFlush();
glutSwapBuffers();
swapBuffers();
}
@@ -642,7 +642,7 @@ void GimpactConcaveDemo::displayCallback(void) {
m_dynamicsWorld->debugDrawWorld();
glFlush();
glutSwapBuffers();
swapBuffers();
}
//------------------------------------------------------------------------------

View File

@@ -15,7 +15,15 @@ subject to the following restrictions:
#ifndef TEST_CONCAVE_DEMO_H
#define TEST_CONCAVE_DEMO_H
#ifdef _WINDOWS
#include "Win32DemoApplication.h"
#define PlatformDemoApplication Win32DemoApplication
#else
#include "GlutDemoApplication.h"
#define PlatformDemoApplication GlutDemoApplication
#endif
class btTriangleIndexVertexArray;
class btDefaultCollisionConfiguration;
@@ -47,7 +55,7 @@ struct btCollisionAlgorithmCreateFunc;
///GimpactConcaveDemo shows usage of static concave triangle meshes
///It also shows per-triangle material (friction/restitution) through CustomMaterialCombinerCallback
class GimpactConcaveDemo : public GlutDemoApplication
class GimpactConcaveDemo : public PlatformDemoApplication
{
public:

View File

@@ -0,0 +1,25 @@
#ifdef _WINDOWS
/*
Bullet Continuous Collision Detection and Physics Library
Copyright (c) 2003-2009 Erwin Coumans http://bulletphysics.org
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it freely,
subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
#include "GimpactTestDemo.h"
///The 'createDemo' function is called from Bullet/Demos/OpenGL/Win32AppMain.cpp to instantiate this particular demo
DemoApplication* createDemo()
{
return new GimpactConcaveDemo();
}
#endif

View File

@@ -29,6 +29,24 @@ IF (USE_GLUT)
SerializeDemo.cpp
SerializeDemo.h
)
IF (WIN32)
IF (CMAKE_CL_64)
ADD_CUSTOM_COMMAND(
TARGET AppSerializeDemo
POST_BUILD
COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${BULLET_PHYSICS_SOURCE_DIR}/glut64.dll ${CMAKE_CURRENT_BINARY_DIR}
)
ELSE(CMAKE_CL_64)
ADD_CUSTOM_COMMAND(
TARGET AppSerializeDemo
POST_BUILD
COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${BULLET_PHYSICS_SOURCE_DIR}/GLUT32.DLL ${CMAKE_CURRENT_BINARY_DIR}
)
ENDIF(CMAKE_CL_64)
ENDIF(WIN32)
ELSE (USE_GLUT)
LINK_LIBRARIES(

View File

@@ -15,7 +15,10 @@ subject to the following restrictions:
#define TEST_SERIALIZATION 1
//#define CREATE_NEW_BULLETFILE 1
#ifdef BT_INTERNAL_UPDATE_SERIALIZATION_STRUCTURES
#define CREATE_NEW_BULLETFILE 1
#endif //BT_INTERNAL_UPDATE_SERIALIZATION_STRUCTURES
///create 125 (5x5x5) dynamic object
#define ARRAY_SIZE_X 5