multi-threading improvements: optionally use software caching (IBM/PS3), move some code from cpp to header to inline.

This commit is contained in:
ejcoumans
2007-09-20 22:42:56 +00:00
parent 40ac902c5f
commit 08d036afc7
4 changed files with 120 additions and 38 deletions

View File

@@ -133,12 +133,12 @@ public:
m_collisionShape = collisionShape;
}
const btCollisionShape* getCollisionShape() const
inline const btCollisionShape* getCollisionShape() const
{
return m_collisionShape;
}
btCollisionShape* getCollisionShape()
inline btCollisionShape* getCollisionShape()
{
return m_collisionShape;
}

View File

@@ -834,20 +834,7 @@ void btOptimizedBvh::reportSphereOverlappingNodex(btNodeOverlapCallback* nodeCal
}
void btOptimizedBvh::quantizeWithClamp(unsigned short* out, const btVector3& point) const
{
btAssert(m_useQuantization);
btVector3 clampedPoint(point);
clampedPoint.setMax(m_bvhAabbMin);
clampedPoint.setMin(m_bvhAabbMax);
btVector3 v = (clampedPoint - m_bvhAabbMin) * m_bvhQuantization;
out[0] = (unsigned short)(v.getX()+0.5f);
out[1] = (unsigned short)(v.getY()+0.5f);
out[2] = (unsigned short)(v.getZ()+0.5f);
}
btVector3 btOptimizedBvh::unQuantize(const unsigned short* vecIn) const
{

View File

@@ -307,8 +307,22 @@ public:
void reportAabbOverlappingNodex(btNodeOverlapCallback* nodeCallback,const btVector3& aabbMin,const btVector3& aabbMax) const;
void reportSphereOverlappingNodex(btNodeOverlapCallback* nodeCallback,const btVector3& aabbMin,const btVector3& aabbMax) const;
inline void quantizeWithClamp(unsigned short* out, const btVector3& point) const
{
btAssert(m_useQuantization);
btVector3 clampedPoint(point);
clampedPoint.setMax(m_bvhAabbMin);
clampedPoint.setMin(m_bvhAabbMax);
btVector3 v = (clampedPoint - m_bvhAabbMin) * m_bvhQuantization;
out[0] = (unsigned short)(v.getX()+0.5f);
out[1] = (unsigned short)(v.getY()+0.5f);
out[2] = (unsigned short)(v.getZ()+0.5f);
}
void quantizeWithClamp(unsigned short* out, const btVector3& point) const;
btVector3 unQuantize(const unsigned short* vecIn) const;
@@ -325,12 +339,12 @@ public:
void updateBvhNodes(btStridingMeshInterface* meshInterface,int firstNode,int endNode,int index);
QuantizedNodeArray& getQuantizedNodeArray()
inline QuantizedNodeArray& getQuantizedNodeArray()
{
return m_quantizedContiguousNodes;
}
BvhSubtreeInfoArray& getSubtreeInfoArray()
inline BvhSubtreeInfoArray& getSubtreeInfoArray()
{
return m_SubtreeHeaders;
}