Move some code (mainly constructors) into header files.

Add parameter to optionally compute local AABB for ConvexPointCloudShape
Add setter and getter for cached local AABB in PolyhedralConvexShape
This commit is contained in:
john.mccutchan
2008-10-08 16:56:08 +00:00
parent 7b1f30f1cf
commit 37f6b006af
6 changed files with 51 additions and 44 deletions

View File

@@ -31,18 +31,41 @@ protected:
btVector3 m_localAabbMax;
bool m_isLocalAabbValid;
btPolyhedralConvexShape();
btPolyhedralConvexShape() :btConvexInternalShape(),
m_localAabbMin(1,1,1),
m_localAabbMax(-1,-1,-1),
m_isLocalAabbValid(false),
m_optionalHull(0)
{
}
public:
//brute force implementations
virtual btVector3 localGetSupportingVertexWithoutMargin(const btVector3& vec)const;
virtual void batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const;
virtual void calculateLocalInertia(btScalar mass,btVector3& inertia) const;
void setCachedLocalAabb (const btVector3& aabbMin, const btVector3& aabbMax)
{
m_isLocalAabbValid = true;
m_localAabbMin = aabbMin;
m_localAabbMax = aabbMax;
}
inline void getCachedLocalAabb (btVector3& aabbMin, btVector3& aabbMax) const
{
btAssert(m_isLocalAabbValid);
aabbMin = m_localAabbMin;
aabbMax = m_localAabbMax;
}
inline void getNonvirtualAabb(const btTransform& trans,btVector3& aabbMin,btVector3& aabbMax, btScalar margin) const
{