diff options
author | Erwin Coumans <blender@erwincoumans.com> | 2007-06-23 09:28:07 +0400 |
---|---|---|
committer | Erwin Coumans <blender@erwincoumans.com> | 2007-06-23 09:28:07 +0400 |
commit | ca26aeb7b23e37e65f49d907ea53fcaeee77ad4e (patch) | |
tree | b6530195a8ef5d874b9fc2bbb9574f1484781be5 /extern/bullet2/src/BulletCollision/CollisionShapes/btConvexHullShape.h | |
parent | 14ad8c9941ac1e6f5252a843c6ad17653cbbd689 (diff) |
upgrade to latest Bullet 2.53. cross the fingers it doesn't break one of the exotic or less exotic platforms
Diffstat (limited to 'extern/bullet2/src/BulletCollision/CollisionShapes/btConvexHullShape.h')
-rw-r--r-- | extern/bullet2/src/BulletCollision/CollisionShapes/btConvexHullShape.h | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/extern/bullet2/src/BulletCollision/CollisionShapes/btConvexHullShape.h b/extern/bullet2/src/BulletCollision/CollisionShapes/btConvexHullShape.h index beea0e63201..3fd5e382525 100644 --- a/extern/bullet2/src/BulletCollision/CollisionShapes/btConvexHullShape.h +++ b/extern/bullet2/src/BulletCollision/CollisionShapes/btConvexHullShape.h @@ -17,29 +17,37 @@ subject to the following restrictions: #define CONVEX_HULL_SHAPE_H #include "btPolyhedralConvexShape.h" -#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h" // for the types - - -#include "LinearMath/btAlignedObjectArray.h" +#include "../BroadphaseCollision/btBroadphaseProxy.h" // for the types +#include "../../LinearMath/btAlignedObjectArray.h" ///ConvexHullShape implements an implicit (getSupportingVertex) Convex Hull of a Point Cloud (vertices) ///No connectivity is needed. localGetSupportingVertex iterates linearly though all vertices. ///on modern hardware, due to cache coherency this isn't that bad. Complex algorithms tend to trash the cash. ///(memory is much slower then the cpu) -class btConvexHullShape : public btPolyhedralConvexShape +ATTRIBUTE_ALIGNED16(class) btConvexHullShape : public btPolyhedralConvexShape { btAlignedObjectArray<btPoint3> m_points; public: - ///this constructor optionally takes in a pointer to points. Each point is assumed to be 3 consecutive float (x,y,z), the striding defines the number of bytes between each point, in memory. + + + ///this constructor optionally takes in a pointer to points. Each point is assumed to be 3 consecutive btScalar (x,y,z), the striding defines the number of bytes between each point, in memory. ///It is easier to not pass any points in the constructor, and just add one point at a time, using addPoint. ///btConvexHullShape make an internal copy of the points. - btConvexHullShape(const float* points=0,int numPoints=0, int stride=sizeof(btPoint3)); + btConvexHullShape(const btScalar* points=0,int numPoints=0, int stride=sizeof(btPoint3)); + + void addPoint(const btPoint3& point); - void addPoint(const btPoint3& point) + btPoint3* getPoints() { - m_points.push_back(point); + return &m_points[0]; } + + int getNumPoints() + { + return m_points.size(); + } + virtual btVector3 localGetSupportingVertex(const btVector3& vec)const; virtual btVector3 localGetSupportingVertexWithoutMargin(const btVector3& vec)const; virtual void batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const; |