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:
authorSergej Reich <sergej.reich@googlemail.com>2012-06-08 20:13:01 +0400
committerSergej Reich <sergej.reich@googlemail.com>2012-06-08 20:13:01 +0400
commit82d3d9f2ba47bbf2f868b5a970d1fe149eba13e2 (patch)
treee99d947080f8e787059d86500f01dd6c1ad616e4 /extern/bullet2/src/BulletCollision/CollisionShapes/btConvexHullShape.cpp
parent221a7878223e983372ba830e4ca1a17067abf2ba (diff)
Update Bullet to version 2.80 (bullet svn revision 2537)
Remove Jamfiles and other unused files that stuck around during previous updates. Add patches for local changes to the patches directory. Update readme.txt, it had outdated infromation.
Diffstat (limited to 'extern/bullet2/src/BulletCollision/CollisionShapes/btConvexHullShape.cpp')
-rw-r--r--extern/bullet2/src/BulletCollision/CollisionShapes/btConvexHullShape.cpp44
1 files changed, 44 insertions, 0 deletions
diff --git a/extern/bullet2/src/BulletCollision/CollisionShapes/btConvexHullShape.cpp b/extern/bullet2/src/BulletCollision/CollisionShapes/btConvexHullShape.cpp
index 69bc67cafab..226245979ab 100644
--- a/extern/bullet2/src/BulletCollision/CollisionShapes/btConvexHullShape.cpp
+++ b/extern/bullet2/src/BulletCollision/CollisionShapes/btConvexHullShape.cpp
@@ -208,4 +208,48 @@ const char* btConvexHullShape::serialize(void* dataBuffer, btSerializer* seriali
return "btConvexHullShapeData";
}
+void btConvexHullShape::project(const btTransform& trans, const btVector3& dir, btScalar& min, btScalar& max) const
+{
+#if 1
+ min = FLT_MAX;
+ max = -FLT_MAX;
+ btVector3 witnesPtMin;
+ btVector3 witnesPtMax;
+
+ int numVerts = m_unscaledPoints.size();
+ for(int i=0;i<numVerts;i++)
+ {
+ btVector3 vtx = m_unscaledPoints[i] * m_localScaling;
+ btVector3 pt = trans * vtx;
+ btScalar dp = pt.dot(dir);
+ if(dp < min)
+ {
+ min = dp;
+ witnesPtMin = pt;
+ }
+ if(dp > max)
+ {
+ max = dp;
+ witnesPtMax=pt;
+ }
+ }
+#else
+ btVector3 localAxis = dir*trans.getBasis();
+ btVector3 vtx1 = trans(localGetSupportingVertex(localAxis));
+ btVector3 vtx2 = trans(localGetSupportingVertex(-localAxis));
+
+ min = vtx1.dot(dir);
+ max = vtx2.dot(dir);
+#endif
+
+ if(min>max)
+ {
+ btScalar tmp = min;
+ min = max;
+ max = tmp;
+ }
+
+
+}
+