Changed BulletMultiThreaded Thread Support to be passed in, rather then global 'Win32ThreadSupport'/'Libspe2ThreadSupport' etc.

This allows developer to hookup Bullet to a custom task scheduler, by deriving from btThreadSupportInterface.
This commit is contained in:
ejcoumans
2007-07-09 03:21:33 +00:00
parent 2508cef2cf
commit 121fd7808e
12 changed files with 201 additions and 66 deletions

View File

@@ -26,8 +26,10 @@ subject to the following restrictions:
SpuGatheringCollisionDispatcher::SpuGatheringCollisionDispatcher()
:m_spuCollisionTaskProcess(0)
SpuGatheringCollisionDispatcher::SpuGatheringCollisionDispatcher(class btThreadSupportInterface* threadInterface, unsigned int maxNumOutstandingTasks)
:m_spuCollisionTaskProcess(0),
m_threadInterface(threadInterface),
m_maxNumOutstandingTasks(maxNumOutstandingTasks)
{
}
@@ -144,7 +146,7 @@ void SpuGatheringCollisionDispatcher::dispatchAllCollisionPairs(btOverlappingPai
if (dispatchInfo.m_enableSPU)
{
if (!m_spuCollisionTaskProcess)
m_spuCollisionTaskProcess = new SpuCollisionTaskProcess();
m_spuCollisionTaskProcess = new SpuCollisionTaskProcess(m_threadInterface,m_maxNumOutstandingTasks);
m_spuCollisionTaskProcess->initialize2();