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:
@@ -52,7 +52,7 @@ static btRigidBody* staticBody = 0;
|
||||
static float waveheight = 5.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
|
||||
|
||||
|
||||
@@ -1258,7 +1258,7 @@ static void Init_TetraBunny(SoftDemo* pdemo)
|
||||
psb->setVolumeMass(150);
|
||||
psb->m_cfg.piterations=2;
|
||||
//psb->m_cfg.piterations=1;
|
||||
pdemo->m_cutting=true;
|
||||
pdemo->m_cutting=false;
|
||||
//psb->getCollisionShape()->setMargin(0.01);
|
||||
psb->m_cfg.collisions = btSoftBody::fCollision::CL_SS+ btSoftBody::fCollision::CL_RS
|
||||
//+ btSoftBody::fCollision::CL_SELF
|
||||
@@ -1302,7 +1302,7 @@ static void Init_TetraCube(SoftDemo* pdemo)
|
||||
//+ btSoftBody::fCollision::CL_SELF
|
||||
;
|
||||
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();
|
||||
newOb->setWorldTransform(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)
|
||||
{
|
||||
newOb->setCollisionShape(m_collisionShapes[0]);
|
||||
@@ -1403,7 +1411,8 @@ void SoftDemo::clientResetScene()
|
||||
|
||||
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)
|
||||
{
|
||||
case 0:
|
||||
case 0:
|
||||
{
|
||||
m_results.fraction=1.f;
|
||||
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)
|
||||
{
|
||||
m_impact = rayFrom+(rayTo-rayFrom)*m_results.fraction;
|
||||
m_drag = false;
|
||||
m_drag = m_cutting ? false : true;
|
||||
m_lastmousepos[0] = x;
|
||||
m_lastmousepos[1] = y;
|
||||
m_node = 0;
|
||||
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:
|
||||
{
|
||||
btSoftBody::Face& f=m_results.body->m_faces[m_results.index];
|
||||
|
||||
Reference in New Issue
Block a user