diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-10-15 06:15:07 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-10-15 06:15:07 +0400 |
commit | 4d4664d98f49cfb171a43bd6ae6bb002b5f3c34b (patch) | |
tree | e458f200b0061c4adec3a0d5b8f7f523b647c036 /source/gameengine/Physics | |
parent | 977aaeb95c2946f2c8d83dd6a15979424a869eda (diff) |
code cleanup: check for msvc directly when using warning pragma's.
Diffstat (limited to 'source/gameengine/Physics')
-rw-r--r-- | source/gameengine/Physics/Bullet/CcdPhysicsController.cpp | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp index 240bda811f0..29a9b6481e9 100644 --- a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp +++ b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp @@ -215,8 +215,7 @@ bool CcdPhysicsController::CreateSoftbody() btSoftBody* psb = 0; btSoftBodyWorldInfo& worldInfo = m_cci.m_physicsEnv->getDynamicsWorld()->getWorldInfo(); - if (m_cci.m_collisionShape->getShapeType() == CONVEX_HULL_SHAPE_PROXYTYPE) - { + if (m_cci.m_collisionShape->getShapeType() == CONVEX_HULL_SHAPE_PROXYTYPE) { btConvexHullShape* convexHull = (btConvexHullShape* )m_cci.m_collisionShape; { int nvertices = convexHull->getNumPoints(); @@ -224,26 +223,25 @@ bool CcdPhysicsController::CreateSoftbody() HullDesc hdsc(QF_TRIANGLES,nvertices,vertices); HullResult hres; - HullLibrary hlib;/*??*/ + HullLibrary hlib; /*??*/ hdsc.mMaxVertices=nvertices; hlib.CreateConvexHull(hdsc,hres); - psb=new btSoftBody(&worldInfo,(int)hres.mNumOutputVertices, - &hres.m_OutputVertices[0],0); - for (int i=0;i<(int)hres.mNumFaces;++i) - { - const int idx[]={ hres.m_Indices[i*3+0], - hres.m_Indices[i*3+1], - hres.m_Indices[i*3+2]}; - if (idx[0]<idx[1]) psb->appendLink( idx[0],idx[1]); - if (idx[1]<idx[2]) psb->appendLink( idx[1],idx[2]); - if (idx[2]<idx[0]) psb->appendLink( idx[2],idx[0]); - psb->appendFace(idx[0],idx[1],idx[2]); + psb = new btSoftBody(&worldInfo, (int)hres.mNumOutputVertices, + &hres.m_OutputVertices[0], 0); + for (int i = 0; i < (int)hres.mNumFaces; ++i) { + const int idx[3] = {hres.m_Indices[i * 3 + 0], + hres.m_Indices[i * 3 + 1], + hres.m_Indices[i * 3 + 2]}; + if (idx[0] < idx[1]) psb->appendLink(idx[0], idx[1]); + if (idx[1] < idx[2]) psb->appendLink(idx[1], idx[2]); + if (idx[2] < idx[0]) psb->appendLink(idx[2], idx[0]); + psb->appendFace(idx[0], idx[1], idx[2]); } hlib.ReleaseResult(hres); } - } else - { + } + else { int numtris = 0; if (m_cci.m_collisionShape->getShapeType() ==SCALED_TRIANGLE_MESH_SHAPE_PROXYTYPE) { |