~ubuntu-branches/ubuntu/maverick/blender/maverick

« back to all changes in this revision

Viewing changes to extern/bullet2/src/BulletCollision/CollisionDispatch/btManifoldResult.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Khashayar Naderehvandi, Khashayar Naderehvandi, Alessio Treglia
  • Date: 2009-01-22 16:53:59 UTC
  • mfrom: (14.1.1 experimental)
  • Revision ID: james.westby@ubuntu.com-20090122165359-v0996tn7fbit64ni
Tags: 2.48a+dfsg-1ubuntu1
[ Khashayar Naderehvandi ]
* Merge from debian experimental (LP: #320045), Ubuntu remaining changes:
  - Add patch correcting header file locations.
  - Add libvorbis-dev and libgsm1-dev to Build-Depends.
  - Use avcodec_decode_audio2() in source/blender/src/hddaudio.c

[ Alessio Treglia ]
* Add missing previous changelog entries.

Show diffs side-by-side

added added

removed removed

Lines of Context:
79
79
        }
80
80
 
81
81
        btManifoldPoint newPt(localA,localB,normalOnBInWorld,depth);
82
 
 
 
82
        newPt.m_positionWorldOnA = pointA;
 
83
        newPt.m_positionWorldOnB = pointInWorld;
 
84
        
83
85
        int insertIndex = m_manifoldPtr->getCacheEntry(newPt);
84
86
 
85
87
        newPt.m_combinedFriction = calculateCombinedFriction(m_body0,m_body1);
86
88
        newPt.m_combinedRestitution = calculateCombinedRestitution(m_body0,m_body1);
87
89
 
 
90
   //BP mod, store contact triangles.
 
91
   newPt.m_partId0 = m_partId0;
 
92
   newPt.m_partId1 = m_partId1;
 
93
   newPt.m_index0  = m_index0;
 
94
   newPt.m_index1  = m_index1;
 
95
        
 
96
        ///todo, check this for any side effects
 
97
        if (insertIndex >= 0)
 
98
        {
 
99
                //const btManifoldPoint& oldPoint = m_manifoldPtr->getContactPoint(insertIndex);
 
100
                m_manifoldPtr->replaceContactPoint(newPt,insertIndex);
 
101
        } else
 
102
        {
 
103
                insertIndex = m_manifoldPtr->addManifoldPoint(newPt);
 
104
        }
 
105
        
88
106
        //User can override friction and/or restitution
89
107
        if (gContactAddedCallback &&
90
108
                //and if either of the two bodies requires custom material
94
112
                //experimental feature info, for per-triangle material etc.
95
113
                btCollisionObject* obj0 = isSwapped? m_body1 : m_body0;
96
114
                btCollisionObject* obj1 = isSwapped? m_body0 : m_body1;
97
 
                (*gContactAddedCallback)(newPt,obj0,m_partId0,m_index0,obj1,m_partId1,m_index1);
 
115
                (*gContactAddedCallback)(m_manifoldPtr->getContactPoint(insertIndex),obj0,m_partId0,m_index0,obj1,m_partId1,m_index1);
98
116
        }
99
117
 
100
 
        if (insertIndex >= 0)
101
 
        {
102
 
                //const btManifoldPoint& oldPoint = m_manifoldPtr->getContactPoint(insertIndex);
103
 
                m_manifoldPtr->replaceContactPoint(newPt,insertIndex);
104
 
        } else
105
 
        {
106
 
                m_manifoldPtr->AddManifoldPoint(newPt);
107
 
        }
108
118
}
109
119