forked from bartvdbraak/blender
Cleanup: Reduce amount of misleading indentation
Was polluting compile output too much.
This commit is contained in:
parent
475b43ad4a
commit
f7263b8b1a
@ -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);
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
@ -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) {
|
||||
|
@ -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);
|
||||
|
@ -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){
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user