From f7263b8b1a4e2650c776b148d54986e41879e2e4 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Thu, 1 Sep 2016 12:14:16 +0200 Subject: Cleanup: Reduce amount of misleading indentation Was polluting compile output too much. --- .../btBox2dBox2dCollisionAlgorithm.cpp | 10 ++++----- .../btCompoundCollisionAlgorithm.cpp | 4 ++-- intern/elbeem/intern/controlparticles.cpp | 3 ++- intern/elbeem/intern/isosurface.h | 6 +++-- intern/itasc/ConstraintSet.cpp | 26 ++++++++++++---------- intern/itasc/Scene.cpp | 20 ++++++++--------- intern/itasc/WSDLSSolver.cpp | 8 +++---- 7 files changed, 41 insertions(+), 36 deletions(-) diff --git a/extern/bullet2/src/BulletCollision/CollisionDispatch/btBox2dBox2dCollisionAlgorithm.cpp b/extern/bullet2/src/BulletCollision/CollisionDispatch/btBox2dBox2dCollisionAlgorithm.cpp index 2c362778210..c1da9f36cfb 100644 --- a/extern/bullet2/src/BulletCollision/CollisionDispatch/btBox2dBox2dCollisionAlgorithm.cpp +++ b/extern/bullet2/src/BulletCollision/CollisionDispatch/btBox2dBox2dCollisionAlgorithm.cpp @@ -151,8 +151,8 @@ static btScalar EdgeSeparation(const btBox2dShape* poly1, const btTransform& xf1 int index = 0; btScalar minDot = BT_LARGE_FLOAT; - if( count2 > 0 ) - index = (int) normal1.minDot( vertices2, count2, minDot); + if( count2 > 0 ) + index = (int) normal1.minDot( vertices2, count2, minDot); btVector3 v1 = b2Mul(xf1, vertices1[edge1]); btVector3 v2 = b2Mul(xf2, vertices2[index]); @@ -174,9 +174,9 @@ static btScalar FindMaxSeparation(int* edgeIndex, // Find edge normal on poly1 that has the largest projection onto d. int edge = 0; - btScalar maxDot; - if( count1 > 0 ) - edge = (int) dLocal1.maxDot( normals1, count1, maxDot); + btScalar maxDot; + if( count1 > 0 ) + edge = (int) dLocal1.maxDot( normals1, count1, maxDot); // Get the separation for the edge normal. btScalar s = EdgeSeparation(poly1, xf1, edge, poly2, xf2); diff --git a/extern/bullet2/src/BulletCollision/CollisionDispatch/btCompoundCollisionAlgorithm.cpp b/extern/bullet2/src/BulletCollision/CollisionDispatch/btCompoundCollisionAlgorithm.cpp index a80c438d12a..589a7f55f2b 100644 --- a/extern/bullet2/src/BulletCollision/CollisionDispatch/btCompoundCollisionAlgorithm.cpp +++ b/extern/bullet2/src/BulletCollision/CollisionDispatch/btCompoundCollisionAlgorithm.cpp @@ -232,8 +232,8 @@ void btCompoundCollisionAlgorithm::processCollision (const btCollisionObjectWrap m_compoundShapeRevision = compoundShape->getUpdateRevision(); } - if (m_childCollisionAlgorithms.size()==0) - return; + if (m_childCollisionAlgorithms.size()==0) + return; const btDbvt* tree = compoundShape->getDynamicAabbTree(); //use a dynamic aabb tree to cull potential child-overlaps diff --git a/intern/elbeem/intern/controlparticles.cpp b/intern/elbeem/intern/controlparticles.cpp index 526fac0cc6b..f6329ad4b67 100644 --- a/intern/elbeem/intern/controlparticles.cpp +++ b/intern/elbeem/intern/controlparticles.cpp @@ -1316,7 +1316,8 @@ void ControlParticles::finishControl(std::vector &forces, LbmFloa if(cvweight>1.) { cvweight = 1.; } // thus cvweight is in the range of 0..influenceVelocity, currently not normalized by numCParts cvweight *= ivel; - if(cvweight<0.) cvweight=0.; if(cvweight>1.) cvweight=1.; + if(cvweight<0.) cvweight=0.; + if(cvweight>1.) cvweight=1.; // LBM, FIXME todo use relaxation factor //pvel = (cvel*0.5 * cvweight) + (pvel * (1.0-cvweight)); forces[i].weightVel = cvweight; diff --git a/intern/elbeem/intern/isosurface.h b/intern/elbeem/intern/isosurface.h index 15b923866d3..30fd9adfee1 100644 --- a/intern/elbeem/intern/isosurface.h +++ b/intern/elbeem/intern/isosurface.h @@ -67,8 +67,10 @@ class IsoSurface : /*! set # of subdivisions, this has to be done before init! */ void setSubdivs(int s) { if(mInitDone) errFatal("IsoSurface::setSubdivs","Changing subdivs after init!", SIMWORLD_INITERROR); - if(s<1) s=1; if(s>10) s=10; - mSubdivs = s; } + if(s<1) s=1; + if(s>10) s=10; + mSubdivs = s; + } int getSubdivs() { return mSubdivs;} /*! set full edge settings, this has to be done before init! */ void setUseFulledgeArrays(bool set) { diff --git a/intern/itasc/ConstraintSet.cpp b/intern/itasc/ConstraintSet.cpp index e21cd36e4c8..0baf580ca68 100644 --- a/intern/itasc/ConstraintSet.cpp +++ b/intern/itasc/ConstraintSet.cpp @@ -145,27 +145,29 @@ bool ConstraintSet::closeLoop(){ //toggle=!toggle; //svd_boost_Macie(Jf,U,S,V,B,temp,1e-3*threshold,toggle); int ret = KDL::svd_eigen_HH(m_Jf,m_U,m_S,m_V,m_temp); - if(ret<0) - return false; + if(ret<0) + return false; // the reference point and frame of the jacobian is the base frame // m_externalPose-m_internalPose is the twist to extend the end effector // to get the required pose => change the reference point to the base frame Twist twist_delta(diff(m_internalPose,m_externalPose)); twist_delta=twist_delta.RefPoint(-m_internalPose.p); - for(unsigned int i=0;i<6;i++) - m_tdelta(i)=twist_delta(i); - //TODO: use damping in constraintset inversion? - for(unsigned int i=0;i<6;i++) - if(m_S(i)second->object->addEndEffector(ee1); int ee2_index = object2_it->second->object->addEndEffector(ee2); if (ee1_index < 0 || ee2_index < 0) @@ -159,11 +159,11 @@ bool Scene::addConstraintSet(const std::string& name,ConstraintSet* task,const s constraints.insert(ConstraintMap::value_type(name,new ConstraintSet_struct( task,object1_it,ee1_index,object2_it,ee2_index, Range(m_ncTotal,task->getNrOfConstraints()),Range(6*m_nsets,6)))); - if(!result.second) - return false; - m_ncTotal+=task->getNrOfConstraints(); - m_nsets+=1; - return true; + if(!result.second) + return false; + m_ncTotal+=task->getNrOfConstraints(); + m_nsets+=1; + return true; } bool Scene::addSolver(Solver* _solver){ diff --git a/intern/itasc/WSDLSSolver.cpp b/intern/itasc/WSDLSSolver.cpp index 6fdd8e6e06c..2514dbb9041 100644 --- a/intern/itasc/WSDLSSolver.cpp +++ b/intern/itasc/WSDLSSolver.cpp @@ -60,7 +60,7 @@ bool WSDLSSolver::solve(const e_matrix& A, const e_vector& Wy, const e_vector& y e_scalar N, M; // Create the Weighted jacobian - m_AWq.noalias() = A*Wq; + m_AWq.noalias() = A*Wq; for (i=0; i