Commit 95ed7511 authored by amandaghassaei's avatar amandaghassaei

trying to fix rotatios

parent 7662f6db
......@@ -674,13 +674,15 @@ define(['underscore', 'backbone', 'threeModel', 'lattice', 'plist', 'emWire', 'G
//todo this is causing instability
//bending and torsion
//for (var _axis=0;_axis<3;_axis++) {
// if (_axis == neighborAxis){
// rForce[_axis] += 0.000001*torsionK[_axis]*(neighborRotation[_axis]-rotation[_axis]);// + torsionD[_axis]*(neighborAngVelocity[_axis]-angVelocity[_axis]);
// } else {
// rForce[_axis] += 0.000001*bendingK[_axis]*(neighborRotation[_axis]-rotation[_axis]);// + bendingD[_axis]*(neighborAngVelocity[_axis]-angVelocity[_axis]);
// }
//}
//var quaternionDiff = this._multiplyQuaternions(this._invertQuaternion(neighborQuaternion), quaternion);
//var diffEuler = this._eulerFromQuaternion(quaternionDiff);
for (var _axis=0;_axis<3;_axis++) {
if (_axis == neighborAxis){
rForce[_axis] += 0.000001*torsionK[_axis]*(neighborRotation[_axis]-rotation[_axis]);// + torsionD[_axis]*(neighborAngVelocity[_axis]-angVelocity[_axis]);
} else {
rForce[_axis] += 0.000001*bendingK[_axis]*(neighborRotation[_axis]-rotation[_axis]);// + bendingD[_axis]*(neighborAngVelocity[_axis]-angVelocity[_axis]);
}
}
//console.log(rotation);
//console.log(neighborRotation);
//console.log(angVelocity);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment