DbvtBroadphase, fixed slow initialization issue.

This commit is contained in:
id0x1234
2008-09-11 11:41:10 +00:00
parent 147b6c8975
commit afcfcb0a5d
2 changed files with 9 additions and 2 deletions

View File

@@ -114,7 +114,8 @@ void Process(const btDbvtNode* na,const btDbvtNode* nb)
//
btDbvtBroadphase::btDbvtBroadphase(btOverlappingPairCache* paircache)
{
m_deferedcollide = false;
m_initialize = true;
m_deferedcollide = true;
m_releasepaircache = (paircache!=0)?false:true;
m_predictedframes = 15;
m_stageCurrent = 0;
@@ -317,7 +318,7 @@ if(current)
btBroadphasePair& p=pairs[(m_cid+i)%ci];
btDbvtProxy* pa=(btDbvtProxy*)p.m_pProxy0;
btDbvtProxy* pb=(btDbvtProxy*)p.m_pProxy1;
if((pa->stage==0)||(pb->stage==0))
//if((pa->stage==0)||(pb->stage==0))
{
if(!Intersect(pa->leaf->volume,pb->leaf->volume))
{
@@ -340,6 +341,11 @@ if(m_updates_call>0)
{ m_updates_ratio=0; }
m_updates_done/=2;
m_updates_call/=2;
if(m_initialize)
{
m_initialize=false;
m_deferedcollide=false;
}
}
//