some more changes related to PS3 SPU optimizations (16-byte alignment, allowing non-virtual access to data)

This commit is contained in:
ejcoumans
2007-05-25 23:27:49 +00:00
parent 8b453dfd9c
commit eca55afe4d
4 changed files with 60 additions and 29 deletions

View File

@@ -24,21 +24,30 @@ subject to the following restrictions:
///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 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 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);
recalcLocalAabb();
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;