[Bf-blender-cvs] [f7263b8] master: Cleanup: Reduce amount of misleading indentation

Sergey Sharybin noreply at git.blender.org
Thu Sep 1 12:14:39 CEST 2016


Commit: f7263b8b1a4e2650c776b148d54986e41879e2e4
Author: Sergey Sharybin
Date:   Thu Sep 1 12:14:16 2016 +0200
Branches: master
https://developer.blender.org/rBf7263b8b1a4e2650c776b148d54986e41879e2e4

Cleanup: Reduce amount of misleading indentation

Was polluting compile output too much.

===================================================================

M	extern/bullet2/src/BulletCollision/CollisionDispatch/btBox2dBox2dCollisionAlgorithm.cpp
M	extern/bullet2/src/BulletCollision/CollisionDispatch/btCompoundCollisionAlgorithm.cpp
M	intern/elbeem/intern/controlparticles.cpp
M	intern/elbeem/intern/isosurface.h
M	intern/itasc/ConstraintSet.cpp
M	intern/itasc/Scene.cpp
M	intern/itasc/WSDLSSolver.cpp

===================================================================

diff --git a/extern/bullet2/src/BulletCollision/CollisionDispatch/btBox2dBox2dCollisionAlgorithm.cpp b/extern/bullet2/src/BulletCollision/CollisionDispatch/btBox2dBox2dCollisionAlgorithm.cpp
index 2c36277..c1da9f3 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 a80c438..589a7f5 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 526fac0..f6329ad 100644
--- a/intern/elbeem/intern/controlparticles.cpp
+++ b/intern/elbeem/intern/controlparticles.cpp
@@ -1316,7 +1316,8 @@ void ControlParticles::finishControl(std::vector<ControlForces> &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 15b9238..30fd9ad 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 e21cd36..0baf580 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)<m_threshold){
+	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)<m_threshold){
 			m_B.row(i).setConstant(0.0);
-        }else
-            m_B.row(i) = m_U.col(i)/m_S(i);
+		} else {
+			m_B.row(i) = m_U.col(i)/m_S(i);
+		}
+	}
 
-    m_Jf_inv.noalias()=m_V*m_B;
+	m_Jf_inv.noalias()=m_V*m_B;
 
-    m_chi.noalias()+=m_Jf_inv*m_tdelta;
-    updateJacobian();
+	m_chi.noalias()+=m_Jf_inv*m_tdelta;
+	updateJacobian();
 	// m_externalPose-m_internalPose in end effector frame
 	// this is just to compare the pose, a different formula would work too
 	return Equal(m_internalPose.Inverse()*m_externalPose,F_identity,m_threshold);
diff --git a/intern/itasc/Scene.cpp b/intern/itasc/Scene.cpp
index 7ed8fc4..5768a99 100644
--- a/intern/itasc/Scene.cpp
+++ b/intern/itasc/Scene.cpp
@@ -146,11 +146,11 @@ bool Scene::addObject(const std::string& name, Object* object, UncontrolledObjec
 
 bool Scene::addConstraintSet(const std::string& name,ConstraintSet* task,const std::string& object1,const std::string& object2, const std::string& ee1, const std::string& ee2)
 {
-    //Check if objects exist:
-    ObjectMap::iterator object1_it = objects.find(object1);
-    ObjectMap::iterator object2_it = objects.find(object2);
-    if(object1_it==objects.end()||object2_it==objects.end())
-        return false;
+	//Check if objects exist:
+	ObjectMap::iterator object1_it = objects.find(object1);
+	ObjectMap::iterator object2_it = objects.find(object2);
+	if(object1_it==objects.end()||object2_it==objects.end())
+		return false;
 	int ee1_index = object1_it->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 6fdd8e6..2514dbb 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<m_nc; i++)
 		m_WyAWq.row(i) = Wy(i)*m_AWq.row(i);
 
@@ -72,11 +72,11 @@ bool WSDLSSolver::solve(const e_matrix& A, const e_vector& Wy, const e_vector& y
 	} else {
 		ret = KDL::svd_eigen_HH(m_WyAWq,m_U,m_S,m_V,m_temp);
 	}
-    if(ret<0)
-        return false;
+	if(ret<0)
+		return false;
 
 	m_Wy_ydot = Wy.array() * ydot.array();
-    m_WqV.noalias() = Wq*m_V;
+	m_WqV.noalias() = Wq*m_V;
 	qdot.setZero();
 	e_scalar maxDeltaS = e_scalar(0.0);
 	e_scalar prevS = e_scalar(0.0);




More information about the Bf-blender-cvs mailing list