------------------------------------------------------------
revno: 2650
fixes bug(s): https://launchpad.net/bugs/702296
committer: Anton Gladky <[email protected]>
branch nick: yade
timestamp: Thu 2011-01-13 14:22:41 +0100
message:
  1. Closes #702296, if somebody uses rotationengines, please, update!
modified:
  pkg/common/KinematicEngines.cpp


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

Your team Yade developers is subscribed to branch lp:yade.
To unsubscribe from this branch go to 
https://code.launchpad.net/~yade-dev/yade/trunk/+edit-subscription
=== modified file 'pkg/common/KinematicEngines.cpp'
--- pkg/common/KinematicEngines.cpp	2010-12-21 20:37:08 +0000
+++ pkg/common/KinematicEngines.cpp	2011-01-13 13:22:41 +0000
@@ -103,7 +103,9 @@
 		b->state->angVel+=rotationAxis*angularVelocity;
 		if(rotateAroundZero){
 			const Vector3r l=b->state->pos-zeroPoint;
-			b->state->vel+=b->state->angVel.cross(l);
+			Quaternionr q(AngleAxisr(angularVelocity*scene->dt,rotationAxis));
+			Vector3r newPos=q*l+zeroPoint;
+			b->state->vel+=Vector3r(newPos-b->state->pos)/scene->dt;
 		}
 	}
 }

_______________________________________________
Mailing list: https://launchpad.net/~yade-dev
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~yade-dev
More help   : https://help.launchpad.net/ListHelp

Reply via email to