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.

Location:
code/trunk/src/bullet/BulletCollision/NarrowPhaseCollision
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/bullet/BulletCollision/NarrowPhaseCollision/btContinuousConvexCollision.cpp

    r2662 r2882  
    136136                        //btScalar clippedDist  = dist;
    137137                       
     138                        //don't report time of impact for motion away from the contact normal (or causes minor penetration)
     139                        if ((projectedLinearVelocity+ maxAngularProjectedVelocity)<=SIMD_EPSILON)
     140                                return false;
    138141                       
    139142                        dLambda = dist / (projectedLinearVelocity+ maxAngularProjectedVelocity);
     
    197200
    198201                }
    199 
    200                 //don't report time of impact for motion away from the contact normal (or causes minor penetration)
     202       
    201203                if ((projectedLinearVelocity+ maxAngularProjectedVelocity)<=result.m_allowedPenetration)//SIMD_EPSILON)
    202204                        return false;
    203 
     205                       
    204206                result.m_fraction = lambda;
    205207                result.m_normal = n;
  • code/trunk/src/bullet/BulletCollision/NarrowPhaseCollision/btGjkPairDetector.cpp

    r2662 r2882  
    151151                        if ((delta > btScalar(0.0)) && (delta * delta > squaredDistance * input.m_maximumDistanceSquared))
    152152                        {
    153                                 checkPenetration = false;
     153                                checkSimplex=true;
     154                                //checkPenetration = false;
    154155                                break;
    155156                        }
  • code/trunk/src/bullet/BulletCollision/NarrowPhaseCollision/btManifoldPoint.h

    r2662 r2882  
    113113                        }
    114114                       
     115                        ///this returns the most recent applied impulse, to satisfy contact constraints by the constraint solver
     116                        btScalar        getAppliedImpulse() const
     117                        {
     118                                return m_appliedImpulse;
     119                        }
     120
    115121                       
    116122
  • code/trunk/src/bullet/BulletCollision/NarrowPhaseCollision/btPersistentManifold.cpp

    r2662 r2882  
    184184               
    185185        }
     186        if (insertIndex<0)
     187                insertIndex=0;
     188
    186189        btAssert(m_pointCache[insertIndex].m_userPersistentData==0);
    187190        m_pointCache[insertIndex] = newPoint;
  • code/trunk/src/bullet/BulletCollision/NarrowPhaseCollision/btPersistentManifold.h

    r2662 r2882  
    5656
    5757        btScalar        m_contactBreakingThreshold;
     58        btScalar        m_contactProcessingThreshold;
    5859
    5960       
     
    7172        btPersistentManifold();
    7273
    73         btPersistentManifold(void* body0,void* body1,int , btScalar contactBreakingThreshold)
     74        btPersistentManifold(void* body0,void* body1,int , btScalar contactBreakingThreshold,btScalar contactProcessingThreshold)
    7475                : m_body0(body0),m_body1(body1),m_cachedPoints(0),
    75                 m_contactBreakingThreshold(contactBreakingThreshold)
     76                m_contactBreakingThreshold(contactBreakingThreshold),
     77                m_contactProcessingThreshold(contactProcessingThreshold)
    7678        {
    7779               
     
    112114        ///@todo: get this margin from the current physics / collision environment
    113115        btScalar        getContactBreakingThreshold() const;
     116
     117        btScalar        getContactProcessingThreshold() const
     118        {
     119                return m_contactProcessingThreshold;
     120        }
    114121       
    115122        int getCacheEntry(const btManifoldPoint& newPoint) const;
  • code/trunk/src/bullet/BulletCollision/NarrowPhaseCollision/btRaycastCallback.cpp

    r2662 r2882  
    2424#include "btRaycastCallback.h"
    2525
    26 btTriangleRaycastCallback::btTriangleRaycastCallback(const btVector3& from,const btVector3& to)
     26btTriangleRaycastCallback::btTriangleRaycastCallback(const btVector3& from,const btVector3& to, unsigned int flags)
    2727        :
    2828        m_from(from),
    2929        m_to(to),
     30   //@BP Mod
     31   m_flags(flags),
    3032        m_hitFraction(btScalar(1.))
    3133{
     
    5658                return ; // same sign
    5759        }
     60   //@BP Mod - Backface filtering
     61   if (((m_flags & kF_FilterBackfaces) != 0) && (dist_a > btScalar(0.0)))
     62   {
     63      // Backface, skip check
     64      return;
     65   }
    5866       
    5967        const btScalar proj_length=dist_a-dist_b;
     
    9098                                        if ( (btScalar)(cp2.dot(triangleNormal)) >=edge_tolerance)
    9199                                        {
     100                  //@BP Mod
     101                  // Triangle normal isn't normalized
     102                                      triangleNormal.normalize();
    92103
    93                                                 if ( dist_a > 0 )
     104                  //@BP Mod - Allow for unflipped normal when raycasting against backfaces
     105                  if (((m_flags & kF_KeepUnflippedNormal) != 0) || (dist_a <= btScalar(0.0)))
    94106                                                {
    95                                                         m_hitFraction = reportHit(triangleNormal,distance,partId,triangleIndex);
     107                                                        m_hitFraction = reportHit(-triangleNormal,distance,partId,triangleIndex);
    96108                                                }
    97109                                                else
    98110                                                {
    99                                                         m_hitFraction = reportHit(-triangleNormal,distance,partId,triangleIndex);
     111                     m_hitFraction = reportHit(triangleNormal,distance,partId,triangleIndex);
    100112                                                }
    101113                                        }
  • code/trunk/src/bullet/BulletCollision/NarrowPhaseCollision/btRaycastCallback.h

    r2662 r2882  
    3030        btVector3 m_to;
    3131
     32   //@BP Mod - allow backface filtering and unflipped normals
     33   enum EFlags
     34   {
     35      kF_None                 = 0,
     36      kF_FilterBackfaces      = 1 << 0,
     37      kF_KeepUnflippedNormal  = 1 << 1,   // Prevents returned face normal getting flipped when a ray hits a back-facing triangle
     38
     39      kF_Terminator        = 0xFFFFFFFF
     40   };
     41   unsigned int m_flags;
     42
    3243        btScalar        m_hitFraction;
    3344
    34         btTriangleRaycastCallback(const btVector3& from,const btVector3& to);
     45        btTriangleRaycastCallback(const btVector3& from,const btVector3& to, unsigned int flags=0);
    3546       
    3647        virtual void processTriangle(btVector3* triangle, int partId, int triangleIndex);
  • code/trunk/src/bullet/BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.cpp

    r2662 r2882  
    2626
    2727#include "btVoronoiSimplexSolver.h"
    28 #include <assert.h>
    29 //#include <stdio.h>
    3028
    3129#define VERTA  0
     
    3836{
    3937       
    40         assert(m_numVertices>0);
     38        btAssert(m_numVertices>0);
    4139        m_numVertices--;
    4240        m_simplexVectorW[index] = m_simplexVectorW[m_numVertices];
Note: See TracChangeset for help on using the changeset viewer.