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

« back to all changes in this revision

Viewing changes to extern/bullet2/src/BulletDynamics/ConstraintSolver/btContactConstraint.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:
192
192
                        j1 = -vrel * cpd->m_jacDiagABInvTangent0;
193
193
                        btScalar oldTangentImpulse = cpd->m_accumulatedTangentImpulse0;
194
194
                        cpd->m_accumulatedTangentImpulse0 = oldTangentImpulse + j1;
195
 
                        GEN_set_min(cpd->m_accumulatedTangentImpulse0, limit);
196
 
                        GEN_set_max(cpd->m_accumulatedTangentImpulse0, -limit);
 
195
                        btSetMin(cpd->m_accumulatedTangentImpulse0, limit);
 
196
                        btSetMax(cpd->m_accumulatedTangentImpulse0, -limit);
197
197
                        j1 = cpd->m_accumulatedTangentImpulse0 - oldTangentImpulse;
198
198
 
199
199
                }
206
206
                        j2 = -vrel * cpd->m_jacDiagABInvTangent1;
207
207
                        btScalar oldTangentImpulse = cpd->m_accumulatedTangentImpulse1;
208
208
                        cpd->m_accumulatedTangentImpulse1 = oldTangentImpulse + j2;
209
 
                        GEN_set_min(cpd->m_accumulatedTangentImpulse1, limit);
210
 
                        GEN_set_max(cpd->m_accumulatedTangentImpulse1, -limit);
 
209
                        btSetMin(cpd->m_accumulatedTangentImpulse1, limit);
 
210
                        btSetMax(cpd->m_accumulatedTangentImpulse1, -limit);
211
211
                        j2 = cpd->m_accumulatedTangentImpulse1 - oldTangentImpulse;
212
212
                }
213
213
 
237
237
        btRigidBody& body1,
238
238
        btRigidBody& body2,
239
239
        btManifoldPoint& contactPoint,
 
240
        const btContactSolverInfo& solverInfo);
 
241
 
 
242
btScalar resolveSingleFrictionOriginal(
 
243
        btRigidBody& body1,
 
244
        btRigidBody& body2,
 
245
        btManifoldPoint& contactPoint,
240
246
        const btContactSolverInfo& solverInfo)
241
247
{
242
248
 
270
276
                        // calculate j that moves us to zero relative velocity
271
277
                        btScalar j = -vrel * cpd->m_jacDiagABInvTangent0;
272
278
                        btScalar total = cpd->m_accumulatedTangentImpulse0 + j;
273
 
                        GEN_set_min(total, limit);
274
 
                        GEN_set_max(total, -limit);
 
279
                        btSetMin(total, limit);
 
280
                        btSetMax(total, -limit);
275
281
                        j = total - cpd->m_accumulatedTangentImpulse0;
276
282
                        cpd->m_accumulatedTangentImpulse0 = total;
277
283
                        body1.applyImpulse(j * cpd->m_frictionWorldTangential0, rel_pos1);
290
296
                        // calculate j that moves us to zero relative velocity
291
297
                        btScalar j = -vrel * cpd->m_jacDiagABInvTangent1;
292
298
                        btScalar total = cpd->m_accumulatedTangentImpulse1 + j;
293
 
                        GEN_set_min(total, limit);
294
 
                        GEN_set_max(total, -limit);
 
299
                        btSetMin(total, limit);
 
300
                        btSetMax(total, -limit);
295
301
                        j = total - cpd->m_accumulatedTangentImpulse1;
296
302
                        cpd->m_accumulatedTangentImpulse1 = total;
297
303
                        body1.applyImpulse(j * cpd->m_frictionWorldTangential1, rel_pos1);
388
394
                                (body1.getInvMass() + body2.getInvMass() + lat_vel.dot(temp1.cross(rel_pos1) + temp2.cross(rel_pos2)));
389
395
                        btScalar normal_impulse = cpd->m_appliedImpulse * combinedFriction;
390
396
 
391
 
                        GEN_set_min(friction_impulse, normal_impulse);
392
 
                        GEN_set_max(friction_impulse, -normal_impulse);
 
397
                        btSetMin(friction_impulse, normal_impulse);
 
398
                        btSetMax(friction_impulse, -normal_impulse);
393
399
                        body1.applyImpulse(lat_vel * -friction_impulse, rel_pos1);
394
400
                        body2.applyImpulse(lat_vel * friction_impulse, rel_pos2);
395
401
                }
404
410
        btRigidBody& body1,
405
411
        btRigidBody& body2,
406
412
        btManifoldPoint& contactPoint,
 
413
        const btContactSolverInfo& solverInfo);
 
414
 
 
415
btScalar resolveSingleFrictionEmpty(
 
416
        btRigidBody& body1,
 
417
        btRigidBody& body2,
 
418
        btManifoldPoint& contactPoint,
407
419
        const btContactSolverInfo& solverInfo)
408
420
{
409
421
        (void)contactPoint;