← Back to team overview

yade-dev team mailing list archive

[Branch ~yade-pkg/yade/git-trunk] Rev 3955: Make addForceTorqueFromMembers more readable.

 

------------------------------------------------------------
revno: 3955
committer: Anton Gladky <gladky.anton@xxxxxxxxx>
timestamp: Fri 2014-05-16 11:46:02 +0200
message:
  Make addForceTorqueFromMembers more readable.
modified:
  core/Clump.cpp


--
lp:yade
https://code.launchpad.net/~yade-pkg/yade/git-trunk

Your team Yade developers is subscribed to branch lp:yade.
To unsubscribe from this branch go to https://code.launchpad.net/~yade-pkg/yade/git-trunk/+edit-subscription
=== modified file 'core/Clump.cpp'
--- core/Clump.cpp	2014-03-15 15:30:36 +0000
+++ core/Clump.cpp	2014-05-16 09:46:02 +0000
@@ -55,8 +55,12 @@
 
 void Clump::addForceTorqueFromMembers(const State* clumpState, Scene* scene, Vector3r& F, Vector3r& T){
 	FOREACH(const MemberMap::value_type& mm, members){
-		const Body::id_t& memberId=mm.first; const shared_ptr<Body>& member=Body::byId(memberId,scene); assert(member->isClumpMember()); State* memberState=member->state.get();
-		const Vector3r& f=scene->forces.getForce(memberId); const Vector3r& t=scene->forces.getTorque(memberId);
+		const Body::id_t& memberId=mm.first; 
+		const shared_ptr<Body>& member=Body::byId(memberId,scene); 
+		assert(member->isClumpMember()); 
+		State* memberState=member->state.get();
+		const Vector3r& f=scene->forces.getForce(memberId); 
+		const Vector3r& t=scene->forces.getTorque(memberId);
 		F+=f;
 		T+=t+(memberState->pos-clumpState->pos).cross(f);
 	}