Changeset 2907 for code/branches/questsystem5/src/bullet/BulletCollision/CollisionDispatch/btCollisionWorld.cpp
- Timestamp:
- Apr 8, 2009, 12:36:08 AM (16 years ago)
- Location:
- code/branches/questsystem5
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/questsystem5
- Property svn:mergeinfo changed
-
code/branches/questsystem5/src/bullet/BulletCollision/CollisionDispatch/btCollisionWorld.cpp
r2662 r2907 70 70 getBroadphase()->getOverlappingPairCache()->cleanProxyFromPairs(bp,m_dispatcher1); 71 71 getBroadphase()->destroyProxy(bp,m_dispatcher1); 72 collisionObject->setBroadphaseHandle(0); 72 73 } 73 74 } … … 119 120 120 121 122 void 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 121 155 void btCollisionWorld::updateAabbs() 122 156 { … … 131 165 if (colObj->isActive()) 132 166 { 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 } 165 170 } 166 171 … … 294 299 BridgeTriangleRaycastCallback( const btVector3& from,const btVector3& to, 295 300 btCollisionWorld::RayResultCallback* resultCallback, btCollisionObject* collisionObject,btTriangleMeshShape* triangleMesh): 296 btTriangleRaycastCallback(from,to), 301 //@BP Mod 302 btTriangleRaycastCallback(from,to, resultCallback->m_flags), 297 303 m_resultCallback(resultCallback), 298 304 m_collisionObject(collisionObject), … … 343 349 BridgeTriangleRaycastCallback( const btVector3& from,const btVector3& to, 344 350 btCollisionWorld::RayResultCallback* resultCallback, btCollisionObject* collisionObject,btConcaveShape* triangleMesh): 345 btTriangleRaycastCallback(from,to), 351 //@BP Mod 352 btTriangleRaycastCallback(from,to, resultCallback->m_flags), 346 353 m_resultCallback(resultCallback), 347 354 m_collisionObject(collisionObject), … … 664 671 //RigidcollisionObject* collisionObject = ctrl->GetRigidcollisionObject(); 665 672 //btVector3 collisionObjectAabbMin,collisionObjectAabbMax; 666 673 #if 0 667 674 #ifdef RECALCULATE_AABB 668 675 btVector3 collisionObjectAabbMin,collisionObjectAabbMax; … … 672 679 const btVector3& collisionObjectAabbMin = collisionObject->getBroadphaseHandle()->m_aabbMin; 673 680 const btVector3& collisionObjectAabbMax = collisionObject->getBroadphaseHandle()->m_aabbMax; 681 #endif 674 682 #endif 675 683 //btScalar hitLambda = m_resultCallback.m_closestHitFraction;
Note: See TracChangeset
for help on using the changeset viewer.