Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 21, 2011, 6:58:23 PM (13 years ago)
Author:
rgrieder
Message:

Merged revisions 7978 - 8096 from kicklib to kicklib2.

Location:
code/branches/kicklib2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/kicklib2

  • code/branches/kicklib2/src/external/bullet/BulletCollision/NarrowPhaseCollision/btPersistentManifold.h

    r5781 r8284  
    3131typedef bool (*ContactProcessedCallback)(btManifoldPoint& cp,void* body0,void* body1);
    3232extern ContactDestroyedCallback gContactDestroyedCallback;
    33 
    34 
    35 
     33extern ContactProcessedCallback gContactProcessedCallback;
     34
     35
     36enum btContactManifoldTypes
     37{
     38        BT_PERSISTENT_MANIFOLD_TYPE = 1,
     39        MAX_CONTACT_MANIFOLD_TYPE
     40};
    3641
    3742#define MANIFOLD_CACHE_SIZE 4
     
    4449///the contact point with deepest penetration is always kept, and it tries to maximuze the area covered by the points
    4550///note that some pairs of objects might have more then one contact manifold.
    46 ATTRIBUTE_ALIGNED16( class) btPersistentManifold
     51
     52
     53ATTRIBUTE_ALIGNED128( class) btPersistentManifold : public btTypedObject
     54//ATTRIBUTE_ALIGNED16( class) btPersistentManifold : public btTypedObject
    4755{
    4856
     
    5361        void* m_body0;
    5462        void* m_body1;
     63
    5564        int     m_cachedPoints;
    5665
     
    6877        BT_DECLARE_ALIGNED_ALLOCATOR();
    6978
     79        int     m_companionIdA;
     80        int     m_companionIdB;
     81
    7082        int m_index1a;
    7183
     
    7385
    7486        btPersistentManifold(void* body0,void* body1,int , btScalar contactBreakingThreshold,btScalar contactProcessingThreshold)
    75                 : m_body0(body0),m_body1(body1),m_cachedPoints(0),
     87                : btTypedObject(BT_PERSISTENT_MANIFOLD_TYPE),
     88        m_body0(body0),m_body1(body1),m_cachedPoints(0),
    7689                m_contactBreakingThreshold(contactBreakingThreshold),
    7790                m_contactProcessingThreshold(contactProcessingThreshold)
    7891        {
    79                
    8092        }
    8193
     
    135147                        //get rid of duplicated userPersistentData pointer
    136148                        m_pointCache[lastUsedIndex].m_userPersistentData = 0;
     149                        m_pointCache[lastUsedIndex].mConstraintRow[0].mAccumImpulse = 0.f;
     150                        m_pointCache[lastUsedIndex].mConstraintRow[1].mAccumImpulse = 0.f;
     151                        m_pointCache[lastUsedIndex].mConstraintRow[2].mAccumImpulse = 0.f;
     152
    137153                        m_pointCache[lastUsedIndex].m_appliedImpulse = 0.f;
    138154                        m_pointCache[lastUsedIndex].m_lateralFrictionInitialized = false;
     
    152168#ifdef MAINTAIN_PERSISTENCY
    153169                int     lifeTime = m_pointCache[insertIndex].getLifeTime();
    154                 btScalar        appliedImpulse = m_pointCache[insertIndex].m_appliedImpulse;
    155                 btScalar        appliedLateralImpulse1 = m_pointCache[insertIndex].m_appliedImpulseLateral1;
    156                 btScalar        appliedLateralImpulse2 = m_pointCache[insertIndex].m_appliedImpulseLateral2;
    157                                
     170                btScalar        appliedImpulse = m_pointCache[insertIndex].mConstraintRow[0].mAccumImpulse;
     171                btScalar        appliedLateralImpulse1 = m_pointCache[insertIndex].mConstraintRow[1].mAccumImpulse;
     172                btScalar        appliedLateralImpulse2 = m_pointCache[insertIndex].mConstraintRow[2].mAccumImpulse;
     173//              bool isLateralFrictionInitialized = m_pointCache[insertIndex].m_lateralFrictionInitialized;
     174               
     175               
     176                       
    158177                btAssert(lifeTime>=0);
    159178                void* cache = m_pointCache[insertIndex].m_userPersistentData;
     
    166185                m_pointCache[insertIndex].m_appliedImpulseLateral2 = appliedLateralImpulse2;
    167186               
     187                m_pointCache[insertIndex].mConstraintRow[0].mAccumImpulse =  appliedImpulse;
     188                m_pointCache[insertIndex].mConstraintRow[1].mAccumImpulse = appliedLateralImpulse1;
     189                m_pointCache[insertIndex].mConstraintRow[2].mAccumImpulse = appliedLateralImpulse2;
     190
     191
    168192                m_pointCache[insertIndex].m_lifeTime = lifeTime;
    169193#else
Note: See TracChangeset for help on using the changeset viewer.