add support for premade aabb in btStridingMeshInterface/btBvhTriangleMeshShape,

Thanks Roy Eltham, http://code.google.com/p/bullet/issues/detail?id=70
This commit is contained in:
erwin.coumans
2008-08-29 05:39:17 +00:00
parent 80f80df7e3
commit f655eff89f
5 changed files with 47 additions and 5 deletions

View File

@@ -76,3 +76,21 @@ void btTriangleIndexVertexArray::getLockedReadOnlyVertexIndexBase(const unsigned
indicestype = mesh.m_indexType;
}
bool btTriangleIndexVertexArray::hasPremadeAabb() const
{
return (m_hasAabb == 1);
}
void btTriangleIndexVertexArray::setPremadeAabb(const btVector3& aabbMin, const btVector3& aabbMax )
{
m_aabbMin = aabbMin;
m_aabbMax = aabbMax;
m_hasAabb = 1; // this is intentionally an int see notes in header
}
void btTriangleIndexVertexArray::getPremadeAabb(btVector3* aabbMin, btVector3* aabbMax ) const
{
*aabbMin = m_aabbMin;
*aabbMax = m_aabbMax;
}