+ Internal improvements for collision shapes

1) add AabbCaching versions of btPolyhedralConvexShape and btMultiSphereShape (this speeds up btMultiSphereShape 'getAabb', and reduces size of btBoxShape)
2) btCylinderShape doesn't derive from btBoxShape anymore
+ Minor fixes in drawing for btMultiSphereShape, btBoxShape.
+ Don't re-generate btDebugFont every frame
+ Disabled velocity prediction for btDbvtBroadphase. Previous default can be restored using btDbvtBroadphase->setVelocityPrediction(1./2.);
This commit is contained in:
erwin.coumans
2009-05-22 01:03:45 +00:00
parent c680791ce9
commit 2f1014268b
25 changed files with 380 additions and 90 deletions

View File

@@ -15,11 +15,7 @@ subject to the following restrictions:
#include "BulletCollision/CollisionShapes/btPolyhedralConvexShape.h"
btPolyhedralConvexShape::btPolyhedralConvexShape() :btConvexInternalShape(),
m_localAabbMin(1,1,1),
m_localAabbMax(-1,-1,-1),
m_isLocalAabbValid(false),
m_optionalHull(0)
btPolyhedralConvexShape::btPolyhedralConvexShape() :btConvexInternalShape()
{
}
@@ -120,20 +116,26 @@ void btPolyhedralConvexShape::calculateLocalInertia(btScalar mass,btVector3& ine
void btPolyhedralConvexShape::getAabb(const btTransform& trans,btVector3& aabbMin,btVector3& aabbMax) const
{
getNonvirtualAabb(trans,aabbMin,aabbMax,getMargin());
}
void btPolyhedralConvexShape::setLocalScaling(const btVector3& scaling)
void btPolyhedralConvexAabbCachingShape::setLocalScaling(const btVector3& scaling)
{
btConvexInternalShape::setLocalScaling(scaling);
recalcLocalAabb();
}
void btPolyhedralConvexShape::recalcLocalAabb()
btPolyhedralConvexAabbCachingShape::btPolyhedralConvexAabbCachingShape()
:btPolyhedralConvexShape(),
m_localAabbMin(1,1,1),
m_localAabbMax(-1,-1,-1),
m_isLocalAabbValid(false)
{
}
void btPolyhedralConvexAabbCachingShape::getAabb(const btTransform& trans,btVector3& aabbMin,btVector3& aabbMax) const
{
getNonvirtualAabb(trans,aabbMin,aabbMax,getMargin());
}
void btPolyhedralConvexAabbCachingShape::recalcLocalAabb()
{
m_isLocalAabbValid = true;
@@ -181,5 +183,3 @@ void btPolyhedralConvexShape::recalcLocalAabb()
#endif
}