~ubuntu-branches/ubuntu/trusty/blender/trusty

« back to all changes in this revision

Viewing changes to extern/bullet2/src/BulletCollision/CollisionShapes/btConvexShape.cpp

  • Committer: Package Import Robot
  • Author(s): Jeremy Bicha
  • Date: 2013-03-06 12:08:47 UTC
  • mfrom: (1.5.1) (14.1.8 experimental)
  • Revision ID: package-import@ubuntu.com-20130306120847-frjfaryb2zrotwcg
Tags: 2.66a-1ubuntu1
* Resynchronize with Debian (LP: #1076930, #1089256, #1052743, #999024,
  #1122888, #1147084)
* debian/control:
  - Lower build-depends on libavcodec-dev since we're not
    doing the libav9 transition in Ubuntu yet

Show diffs side-by-side

added added

removed removed

Lines of Context:
43
43
}
44
44
 
45
45
 
 
46
void btConvexShape::project(const btTransform& trans, const btVector3& dir, btScalar& min, btScalar& max) const
 
47
{
 
48
        btVector3 localAxis = dir*trans.getBasis();
 
49
        btVector3 vtx1 = trans(localGetSupportingVertex(localAxis));
 
50
        btVector3 vtx2 = trans(localGetSupportingVertex(-localAxis));
 
51
 
 
52
        min = vtx1.dot(dir);
 
53
        max = vtx2.dot(dir);
 
54
 
 
55
        if(min>max)
 
56
        {
 
57
                btScalar tmp = min;
 
58
                min = max;
 
59
                max = tmp;
 
60
        }
 
61
}
 
62
 
46
63
 
47
64
static btVector3 convexHullSupport (const btVector3& localDirOrg, const btVector3* points, int numPoints, const btVector3& localScaling)
48
65
{       
227
244
                        pos[capsuleUpAxis] = halfHeight;
228
245
 
229
246
                        //vtx = pos +vec*(radius);
230
 
                        vtx = pos +vec*capsuleShape->getLocalScalingNV()*(radius) - vec * capsuleShape->getMarginNV();
 
247
                        vtx = pos +vec*(radius) - vec * capsuleShape->getMarginNV();
231
248
                        newDot = vec.dot(vtx);
232
249
                        
233
250
 
242
259
                        pos[capsuleUpAxis] = -halfHeight;
243
260
 
244
261
                        //vtx = pos +vec*(radius);
245
 
                        vtx = pos +vec*capsuleShape->getLocalScalingNV()*(radius) - vec * capsuleShape->getMarginNV();
 
262
                        vtx = pos +vec*(radius) - vec * capsuleShape->getMarginNV();
246
263
                        newDot = vec.dot(vtx);
247
264
                        if (newDot > maxDot)
248
265
                        {