Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 31, 2009, 8:05:51 PM (15 years ago)
Author:
rgrieder
Message:

Update from Bullet 2.73 to 2.74.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/bullet/BulletCollision/CollisionDispatch/btCollisionWorld.cpp

    r2662 r2882  
    7070                        getBroadphase()->getOverlappingPairCache()->cleanProxyFromPairs(bp,m_dispatcher1);
    7171                        getBroadphase()->destroyProxy(bp,m_dispatcher1);
     72                        collisionObject->setBroadphaseHandle(0);
    7273                }
    7374        }
     
    119120
    120121
     122void    btCollisionWorld::updateSingleAabb(btCollisionObject* colObj)
     123{
     124        btVector3 minAabb,maxAabb;
     125        colObj->getCollisionShape()->getAabb(colObj->getWorldTransform(), minAabb,maxAabb);
     126        //need to increase the aabb for contact thresholds
     127        btVector3 contactThreshold(gContactBreakingThreshold,gContactBreakingThreshold,gContactBreakingThreshold);
     128        minAabb -= contactThreshold;
     129        maxAabb += contactThreshold;
     130
     131        btBroadphaseInterface* bp = (btBroadphaseInterface*)m_broadphasePairCache;
     132
     133        //moving objects should be moderately sized, probably something wrong if not
     134        if ( colObj->isStaticObject() || ((maxAabb-minAabb).length2() < btScalar(1e12)))
     135        {
     136                bp->setAabb(colObj->getBroadphaseHandle(),minAabb,maxAabb, m_dispatcher1);
     137        } else
     138        {
     139                //something went wrong, investigate
     140                //this assert is unwanted in 3D modelers (danger of loosing work)
     141                colObj->setActivationState(DISABLE_SIMULATION);
     142
     143                static bool reportMe = true;
     144                if (reportMe && m_debugDrawer)
     145                {
     146                        reportMe = false;
     147                        m_debugDrawer->reportErrorWarning("Overflow in AABB, object removed from simulation");
     148                        m_debugDrawer->reportErrorWarning("If you can reproduce this, please email bugs@continuousphysics.com\n");
     149                        m_debugDrawer->reportErrorWarning("Please include above information, your Platform, version of OS.\n");
     150                        m_debugDrawer->reportErrorWarning("Thanks.\n");
     151                }
     152        }
     153}
     154
    121155void    btCollisionWorld::updateAabbs()
    122156{
     
    131165                if (colObj->isActive())
    132166                {
    133                         btVector3 minAabb,maxAabb;
    134                         colObj->getCollisionShape()->getAabb(colObj->getWorldTransform(), minAabb,maxAabb);
    135                         //need to increase the aabb for contact thresholds
    136                         btVector3 contactThreshold(gContactBreakingThreshold,gContactBreakingThreshold,gContactBreakingThreshold);
    137                         minAabb -= contactThreshold;
    138                         maxAabb += contactThreshold;
    139 
    140                         btBroadphaseInterface* bp = (btBroadphaseInterface*)m_broadphasePairCache;
    141 
    142                         //moving objects should be moderately sized, probably something wrong if not
    143                         if ( colObj->isStaticObject() || ((maxAabb-minAabb).length2() < btScalar(1e12)))
    144                         {
    145                                 bp->setAabb(colObj->getBroadphaseHandle(),minAabb,maxAabb, m_dispatcher1);
    146                         } else
    147                         {
    148                                 //something went wrong, investigate
    149                                 //this assert is unwanted in 3D modelers (danger of loosing work)
    150                                 colObj->setActivationState(DISABLE_SIMULATION);
    151 
    152                                 static bool reportMe = true;
    153                                 if (reportMe && m_debugDrawer)
    154                                 {
    155                                         reportMe = false;
    156                                         m_debugDrawer->reportErrorWarning("Overflow in AABB, object removed from simulation");
    157                                         m_debugDrawer->reportErrorWarning("If you can reproduce this, please email bugs@continuousphysics.com\n");
    158                                         m_debugDrawer->reportErrorWarning("Please include above information, your Platform, version of OS.\n");
    159                                         m_debugDrawer->reportErrorWarning("Thanks.\n");
    160                                 }
    161                         }
    162                 }
    163         }
    164 
     167                        updateSingleAabb(colObj);
     168                }
     169        }
    165170}
    166171
     
    294299                                        BridgeTriangleRaycastCallback( const btVector3& from,const btVector3& to,
    295300                                                btCollisionWorld::RayResultCallback* resultCallback, btCollisionObject* collisionObject,btTriangleMeshShape*    triangleMesh):
    296                                                 btTriangleRaycastCallback(from,to),
     301                  //@BP Mod
     302                                                btTriangleRaycastCallback(from,to, resultCallback->m_flags),
    297303                                                        m_resultCallback(resultCallback),
    298304                                                        m_collisionObject(collisionObject),
     
    343349                                        BridgeTriangleRaycastCallback( const btVector3& from,const btVector3& to,
    344350                                                btCollisionWorld::RayResultCallback* resultCallback, btCollisionObject* collisionObject,btConcaveShape* triangleMesh):
    345                                                 btTriangleRaycastCallback(from,to),
     351                  //@BP Mod
     352                  btTriangleRaycastCallback(from,to, resultCallback->m_flags),
    346353                                                        m_resultCallback(resultCallback),
    347354                                                        m_collisionObject(collisionObject),
     
    664671                        //RigidcollisionObject* collisionObject = ctrl->GetRigidcollisionObject();
    665672                        //btVector3 collisionObjectAabbMin,collisionObjectAabbMax;
    666                        
     673#if 0
    667674#ifdef RECALCULATE_AABB
    668675                        btVector3 collisionObjectAabbMin,collisionObjectAabbMax;
     
    672679                        const btVector3& collisionObjectAabbMin = collisionObject->getBroadphaseHandle()->m_aabbMin;
    673680                        const btVector3& collisionObjectAabbMax = collisionObject->getBroadphaseHandle()->m_aabbMax;
     681#endif
    674682#endif
    675683                        //btScalar hitLambda = m_resultCallback.m_closestHitFraction;
Note: See TracChangeset for help on using the changeset viewer.