Added better support for btUniformScalingShape, by moving some data that is not shared from btConvexShape to btConvexInternalShape. This reduces the sizeof btUniformScalingShape to 16 bytes (from 64).
This is good when having lots of re-used shapes with different sizes. Convex shapes will need to derive from btConvexInternalShape (which is a subclass of btConvexShape). We could have renamed btConvexShape to 'btConvexShapeInterface' (can still do that later)
This commit is contained in:
@@ -33,6 +33,8 @@ class btUniformScalingShape : public btConvexShape
|
||||
|
||||
virtual btVector3 localGetSupportingVertexWithoutMargin(const btVector3& vec)const;
|
||||
|
||||
virtual btVector3 localGetSupportingVertex(const btVector3& vec)const;
|
||||
|
||||
virtual void batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const;
|
||||
|
||||
virtual void calculateLocalInertia(btScalar mass,btVector3& inertia);
|
||||
@@ -58,7 +60,27 @@ class btUniformScalingShape : public btConvexShape
|
||||
}
|
||||
|
||||
virtual int getShapeType() const { return UNIFORM_SCALING_SHAPE_PROXYTYPE; }
|
||||
|
||||
|
||||
///////////////////////////
|
||||
|
||||
|
||||
///getAabb's default implementation is brute force, expected derived classes to implement a fast dedicated version
|
||||
void getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const;
|
||||
|
||||
virtual void getAabbSlow(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const;
|
||||
|
||||
virtual void setLocalScaling(const btVector3& scaling) ;
|
||||
virtual const btVector3& getLocalScaling() const ;
|
||||
|
||||
virtual void setMargin(btScalar margin);
|
||||
virtual btScalar getMargin() const;
|
||||
|
||||
virtual int getNumPreferredPenetrationDirections() const;
|
||||
|
||||
virtual void getPreferredPenetrationDirection(int index, btVector3& penetrationVector) const;
|
||||
|
||||
|
||||
};
|
||||
|
||||
#endif //BT_UNIFORM_SCALING_SHAPE_H
|
||||
|
||||
Reference in New Issue
Block a user