← Back to team overview

yade-dev team mailing list archive

[Branch ~yade-dev/yade/trunk] Rev 2650: 1. Closes #702296, if somebody uses rotationengines, please, update!

 

------------------------------------------------------------
revno: 2650
fixes bug(s): https://launchpad.net/bugs/702296
committer: Anton Gladky <gladky.anton@xxxxxxxxx>
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;
 		}
 	}
 }