Commit ac2e1171 authored by amandaghassaei's avatar amandaghassaei
Browse files

getting closer to bending/torsion

parent 95ed7511
...@@ -674,15 +674,15 @@ define(['underscore', 'backbone', 'threeModel', 'lattice', 'plist', 'emWire', 'G ...@@ -674,15 +674,15 @@ define(['underscore', 'backbone', 'threeModel', 'lattice', 'plist', 'emWire', 'G
//todo this is causing instability //todo this is causing instability
//bending and torsion //bending and torsion
//var quaternionDiff = this._multiplyQuaternions(this._invertQuaternion(neighborQuaternion), quaternion); //var quaternionDiff = this._multiplyQuaternions(this._invertQuaternion(quaternion), neighborQuaternion);
//var diffEuler = this._eulerFromQuaternion(quaternionDiff); //var diffEuler = this._eulerFromQuaternion(quaternionDiff);
for (var _axis=0;_axis<3;_axis++) { //for (var _axis=0;_axis<3;_axis++) {
if (_axis == neighborAxis){ // if (_axis == neighborAxis){
rForce[_axis] += 0.000001*torsionK[_axis]*(neighborRotation[_axis]-rotation[_axis]);// + torsionD[_axis]*(neighborAngVelocity[_axis]-angVelocity[_axis]); // rForce[_axis] += 0.00001*torsionK[_axis]*(diffEuler[_axis]);// + torsionD[_axis]*(neighborAngVelocity[_axis]-angVelocity[_axis]);
} else { // } else {
rForce[_axis] += 0.000001*bendingK[_axis]*(neighborRotation[_axis]-rotation[_axis]);// + bendingD[_axis]*(neighborAngVelocity[_axis]-angVelocity[_axis]); // rForce[_axis] += 0.00001*bendingK[_axis]*(diffEuler[_axis]);// + bendingD[_axis]*(neighborAngVelocity[_axis]-angVelocity[_axis]);
} // }
} //}
//console.log(rotation); //console.log(rotation);
//console.log(neighborRotation); //console.log(neighborRotation);
//console.log(angVelocity); //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