diff --git a/Demos3/GpuDemos/main_opengl3core.cpp b/Demos3/GpuDemos/main_opengl3core.cpp index b3da7dcd5..ba84360fa 100644 --- a/Demos3/GpuDemos/main_opengl3core.cpp +++ b/Demos3/GpuDemos/main_opengl3core.cpp @@ -84,7 +84,7 @@ enum }; b3AlignedObjectArray demoNames; -int selectedDemo = 1; +int selectedDemo = 0; GpuDemo::CreateFunc* allDemos[]= { //ConcaveCompound2Scene::MyCreateFunc, @@ -629,6 +629,8 @@ int main(int argc, char* argv[]) window->setWindowTitle("Bullet 3.x GPU Rigid Body http://bulletphysics.org"); printf("-----------------------------------------------------\n"); + + #ifndef __APPLE__ glewInit(); @@ -640,7 +642,7 @@ int main(int argc, char* argv[]) GLPrimitiveRenderer prim(g_OpenGLWidth,g_OpenGLHeight); - + stash = initFont(&prim); @@ -677,6 +679,68 @@ int main(int argc, char* argv[]) bool syncOnly = false; gReset = false; + { + GLint err; + glEnable(GL_BLEND); + err = glGetError(); + b3Assert(err==GL_NO_ERROR); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glDisable(GL_DEPTH_TEST); + err = glGetError(); + b3Assert(err==GL_NO_ERROR); + window->startRendering(); + glClearColor(1,1,1,1); + glClear(GL_COLOR_BUFFER_BIT| GL_DEPTH_BUFFER_BIT);//|GL_STENCIL_BUFFER_BIT); + glEnable(GL_DEPTH_TEST); + + sth_begin_draw(stash); + //sth_draw_text(stash, droidRegular,12.f, dx, dy-50, "How does this OpenGL True Type font look? ", &dx,width,height); + int spacing = 0;//g_OpenGLHeight; + float sx,sy,dx,dy,lh; + sx = 0; + sy = g_OpenGLHeight; + dx = sx; dy = sy; + //if (1) + const char* msg[] = {"Please wait, initializing the OpenCL demo", + "Please make sure to run the demo on a high-end discrete GPU with OpenCL support", + "The first time it can take a bit longer to compile the OpenCL kernels.", + "Check the console if it takes longer than 1 minute or if a demos has issues.", + "Please share the full commandline output when reporting issues:", + "App_Bullet3_OpenCL_Demos_* >> error.log", + + "", + "", +#ifdef _DEBUG + "Some of the demos load a large .obj file,", + "please use an optimized build of this app for faster parsing", + + "", + "", +#endif + "You can press F1 to create a single screenshot,", + "or press F2 toggle screenshot (useful to create movies)", + "", + "", + "There are various command-line options such as --benchmark", + "See http://github.com/erwincoumans/bullet3 for more information" + }; + int fontSize = 68; + + int nummsg = sizeof(msg)/sizeof(const char*); + for (int i=0;iendRendering(); + } diff --git a/src/Bullet3Dynamics/shared/b3IntegrateTransforms.h b/src/Bullet3Dynamics/shared/b3IntegrateTransforms.h index fd8d529f3..e96f90d3f 100644 --- a/src/Bullet3Dynamics/shared/b3IntegrateTransforms.h +++ b/src/Bullet3Dynamics/shared/b3IntegrateTransforms.h @@ -74,7 +74,7 @@ inline void b3IntegrateTransform( __global b3RigidBodyData_t* body, float timeSt body->m_angVel.z *= angularDamping; b3Float4 angvel = body->m_angVel; - float fAngle = b3Sqrt(b3Dot(angvel, angvel)); + float fAngle = b3Sqrt(b3Dot3F4(angvel, angvel)); //limit the angular motion if(fAngle*timeStep > BT_GPU_ANGULAR_MOTION_THRESHOLD) { diff --git a/src/Bullet3OpenCL/RigidBody/kernels/integrateKernel.h b/src/Bullet3OpenCL/RigidBody/kernels/integrateKernel.h index 6460d65ec..98479bda9 100644 --- a/src/Bullet3OpenCL/RigidBody/kernels/integrateKernel.h +++ b/src/Bullet3OpenCL/RigidBody/kernels/integrateKernel.h @@ -348,7 +348,7 @@ static const char* integrateKernelCL= \ " body->m_angVel.z *= angularDamping;\n" " \n" " b3Float4 angvel = body->m_angVel;\n" -" float fAngle = b3Sqrt(b3Dot(angvel, angvel));\n" +" float fAngle = b3Sqrt(b3Dot3F4(angvel, angvel));\n" " //limit the angular motion\n" " if(fAngle*timeStep > BT_GPU_ANGULAR_MOTION_THRESHOLD)\n" " {\n"