diff options
author | Erwin Coumans <blender@erwincoumans.com> | 2009-03-03 06:41:24 +0300 |
---|---|---|
committer | Erwin Coumans <blender@erwincoumans.com> | 2009-03-03 06:41:24 +0300 |
commit | 982a5cc60dd93b21ce110b3fff831d05720047bf (patch) | |
tree | 5d6245b0006f249c48e900b748aedd4484c10da3 /extern/bullet2/src/BulletCollision/CollisionShapes/btConvexHullShape.cpp | |
parent | f8ef887880ac217cc831b2ab9677e1f9e825537b (diff) |
Upgraded to Bullet 2.74. The upgrade introduced a few bugs, which need to be fixed before Blender 2.49.
In particular, the Bullet vehicle seems broken, and some soft-body demos don't work.
No new features or benefits are added yet, but a few improvements are planned before Blender 2.49 release.
Please update the build systems, and add those 3 files:
extern/bullet2/src/BulletCollision/CollisionDispatch/btActivatingCollisionAlgorithm.cpp
extern/bullet2/src/BulletCollision/CollisionDispatch/btGhostObject.cpp
extern/bullet2/src/BulletCollision/CollisionShapes/btConvexPointCloudShape.cpp
I'll watch the Blender mailing list, in case this commit causes some issues.
Diffstat (limited to 'extern/bullet2/src/BulletCollision/CollisionShapes/btConvexHullShape.cpp')
-rw-r--r-- | extern/bullet2/src/BulletCollision/CollisionShapes/btConvexHullShape.cpp | 45 |
1 files changed, 23 insertions, 22 deletions
diff --git a/extern/bullet2/src/BulletCollision/CollisionShapes/btConvexHullShape.cpp b/extern/bullet2/src/BulletCollision/CollisionShapes/btConvexHullShape.cpp index 2596858bc3a..2b067367767 100644 --- a/extern/bullet2/src/BulletCollision/CollisionShapes/btConvexHullShape.cpp +++ b/extern/bullet2/src/BulletCollision/CollisionShapes/btConvexHullShape.cpp @@ -19,16 +19,17 @@ subject to the following restrictions: -btConvexHullShape ::btConvexHullShape (const btScalar* points,int numPoints,int stride) +btConvexHullShape ::btConvexHullShape (const btScalar* points,int numPoints,int stride) : btPolyhedralConvexShape () { - m_points.resize(numPoints); + m_shapeType = CONVEX_HULL_SHAPE_PROXYTYPE; + m_unscaledPoints.resize(numPoints); unsigned char* pointsBaseAddress = (unsigned char*)points; for (int i=0;i<numPoints;i++) { - btPoint3* point = (btPoint3*)(pointsBaseAddress + i*stride); - m_points[i] = point[0]; + btVector3* point = (btVector3*)(pointsBaseAddress + i*stride); + m_unscaledPoints[i] = point[0]; } recalcLocalAabb(); @@ -43,9 +44,9 @@ void btConvexHullShape::setLocalScaling(const btVector3& scaling) recalcLocalAabb(); } -void btConvexHullShape::addPoint(const btPoint3& point) +void btConvexHullShape::addPoint(const btVector3& point) { - m_points.push_back(point); + m_unscaledPoints.push_back(point); recalcLocalAabb(); } @@ -67,9 +68,9 @@ btVector3 btConvexHullShape::localGetSupportingVertexWithoutMargin(const btVecto } - for (int i=0;i<m_points.size();i++) + for (int i=0;i<m_unscaledPoints.size();i++) { - btPoint3 vtx = m_points[i] * m_localScaling; + btVector3 vtx = m_unscaledPoints[i] * m_localScaling; newDot = vec.dot(vtx); if (newDot > maxDot) @@ -91,9 +92,9 @@ void btConvexHullShape::batchedUnitVectorGetSupportingVertexWithoutMargin(const supportVerticesOut[i][3] = btScalar(-1e30); } } - for (int i=0;i<m_points.size();i++) + for (int i=0;i<m_unscaledPoints.size();i++) { - btPoint3 vtx = m_points[i] * m_localScaling; + btVector3 vtx = getScaledPoint(i); for (int j=0;j<numVectors;j++) { @@ -144,26 +145,26 @@ btVector3 btConvexHullShape::localGetSupportingVertex(const btVector3& vec)const //Please note that you can debug-draw btConvexHullShape with the Raytracer Demo int btConvexHullShape::getNumVertices() const { - return m_points.size(); + return m_unscaledPoints.size(); } int btConvexHullShape::getNumEdges() const { - return m_points.size(); + return m_unscaledPoints.size(); } -void btConvexHullShape::getEdge(int i,btPoint3& pa,btPoint3& pb) const +void btConvexHullShape::getEdge(int i,btVector3& pa,btVector3& pb) const { - int index0 = i%m_points.size(); - int index1 = (i+1)%m_points.size(); - pa = m_points[index0]*m_localScaling; - pb = m_points[index1]*m_localScaling; + int index0 = i%m_unscaledPoints.size(); + int index1 = (i+1)%m_unscaledPoints.size(); + pa = getScaledPoint(index0); + pb = getScaledPoint(index1); } -void btConvexHullShape::getVertex(int i,btPoint3& vtx) const +void btConvexHullShape::getVertex(int i,btVector3& vtx) const { - vtx = m_points[i]*m_localScaling; + vtx = getScaledPoint(i); } int btConvexHullShape::getNumPlanes() const @@ -171,16 +172,16 @@ int btConvexHullShape::getNumPlanes() const return 0; } -void btConvexHullShape::getPlane(btVector3& ,btPoint3& ,int ) const +void btConvexHullShape::getPlane(btVector3& ,btVector3& ,int ) const { btAssert(0); } //not yet -bool btConvexHullShape::isInside(const btPoint3& ,btScalar ) const +bool btConvexHullShape::isInside(const btVector3& ,btScalar ) const { - assert(0); + btAssert(0); return false; } |