Jump to content

  • Log In with Google      Sign In   
  • Create Account

#ActualMrRowl

Posted 23 May 2013 - 02:39 AM

Using 2.81 version. It seems to be fast enough for my purposes (about a hundred objects falling on it at once as a demonstration/proof-of-concept). I'll keep that in mind though. Maybe commit your extra test upstream?

 

I just moved to 2.81, and noticed that there's still the same problem. Here's the modification that does the early out (it makes a really significant difference in my app - which is running on mobile devices so I need to get all the performance I can):

 

EDIT: Obviously this tweak is customised for my application which has z-up!

 

 
void btConvexTriangleCallback::processTriangle(btVector3* triangle,int partId, int triangleIndex)

{

  const btCollisionObject* ob = const_cast<btCollisionObject*>(m_triBodyWrap->getCollisionObject());
  //aabb filter NOT is already applied!
  // Quick check on AABB

  const btTransform& tr = ob->getWorldTransform();

  if (

    triangle[0].getZ() < m_aabbMin.getZ() &&

    triangle[1].getZ() < m_aabbMin.getZ() &&

    triangle[2].getZ() < m_aabbMin.getZ()

    )

  {

    return;

  }
 

 

In addition there are some redundant calls to getVertex in btHeightfieldTerrainShape::processAllTriangles, which I've removed, but which will be insignificant!
 


#1MrRowl

Posted 19 May 2013 - 02:16 PM

Using 2.81 version. It seems to be fast enough for my purposes (about a hundred objects falling on it at once as a demonstration/proof-of-concept). I'll keep that in mind though. Maybe commit your extra test upstream?

 

I just moved to 2.81, and noticed that there's still the same problem. Here's the modification that does the early out (it makes a really significant difference in my app - which is running on mobile devices so I need to get all the performance I can):

 

 
void btConvexTriangleCallback::processTriangle(btVector3* triangle,int partId, int triangleIndex)

{

  const btCollisionObject* ob = const_cast<btCollisionObject*>(m_triBodyWrap->getCollisionObject());
  //aabb filter NOT is already applied!
  // Quick check on AABB

  const btTransform& tr = ob->getWorldTransform();

  if (

    triangle[0].getZ() < m_aabbMin.getZ() &&

    triangle[1].getZ() < m_aabbMin.getZ() &&

    triangle[2].getZ() < m_aabbMin.getZ()

    )

  {

    return;

  }
 

 

In addition there are some redundant calls to getVertex in btHeightfieldTerrainShape::processAllTriangles, which I've removed, but which will be insignificant!
 


PARTNERS