Merge remote-tracking branch 'bp/master'

Conflicts:
	btgui/Bullet3AppSupport/CommonParameterInterface.h
This commit is contained in:
Erwin Coumans
2014-11-02 13:12:16 -08:00
8 changed files with 67 additions and 60 deletions

View File

@@ -52,7 +52,6 @@ ELSE (USE_GLUT)
GenericJointDemo GenericJointDemo
SerializeDemo SerializeDemo
SoftDemo SoftDemo
VectorAdd_OpenCL
VoronoiFractureDemo VoronoiFractureDemo
) )
ENDIF(WIN32) ENDIF(WIN32)

View File

@@ -1,69 +1,73 @@
[![Travis Build Status](https://api.travis-ci.org/bulletphysics/bullet3.png?branch=master)](https://travis-ci.org/bulletphysics/bullet3) [![Travis Build Status](https://api.travis-ci.org/bulletphysics/bullet3.png?branch=master)](https://travis-ci.org/bulletphysics/bullet3)
[![Appveyor Build status](https://ci.appveyor.com/api/projects/status/6sly9uxajr6xsstq)](https://ci.appveyor.com/project/erwincoumans/bullet3) [![Appveyor Build status](https://ci.appveyor.com/api/projects/status/6sly9uxajr6xsstq)](https://ci.appveyor.com/project/erwincoumans/bullet3)
Bullet 3.x GPU rigid body pipeline using OpenCL. # Bullet 3.x GPU rigid body pipeline using OpenCL.
Note that the Bullet 2.x svn repository from http://bullet.googlecode.com Note that the Bullet 2.x svn repository from http://bullet.googlecode.com
is being merged into this repository. is being merged into this repository.
1) The old Bullet2 demos are moved from ObsoleteDemos to AllBullet2Demos 1. The old Bullet2 demos are moved from ObsoleteDemos to AllBullet2Demos
2) A new Bullet 3 API is created 2. A new Bullet 3 API is created
3) All Bullet2 functionality is added to Bullet 3 3. All Bullet2 functionality is added to Bullet 3. Until this is done, you can use the Demos3/BasicGpuDemo/b3GpuDynamicsWorld or explore the Demos3/GpuDemos to check out Bullet 3.
Until this is done, you can use the Demos3/BasicGpuDemo/b3GpuDynamicsWorld
or explore the Demos3/GpuDemos to check out Bullet 3.
You can still use svn or svn externals using the github git repository: use svn co https://github.com/erwincoumans/bullet3/trunk You can still use svn or svn externals using the github git repository: use svn co https://github.com/erwincoumans/bullet3/trunk
The entire collision detection and rigid body dynamics is executed on the GPU. The entire collision detection and rigid body dynamics is executed on the GPU.
Requirements: ## Requirements
A high-end desktop GPU, such as an AMD Radeon 7970 or NVIDIA GTX 680 or similar. A high-end desktop GPU, such as an AMD Radeon 7970 or NVIDIA GTX 680 or similar.
We succesfully tested the software under Windows, Linux and Mac OSX. We succesfully tested the software under Windows, Linux and Mac OSX.
The software currently doesn't work on OpenCL CPU devices. It might run The software currently doesn't work on OpenCL CPU devices. It might run
on a laptop GPU but performance is likely not very good. on a laptop GPU but performance is likely not very good.
## License
License
All source code files are licensed under the permissive zlib license All source code files are licensed under the permissive zlib license
(http://opensource.org/licenses/Zlib) unless marked differently in a particular folder/file. (http://opensource.org/licenses/Zlib) unless marked differently in a particular folder/file.
Build instructions: ## Build instructions
**Windows**
Windows:
Click on build3/vs2010.bat and open build3/vs2010/0MySolution.sln Click on build3/vs2010.bat and open build3/vs2010/0MySolution.sln
Linux and Mac OSX gnu make **Linux and Mac OSX gnu make**
In a terminal type: In a terminal type:
cd build3 cd build3
Dependend on your system (Linux 32bit, 64bit or Mac OSX) use one of the following lines Dependend on your system (Linux 32bit, 64bit or Mac OSX) use one of the following lines
./premake4_linux gmake
./premake4_linux64 gmake ./premake4_linux gmake
./premake4_osx gmake ./premake4_linux64 gmake
./premake4_osx gmake
Then Then
cd gmake cd gmake
make make
**Mac OSX Xcode**
Mac OSX Xcode
Click on build3/xcode4.command or in a terminal window execute Click on build3/xcode4.command or in a terminal window execute
./premake_osx xcode4
Usage: ./premake_osx xcode4
## Usage
The main demo executable will be located in the bin folder. The main demo executable will be located in the bin folder.
The demo starts with App_Bullet3_OpenCL_Demos_* The demo starts with App_Bullet3_OpenCL_Demos_*
You can just run it though a terminal/command prompt, or by clicking it. You can just run it though a terminal/command prompt, or by clicking it.
There are some command-line options, you can see using the --help option. For example, this will perform a benchmark writing to some files: There are some command-line options, you can see using the --help option. For example, this will perform a benchmark writing to some files:
./App_Bullet3_OpenCL_Demos_clew_gmake --benchmark ./App_Bullet3_OpenCL_Demos_clew_gmake --benchmark
```
[--selected_demo=<int>] Start with a selected demo [--selected_demo=<int>] Start with a selected demo
[--benchmark] Run benchmark and export results to file [--benchmark] Run benchmark and export results to file
[--maxFrameCount=<int>] Run the benchmark for <int> frames [--maxFrameCount=<int>] Run the benchmark for <int> frames
@@ -83,7 +87,7 @@ There are some command-line options, you can see using the --help option. For ex
[--debug_kernel_launch] Show debug info at start/end of each kernel launch [--debug_kernel_launch] Show debug info at start/end of each kernel launch
[--use_dbvt] Use the CPU dynamic BVH tree broadphase [--use_dbvt] Use the CPU dynamic BVH tree broadphase
[--allow_opencl_cpu] Allow to use an OpenCL CPU device [--allow_opencl_cpu] Allow to use an OpenCL CPU device
```
You can use mouse picking to grab objects. When holding the ALT of CONTROL key, you have Maya style camera mouse controls. You can use mouse picking to grab objects. When holding the ALT of CONTROL key, you have Maya style camera mouse controls.
Press F1 to create a screenshot. Hit ESCAPE to exit the demo app. Press F1 to create a screenshot. Hit ESCAPE to exit the demo app.
@@ -91,18 +95,18 @@ Press F1 to create a screenshot. Hit ESCAPE to exit the demo app.
Bullet 3.x only implements a small set of collision shapes and constraints: Bullet 3.x only implements a small set of collision shapes and constraints:
Static plane * Static plane
Static concave triangle mesh * Static concave triangle mesh
Sphere * Sphere
Convex Polyhedron * Convex Polyhedron
Compound of Convex Polyhedra * Compound of Convex Polyhedra
Bullet 3.x uses the separating axis test (SAT) between convex polyhedra, testing all vertex - face and edge - edge combinations. For performance it is best to keep the number of edges in a convex polyhedron low, using simple shapes such as a tetrahedron or a box. Bullet 3.x uses the separating axis test (SAT) between convex polyhedra, testing all vertex - face and edge - edge combinations. For performance it is best to keep the number of edges in a convex polyhedron low, using simple shapes such as a tetrahedron or a box.
The constraint solver currently supports two constraints: The constraint solver currently supports two constraints:
point to point constraint (ball-socket * point to point constraint (ball-socket
fixed constraint * fixed constraint
It can be extended to other constraint types. The constraint solver uses the same algorithm as Bullet 2.x. It can be extended to other constraint types. The constraint solver uses the same algorithm as Bullet 2.x.
@@ -110,4 +114,3 @@ It is possibly to try out Bullet 3.x using the Bullet 2.x API, using the b3GpuDy
Copy the source code of both versions in the same location, and click on build3/vs2010_bullet2gpu.bat to generate Visual Studio project files. Copy the source code of both versions in the same location, and click on build3/vs2010_bullet2gpu.bat to generate Visual Studio project files.
See docs folder for further information. See docs folder for further information.

View File

@@ -36,6 +36,7 @@ struct SliderParams
struct CommonParameterInterface struct CommonParameterInterface
{ {
virtual ~CommonParameterInterface() {}
virtual void registerSliderFloatParameter(SliderParams& params)=0; virtual void registerSliderFloatParameter(SliderParams& params)=0;
virtual void syncParameters()=0; virtual void syncParameters()=0;
virtual void removeAllParameters()=0; virtual void removeAllParameters()=0;

View File

@@ -15,6 +15,7 @@ class btDiscreteDynamicsWorld;
///The GraphicsPhysicsBridge let's the graphics engine create graphics representation and synchronize ///The GraphicsPhysicsBridge let's the graphics engine create graphics representation and synchronize
struct GraphicsPhysicsBridge struct GraphicsPhysicsBridge
{ {
virtual ~GraphicsPhysicsBridge() {}
virtual void createRigidBodyGraphicsObject(btRigidBody* body,const btVector3& color) virtual void createRigidBodyGraphicsObject(btRigidBody* body,const btVector3& color)
{ {

View File

@@ -101,6 +101,7 @@ struct sth_texture
struct RenderCallbacks struct RenderCallbacks
{ {
virtual ~RenderCallbacks() {}
virtual void updateTexture(sth_texture* texture, sth_glyph* glyph, int textureWidth, int textureHeight)=0; virtual void updateTexture(sth_texture* texture, sth_glyph* glyph, int textureWidth, int textureHeight)=0;
virtual void render(sth_texture* texture)=0; virtual void render(sth_texture* texture)=0;
}; };

View File

@@ -82,7 +82,7 @@ void b3OutputPrintfVarArgsInternal(const char *str, ...)
char strDebug[B3_MAX_DEBUG_STRING_LENGTH]={0}; char strDebug[B3_MAX_DEBUG_STRING_LENGTH]={0};
va_list argList; va_list argList;
va_start(argList, str); va_start(argList, str);
#ifdef _WIN32 #ifdef _MSC_VER
vsprintf_s(strDebug,B3_MAX_DEBUG_STRING_LENGTH,str,argList); vsprintf_s(strDebug,B3_MAX_DEBUG_STRING_LENGTH,str,argList);
#else #else
vsnprintf(strDebug,B3_MAX_DEBUG_STRING_LENGTH,str,argList); vsnprintf(strDebug,B3_MAX_DEBUG_STRING_LENGTH,str,argList);
@@ -95,7 +95,7 @@ void b3OutputWarningMessageVarArgsInternal(const char *str, ...)
char strDebug[B3_MAX_DEBUG_STRING_LENGTH]={0}; char strDebug[B3_MAX_DEBUG_STRING_LENGTH]={0};
va_list argList; va_list argList;
va_start(argList, str); va_start(argList, str);
#ifdef _WIN32 #ifdef _MSC_VER
vsprintf_s(strDebug,B3_MAX_DEBUG_STRING_LENGTH,str,argList); vsprintf_s(strDebug,B3_MAX_DEBUG_STRING_LENGTH,str,argList);
#else #else
vsnprintf(strDebug,B3_MAX_DEBUG_STRING_LENGTH,str,argList); vsnprintf(strDebug,B3_MAX_DEBUG_STRING_LENGTH,str,argList);
@@ -109,7 +109,7 @@ void b3OutputErrorMessageVarArgsInternal(const char *str, ...)
char strDebug[B3_MAX_DEBUG_STRING_LENGTH]={0}; char strDebug[B3_MAX_DEBUG_STRING_LENGTH]={0};
va_list argList; va_list argList;
va_start(argList, str); va_start(argList, str);
#ifdef _WIN32 #ifdef _MSC_VER
vsprintf_s(strDebug,B3_MAX_DEBUG_STRING_LENGTH,str,argList); vsprintf_s(strDebug,B3_MAX_DEBUG_STRING_LENGTH,str,argList);
#else #else
vsnprintf(strDebug,B3_MAX_DEBUG_STRING_LENGTH,str,argList); vsnprintf(strDebug,B3_MAX_DEBUG_STRING_LENGTH,str,argList);
@@ -149,7 +149,7 @@ void b3SetCustomLeaveProfileZoneFunc(b3LeaveProfileZoneFunc* leaveFunc)
#ifndef _WIN32 #ifndef _MSC_VER
#undef vsprintf_s #undef vsprintf_s
#endif #endif

View File

@@ -618,7 +618,7 @@ cl_program b3OpenCLUtils_compileCLProgramFromString(cl_context clContext, cl_dev
strippedName = strip2(clFileNameForCaching,"\\"); strippedName = strip2(clFileNameForCaching,"\\");
strippedName = strip2(strippedName,"/"); strippedName = strip2(strippedName,"/");
#ifdef _WIN32 #ifdef _MSVC_VER
sprintf_s(binaryFileName,B3_MAX_STRING_LENGTH,"%s/%s.%s.%s.bin",sCachedBinaryPath,strippedName, deviceName,driverVersion ); sprintf_s(binaryFileName,B3_MAX_STRING_LENGTH,"%s/%s.%s.%s.bin",sCachedBinaryPath,strippedName, deviceName,driverVersion );
#else #else
sprintf(binaryFileName,"%s/%s.%s.%s.bin",sCachedBinaryPath,strippedName, deviceName,driverVersion ); sprintf(binaryFileName,"%s/%s.%s.%s.bin",sCachedBinaryPath,strippedName, deviceName,driverVersion );
@@ -765,7 +765,7 @@ cl_program b3OpenCLUtils_compileCLProgramFromString(cl_context clContext, cl_dev
if( fileUpToDate) if( fileUpToDate)
{ {
#ifdef _WIN32 #ifdef _MSC_VER
FILE* file; FILE* file;
if (fopen_s(&file,binaryFileName, "rb")!=0) if (fopen_s(&file,binaryFileName, "rb")!=0)
file=0; file=0;
@@ -892,7 +892,7 @@ cl_program b3OpenCLUtils_compileCLProgramFromString(cl_context clContext, cl_dev
flagsize = sizeof(char)*(strlen(additionalMacros) + strlen(flags) + 5); flagsize = sizeof(char)*(strlen(additionalMacros) + strlen(flags) + 5);
compileFlags = (char*) malloc(flagsize); compileFlags = (char*) malloc(flagsize);
#ifdef _WIN32 #ifdef _MSC_VER
sprintf_s(compileFlags,flagsize, "%s %s", flags, additionalMacros); sprintf_s(compileFlags,flagsize, "%s %s", flags, additionalMacros);
#else #else
sprintf(compileFlags, "%s %s", flags, additionalMacros); sprintf(compileFlags, "%s %s", flags, additionalMacros);
@@ -941,7 +941,7 @@ cl_program b3OpenCLUtils_compileCLProgramFromString(cl_context clContext, cl_dev
{ {
FILE* file=0; FILE* file=0;
#ifdef _WIN32 #ifdef _MSC_VER
if (fopen_s(&file,binaryFileName, "wb")!=0) if (fopen_s(&file,binaryFileName, "wb")!=0)
file=0; file=0;
#else #else

View File

@@ -171,6 +171,7 @@ public:
/* ImplicitFn */ /* ImplicitFn */
struct ImplicitFn struct ImplicitFn
{ {
virtual ~ImplicitFn() {}
virtual btScalar Eval(const btVector3& x)=0; virtual btScalar Eval(const btVector3& x)=0;
}; };
@@ -528,6 +529,7 @@ public:
{ {
struct IControl struct IControl
{ {
virtual ~IControl() {}
virtual void Prepare(AJoint*) {} virtual void Prepare(AJoint*) {}
virtual btScalar Speed(AJoint*,btScalar current) { return(current); } virtual btScalar Speed(AJoint*,btScalar current) { return(current); }
static IControl* Default() { static IControl def;return(&def); } static IControl* Default() { static IControl def;return(&def); }