Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'extern/bullet2/src/BulletCollision/CollisionShapes/btPolyhedralConvexShape.h')
-rw-r--r--extern/bullet2/src/BulletCollision/CollisionShapes/btPolyhedralConvexShape.h38
1 files changed, 10 insertions, 28 deletions
diff --git a/extern/bullet2/src/BulletCollision/CollisionShapes/btPolyhedralConvexShape.h b/extern/bullet2/src/BulletCollision/CollisionShapes/btPolyhedralConvexShape.h
index c35f7512663..4c4ce7feaa7 100644
--- a/extern/bullet2/src/BulletCollision/CollisionShapes/btPolyhedralConvexShape.h
+++ b/extern/bullet2/src/BulletCollision/CollisionShapes/btPolyhedralConvexShape.h
@@ -16,13 +16,14 @@ subject to the following restrictions:
#ifndef BU_SHAPE
#define BU_SHAPE
-#include "../../LinearMath/btPoint3.h"
-#include "../../LinearMath/btMatrix3x3.h"
-#include "btConvexShape.h"
+#include "LinearMath/btPoint3.h"
+#include "LinearMath/btMatrix3x3.h"
+#include "LinearMath/btAabbUtil2.h"
+#include "btConvexInternalShape.h"
-///PolyhedralConvexShape is an interface class for feature based (vertex/edge/face) convex shapes.
-class btPolyhedralConvexShape : public btConvexShape
+///The btPolyhedralConvexShape is an internal interface class for polyhedral convex shapes.
+class btPolyhedralConvexShape : public btConvexInternalShape
{
protected:
@@ -38,7 +39,7 @@ public:
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);
+ virtual void calculateLocalInertia(btScalar mass,btVector3& inertia) const;
inline void getNonvirtualAabb(const btTransform& trans,btVector3& aabbMin,btVector3& aabbMax, btScalar margin) const
@@ -46,33 +47,14 @@ public:
//lazy evaluation of local aabb
btAssert(m_isLocalAabbValid);
-
- btAssert(m_localAabbMin.getX() <= m_localAabbMax.getX());
- btAssert(m_localAabbMin.getY() <= m_localAabbMax.getY());
- btAssert(m_localAabbMin.getZ() <= m_localAabbMax.getZ());
-
-
- btVector3 localHalfExtents = btScalar(0.5)*(m_localAabbMax-m_localAabbMin);
- btVector3 localCenter = btScalar(0.5)*(m_localAabbMax+m_localAabbMin);
-
- btMatrix3x3 abs_b = trans.getBasis().absolute();
-
- btPoint3 center = trans(localCenter);
-
- btVector3 extent = btVector3(abs_b[0].dot(localHalfExtents),
- abs_b[1].dot(localHalfExtents),
- abs_b[2].dot(localHalfExtents));
- extent += btVector3(margin,margin,margin);
-
- aabbMin = center - extent;
- aabbMax = center + extent;
-
-
+ btTransformAabb(m_localAabbMin,m_localAabbMax,margin,trans,aabbMin,aabbMax);
}
virtual void getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const;
+ virtual void setLocalScaling(const btVector3& scaling);
+
void recalcLocalAabb();
virtual int getNumVertices() const = 0 ;