From c1a10fd1fecb0c337230d76041b07f8557d460d0 Mon Sep 17 00:00:00 2001 From: "erwin.coumans" Date: Mon, 7 Apr 2008 19:37:04 +0000 Subject: [PATCH] Add support for part/triangle id for GIMPACT. Thanks Alex Silverman: http://www.bulletphysics.com/Bullet/phpBB3/viewtopic.php?f=9&t=2032 --- .../Bullet/btGImpactCollisionAlgorithm.h | 36 +++++++++++++++++-- .../Bullet/btGImpactCollisionAlgorithm.cpp | 2 ++ 2 files changed, 35 insertions(+), 3 deletions(-) diff --git a/Extras/GIMPACT/include/GIMPACT/Bullet/btGImpactCollisionAlgorithm.h b/Extras/GIMPACT/include/GIMPACT/Bullet/btGImpactCollisionAlgorithm.h index 03e229b43..49e206fb8 100755 --- a/Extras/GIMPACT/include/GIMPACT/Bullet/btGImpactCollisionAlgorithm.h +++ b/Extras/GIMPACT/include/GIMPACT/Bullet/btGImpactCollisionAlgorithm.h @@ -256,9 +256,39 @@ public: -//!@} - - + /// Accessor/Mutator pairs for Part and triangleID + void setFace0(int value) + { + m_triface0 = value; + } + int getFace0() + { + return m_triface0; + } + void setFace1(int value) + { + m_triface1 = value; + } + int getFace1() + { + return m_triface1; + } + void setPart0(int value) + { + m_part0 = value; + } + int getPart0() + { + return m_part0; + } + void setPart1(int value) + { + m_part1 = value; + } + int getPart1() + { + return m_part1; + } }; diff --git a/Extras/GIMPACT/src/Bullet/btGImpactCollisionAlgorithm.cpp b/Extras/GIMPACT/src/Bullet/btGImpactCollisionAlgorithm.cpp index 4fe1e53b7..1ec080547 100755 --- a/Extras/GIMPACT/src/Bullet/btGImpactCollisionAlgorithm.cpp +++ b/Extras/GIMPACT/src/Bullet/btGImpactCollisionAlgorithm.cpp @@ -783,6 +783,8 @@ public: { btTriangleShapeEx tri1(triangle[0],triangle[1],triangle[2]); tri1.setMargin(margin); + algorithm->setPart1(partId); + algorithm->setFace1(triangleIndex); algorithm->gimpact_vs_shape( body0,body1,gimpactshape0,&tri1,swapped); }