+ 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:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user