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

« back to all changes in this revision

Viewing changes to extern/bullet2/src/BulletCollision/CollisionDispatch/btSphereBoxCollisionAlgorithm.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:
68
68
        
69
69
        btScalar dist = getSphereDistance(boxObj,pOnBox,pOnSphere,sphereCenter,radius);
70
70
 
 
71
        resultOut->setPersistentManifold(m_manifoldPtr);
 
72
 
71
73
        if (dist < SIMD_EPSILON)
72
74
        {
73
75
                btVector3 normalOnSurfaceB = (pOnBox- pOnSphere).normalize();
74
76
 
75
77
                /// report a contact. internally this will be kept persistent, and contact reduction is done
76
78
 
77
 
                resultOut->setPersistentManifold(m_manifoldPtr);
78
79
                resultOut->addContactPoint(normalOnSurfaceB,pOnBox,dist);
79
80
                
80
81
        }
81
82
 
82
 
        
 
83
        if (m_ownManifold)
 
84
        {
 
85
                if (m_manifoldPtr->getNumContacts())
 
86
                {
 
87
                        resultOut->refreshContactPoints();
 
88
                }
 
89
        }
83
90
 
84
91
}
85
92
 
102
109
        btVector3 bounds[2];
103
110
        btBoxShape* boxShape= (btBoxShape*)boxObj->getCollisionShape();
104
111
        
105
 
        bounds[0] = -boxShape->getHalfExtents();
106
 
        bounds[1] = boxShape->getHalfExtents();
 
112
        bounds[0] = -boxShape->getHalfExtentsWithoutMargin();
 
113
        bounds[1] = boxShape->getHalfExtentsWithoutMargin();
107
114
 
108
115
        margins = boxShape->getMargin();//also add sphereShape margin?
109
116
 
209
216
        btVector3       p0, tmp, prel, n[6], normal;
210
217
        btScalar   fSep = btScalar(-10000000.0), fSepThis;
211
218
 
 
219
        // set p0 and normal to a default value to shup up GCC
 
220
        p0.setValue(btScalar(0.), btScalar(0.), btScalar(0.));
 
221
        normal.setValue(btScalar(0.), btScalar(0.), btScalar(0.));
 
222
 
212
223
        n[0].setValue( btScalar(-1.0),  btScalar(0.0),  btScalar(0.0) );
213
224
        n[1].setValue(  btScalar(0.0), btScalar(-1.0),  btScalar(0.0) );
214
225
        n[2].setValue(  btScalar(0.0),  btScalar(0.0), btScalar(-1.0) );