Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Amanda Ghassaei
AMOEBA
Commits
ac2e1171
Commit
ac2e1171
authored
Jul 06, 2016
by
amandaghassaei
Browse files
getting closer to bending/torsion
parent
95ed7511
Changes
1
Hide whitespace changes
Inline
Side-by-side
js/simulation/function/EM/emSimLattice.js
View file @
ac2e1171
...
...
@@ -674,15 +674,15 @@ define(['underscore', 'backbone', 'threeModel', 'lattice', 'plist', 'emWire', 'G
//todo this is causing instability
//bending and torsion
//var quaternionDiff = this._multiplyQuaternions(this._invertQuaternion(
neighborQ
uaternion),
q
uaternion);
//var quaternionDiff = this._multiplyQuaternions(this._invertQuaternion(
q
uaternion),
neighborQ
uaternion);
//var diffEuler = this._eulerFromQuaternion(quaternionDiff);
for
(
var
_axis
=
0
;
_axis
<
3
;
_axis
++
)
{
if
(
_axis
==
neighborAxis
){
rForce
[
_axis
]
+=
0.0000
0
1
*
torsionK
[
_axis
]
*
(
neighborRotation
[
_axis
]
-
rotation
[
_axis
]);
// + torsionD[_axis]*(neighborAngVelocity[_axis]-angVelocity[_axis]);
}
else
{
rForce
[
_axis
]
+=
0.0000
0
1
*
bendingK
[
_axis
]
*
(
neighborRotation
[
_axis
]
-
rotation
[
_axis
]);
// + bendingD[_axis]*(neighborAngVelocity[_axis]-angVelocity[_axis]);
}
}
//
for (var _axis=0;_axis<3;_axis++) {
//
if (_axis == neighborAxis){
//
rForce[_axis] += 0.00001*torsionK[_axis]*(
diffEuler
[_axis]);// + torsionD[_axis]*(neighborAngVelocity[_axis]-angVelocity[_axis]);
//
} else {
//
rForce[_axis] += 0.00001*bendingK[_axis]*(
diffEuler
[_axis]);// + bendingD[_axis]*(neighborAngVelocity[_axis]-angVelocity[_axis]);
//
}
//
}
//console.log(rotation);
//console.log(neighborRotation);
//console.log(angVelocity);
...
...
Write
Preview
Supports
Markdown
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