fix autotools build

fix picking for tetrahedral soft body (demo 29/30)
add text for failing OpenCL kernel build, thanks to Greg
This commit is contained in:
erwin.coumans
2011-09-16 23:58:38 +00:00
parent eb6d511565
commit 4f25d731f9
4 changed files with 77 additions and 9 deletions

View File

@@ -26,8 +26,9 @@ AllBulletDemo_CXXFLAGS=\
-I@top_builddir@/src \ -I@top_builddir@/src \
-I@top_builddir@/Extras/GIMPACTUtils \ -I@top_builddir@/Extras/GIMPACTUtils \
-I@top_builddir@/Extras/ConvexDecomposition \ -I@top_builddir@/Extras/ConvexDecomposition \
-I@top_builddir@/Extras/HACD \
-I@top_builddir@/Extras \ -I@top_builddir@/Extras \
-I@top_builddir@/Demos/OpenGL \ -I@top_builddir@/Demos/OpenGL \
-I@top_builddir@/Demos/SoftDemo \ -I@top_builddir@/Demos/SoftDemo \
$(CXXFLAGS) $(CXXFLAGS)
AllBulletDemo_LDADD=-L../OpenGL -lbulletopenglsupport -L../../src -L../../Extras -lgimpactutils -lconvexdecomposition -lBulletSoftBody -lBulletDynamics -lBulletCollision -lLinearMath -lglui @opengl_LIBS@ AllBulletDemo_LDADD=-L../OpenGL -lbulletopenglsupport -L../../src -L../../Extras -lgimpactutils -lconvexdecomposition -lHACD -lBulletSoftBody -lBulletDynamics -lBulletCollision -lLinearMath -lglui @opengl_LIBS@

View File

@@ -52,7 +52,7 @@ static btRigidBody* staticBody = 0;
static float waveheight = 5.f; static float waveheight = 5.f;
const float TRIANGLE_SIZE=8.f; const float TRIANGLE_SIZE=8.f;
unsigned current_demo=12; int current_demo=29;
#define DEMO_MODE_TIMEOUT 15.f //15 seconds for each demo #define DEMO_MODE_TIMEOUT 15.f //15 seconds for each demo
@@ -1258,7 +1258,7 @@ static void Init_TetraBunny(SoftDemo* pdemo)
psb->setVolumeMass(150); psb->setVolumeMass(150);
psb->m_cfg.piterations=2; psb->m_cfg.piterations=2;
//psb->m_cfg.piterations=1; //psb->m_cfg.piterations=1;
pdemo->m_cutting=true; pdemo->m_cutting=false;
//psb->getCollisionShape()->setMargin(0.01); //psb->getCollisionShape()->setMargin(0.01);
psb->m_cfg.collisions = btSoftBody::fCollision::CL_SS+ btSoftBody::fCollision::CL_RS psb->m_cfg.collisions = btSoftBody::fCollision::CL_SS+ btSoftBody::fCollision::CL_RS
//+ btSoftBody::fCollision::CL_SELF //+ btSoftBody::fCollision::CL_SELF
@@ -1302,7 +1302,7 @@ static void Init_TetraCube(SoftDemo* pdemo)
//+ btSoftBody::fCollision::CL_SELF //+ btSoftBody::fCollision::CL_SELF
; ;
psb->m_materials[0]->m_kLST=0.8; psb->m_materials[0]->m_kLST=0.8;
pdemo->m_cutting=true; pdemo->m_cutting=false;
} }
@@ -1391,6 +1391,14 @@ void SoftDemo::clientResetScene()
btCollisionObject* newOb = new btCollisionObject(); btCollisionObject* newOb = new btCollisionObject();
newOb->setWorldTransform(tr); newOb->setWorldTransform(tr);
newOb->setInterpolationWorldTransform( tr); newOb->setInterpolationWorldTransform( tr);
int lastDemo = (sizeof(demofncs)/sizeof(demofncs[0]))-1;
if (current_demo<0)
current_demo = lastDemo;
if (current_demo > lastDemo)
current_demo =0;
if (current_demo>19) if (current_demo>19)
{ {
newOb->setCollisionShape(m_collisionShapes[0]); newOb->setCollisionShape(m_collisionShapes[0]);
@@ -1403,7 +1411,8 @@ void SoftDemo::clientResetScene()
m_softBodyWorldInfo.m_sparsesdf.Reset(); m_softBodyWorldInfo.m_sparsesdf.Reset();
current_demo=current_demo%(sizeof(demofncs)/sizeof(demofncs[0]));
@@ -1789,7 +1798,7 @@ void SoftDemo::mouseFunc(int button, int state, int x, int y)
{ {
switch(state) switch(state)
{ {
case 0: case 0:
{ {
m_results.fraction=1.f; m_results.fraction=1.f;
DemoApplication::mouseFunc(button,state,x,y); DemoApplication::mouseFunc(button,state,x,y);
@@ -1811,12 +1820,26 @@ void SoftDemo::mouseFunc(int button, int state, int x, int y)
if(m_results.fraction<1.f) if(m_results.fraction<1.f)
{ {
m_impact = rayFrom+(rayTo-rayFrom)*m_results.fraction; m_impact = rayFrom+(rayTo-rayFrom)*m_results.fraction;
m_drag = false; m_drag = m_cutting ? false : true;
m_lastmousepos[0] = x; m_lastmousepos[0] = x;
m_lastmousepos[1] = y; m_lastmousepos[1] = y;
m_node = 0; m_node = 0;
switch(m_results.feature) switch(m_results.feature)
{ {
case btSoftBody::eFeature::Tetra:
{
btSoftBody::Tetra& tet=m_results.body->m_tetras[m_results.index];
m_node=tet.m_n[0];
for(int i=1;i<4;++i)
{
if( (m_node->m_x-m_impact).length2()>
(tet.m_n[i]->m_x-m_impact).length2())
{
m_node=tet.m_n[i];
}
}
break;
}
case btSoftBody::eFeature::Face: case btSoftBody::eFeature::Face:
{ {
btSoftBody::Face& f=m_results.body->m_faces[m_results.index]; btSoftBody::Face& f=m_results.body->m_faces[m_results.index];

View File

@@ -1,4 +1,4 @@
noinst_LIBRARIES = libgimpactutils.a libconvexdecomposition.a libglui.a noinst_LIBRARIES = libgimpactutils.a libconvexdecomposition.a libHACD.a libglui.a
libglui_a_CXXFLAGS = ${CXXFLAGS} -Iglui libglui_a_CXXFLAGS = ${CXXFLAGS} -Iglui
libglui_a_SOURCES =\ libglui_a_SOURCES =\
@@ -73,6 +73,23 @@ libconvexdecomposition_a_SOURCES =\
ConvexDecomposition/bestfitobb.h\ ConvexDecomposition/bestfitobb.h\
ConvexDecomposition/meshvolume.h ConvexDecomposition/meshvolume.h
libHACD_a_CXXFLAGS = ${CXXFLAGS} -IHACD/ -I../src
libHACD_a_SOURCES =\
HACD/hacdGraph.cpp\
HACD/hacdHACD.cpp\
HACD/hacdICHull.cpp\
HACD/hacdManifoldMesh.cpp\
HACD/hacdCircularList.h\
HACD/hacdGraph.h\
HACD/hacdHACD.h\
HACD/hacdICHull.h\
HACD/hacdManifoldMesh.h\
HACD/hacdVector.h\
HACD/hacdVersion.h\
HACD/hacdCircularList.inl\
HACD/hacdVector.inl
libgimpactutils_a_CXXFLAGS = ${CXXFLAGS} -I../src -IGIMPACTUtils -IConvexDecomposition libgimpactutils_a_CXXFLAGS = ${CXXFLAGS} -I../src -IGIMPACTUtils -IConvexDecomposition
libgimpactutils_a_SOURCES = GIMPACTUtils/btGImpactConvexDecompositionShape.cpp GIMPACTUtils/btGImpactConvexDecompositionShape.h libgimpactutils_a_SOURCES = GIMPACTUtils/btGImpactConvexDecompositionShape.cpp GIMPACTUtils/btGImpactConvexDecompositionShape.h

View File

@@ -1503,7 +1503,34 @@ cl_kernel CLFunctions::compileCLKernelFromString( const char* kernelSource, cons
kernel = clCreateKernel(m_cpProgram, kernelName, &ciErrNum); kernel = clCreateKernel(m_cpProgram, kernelName, &ciErrNum);
if (ciErrNum != CL_SUCCESS) if (ciErrNum != CL_SUCCESS)
{ {
printf("Error in clCreateKernel, Line %u in file %s !!!\n\n", __LINE__, __FILE__); const char* msg = "";
switch(ciErrNum)
{
case CL_INVALID_PROGRAM:
msg = "Program is not a valid program object.";
break;
case CL_INVALID_PROGRAM_EXECUTABLE:
msg = "There is no successfully built executable for program.";
break;
case CL_INVALID_KERNEL_NAME:
msg = "kernel_name is not found in program.";
break;
case CL_INVALID_KERNEL_DEFINITION:
msg = "the function definition for __kernel function given by kernel_name such as the number of arguments, the argument types are not the same for all devices for which the program executable has been built.";
break;
case CL_INVALID_VALUE:
msg = "kernel_name is NULL.";
break;
case CL_OUT_OF_HOST_MEMORY:
msg = "Failure to allocate resources required by the OpenCL implementation on the host.";
break;
default:
{
}
}
printf("Error in clCreateKernel for kernel '%s', error is \"%s\", Line %u in file %s !!!\n\n", kernelName, msg, __LINE__, __FILE__);
#ifndef BT_SUPPRESS_OPENCL_ASSERTS #ifndef BT_SUPPRESS_OPENCL_ASSERTS
btAssert(0); btAssert(0);
#endif //BT_SUPPRESS_OPENCL_ASSERTS #endif //BT_SUPPRESS_OPENCL_ASSERTS