Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 3, 2011, 5:07:42 AM (14 years ago)
Author:
rgrieder
Message:

Updated Bullet from v2.77 to v2.78.
(I'm not going to make a branch for that since the update from 2.74 to 2.77 hasn't been tested that much either).

You will HAVE to do a complete RECOMPILE! I tested with MSVC and MinGW and they both threw linker errors at me.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/external/bullet/BulletCollision/CollisionShapes/btUniformScalingShape.cpp

    r8351 r8393  
    6565
    6666        ///getAabb's default implementation is brute force, expected derived classes to implement a fast dedicated version
    67 void btUniformScalingShape::getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const
     67void btUniformScalingShape::getAabb(const btTransform& trans,btVector3& aabbMin,btVector3& aabbMax) const
    6868{
    69         m_childConvexShape->getAabb(t,aabbMin,aabbMax);
    70         btVector3 aabbCenter = (aabbMax+aabbMin)*btScalar(0.5);
    71         btVector3 scaledAabbHalfExtends = (aabbMax-aabbMin)*btScalar(0.5)*m_uniformScalingFactor;
    72 
    73         aabbMin = aabbCenter - scaledAabbHalfExtends;
    74         aabbMax = aabbCenter + scaledAabbHalfExtends;
     69        getAabbSlow(trans,aabbMin,aabbMax);
    7570
    7671}
     
    7873void btUniformScalingShape::getAabbSlow(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const
    7974{
    80         m_childConvexShape->getAabbSlow(t,aabbMin,aabbMax);
    81         btVector3 aabbCenter = (aabbMax+aabbMin)*btScalar(0.5);
    82         btVector3 scaledAabbHalfExtends = (aabbMax-aabbMin)*btScalar(0.5)*m_uniformScalingFactor;
     75#if 1
     76        btVector3 _directions[] =
     77        {
     78                btVector3( 1.,  0.,  0.),
     79                btVector3( 0.,  1.,  0.),
     80                btVector3( 0.,  0.,  1.),
     81                btVector3( -1., 0.,  0.),
     82                btVector3( 0., -1.,  0.),
     83                btVector3( 0.,  0., -1.)
     84        };
     85       
     86        btVector3 _supporting[] =
     87        {
     88                btVector3( 0., 0., 0.),
     89                btVector3( 0., 0., 0.),
     90                btVector3( 0., 0., 0.),
     91                btVector3( 0., 0., 0.),
     92                btVector3( 0., 0., 0.),
     93                btVector3( 0., 0., 0.)
     94        };
    8395
    84         aabbMin = aabbCenter - scaledAabbHalfExtends;
    85         aabbMax = aabbCenter + scaledAabbHalfExtends;
     96        for (int i=0;i<6;i++)
     97        {
     98                _directions[i] = _directions[i]*t.getBasis();
     99        }
     100       
     101        batchedUnitVectorGetSupportingVertexWithoutMargin(_directions, _supporting, 6);
     102       
     103        btVector3 aabbMin1(0,0,0),aabbMax1(0,0,0);
     104
     105        for ( int i = 0; i < 3; ++i )
     106        {
     107                aabbMax1[i] = t(_supporting[i])[i];
     108                aabbMin1[i] = t(_supporting[i + 3])[i];
     109        }
     110        btVector3 marginVec(getMargin(),getMargin(),getMargin());
     111        aabbMin = aabbMin1-marginVec;
     112        aabbMax = aabbMax1+marginVec;
     113       
     114#else
     115
     116        btScalar margin = getMargin();
     117        for (int i=0;i<3;i++)
     118        {
     119                btVector3 vec(btScalar(0.),btScalar(0.),btScalar(0.));
     120                vec[i] = btScalar(1.);
     121                btVector3 sv = localGetSupportingVertex(vec*t.getBasis());
     122                btVector3 tmp = t(sv);
     123                aabbMax[i] = tmp[i]+margin;
     124                vec[i] = btScalar(-1.);
     125                sv = localGetSupportingVertex(vec*t.getBasis());
     126                tmp = t(sv);
     127                aabbMin[i] = tmp[i]-margin;
     128        }
     129
     130#endif
    86131}
    87132
Note: See TracChangeset for help on using the changeset viewer.