Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Amanda Ghassaei
AMOEBA
Commits
95ed7511
Commit
95ed7511
authored
Jun 30, 2016
by
amandaghassaei
Browse files
trying to fix rotatios
parent
7662f6db
Changes
1
Hide whitespace changes
Inline
Side-by-side
js/simulation/function/EM/emSimLattice.js
View file @
95ed7511
...
...
@@ -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);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment