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
a8b7bf4d
Commit
a8b7bf4d
authored
Jun 28, 2016
by
amandaghassaei
Browse files
small change
parent
1b9b10dd
Changes
1
Hide whitespace changes
Inline
Side-by-side
js/simulation/function/EM/emSimLattice.js
View file @
a8b7bf4d
...
@@ -672,13 +672,13 @@ define(['underscore', 'backbone', 'threeModel', 'lattice', 'plist', 'emWire', 'G
...
@@ -672,13 +672,13 @@ define(['underscore', 'backbone', 'threeModel', 'lattice', 'plist', 'emWire', 'G
rForce
=
this
.
_addVectors
(
rForce
,
torque
);
rForce
=
this
.
_addVectors
(
rForce
,
torque
);
//bending and torsion
//bending and torsion
for
(
var
_axis
=
0
;
_axis
<
3
;
_axis
++
)
{
//
for (var _axis=0;_axis<3;_axis++) {
if
(
_axis
==
neighborAxis
){
//
if (_axis == neighborAxis){
rForce
[
_axis
]
+=
0.001
*
torsionK
[
_axis
]
*
(
neighborRotation
[
_axis
]
-
rotation
[
_axis
]);
// + torsionD[_axis]*(neighborAngVelocity[_axis]-angVelocity[_axis]);
//
rForce[_axis] += 0.001*torsionK[_axis]*(neighborRotation[_axis]-rotation[_axis]);// + torsionD[_axis]*(neighborAngVelocity[_axis]-angVelocity[_axis]);
}
else
{
//
} else {
rForce
[
_axis
]
+=
0.001
*
bendingK
[
_axis
]
*
(
neighborRotation
[
_axis
]
-
rotation
[
_axis
]);
// + bendingD[_axis]*(neighborAngVelocity[_axis]-angVelocity[_axis]);
//
rForce[_axis] += 0.001*bendingK[_axis]*(neighborRotation[_axis]-rotation[_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);
...
@@ -751,7 +751,7 @@ define(['underscore', 'backbone', 'threeModel', 'lattice', 'plist', 'emWire', 'G
...
@@ -751,7 +751,7 @@ define(['underscore', 'backbone', 'threeModel', 'lattice', 'plist', 'emWire', 'G
position
[
1
]
+=
multiplier
*
translation
[
1
];
position
[
1
]
+=
multiplier
*
translation
[
1
];
position
[
2
]
+=
multiplier
*
translation
[
2
];
position
[
2
]
+=
multiplier
*
translation
[
2
];
var
quaternion
=
[
this
.
quaternion
[
rgbaIndex
],
this
.
quaternion
[
rgbaIndex
+
1
],
this
.
quaternion
[
rgbaIndex
+
2
],
this
.
quaternion
[
rgbaIndex
+
3
]];
//
var quaternion = [this.quaternion[rgbaIndex], this.quaternion[rgbaIndex+1], this.quaternion[rgbaIndex+2], this.quaternion[rgbaIndex+3]];
cells
[
index
[
0
]][
index
[
1
]][
index
[
2
]].
object3D
.
position
.
set
(
position
[
0
],
position
[
1
],
position
[
2
]);
cells
[
index
[
0
]][
index
[
1
]][
index
[
2
]].
object3D
.
position
.
set
(
position
[
0
],
position
[
1
],
position
[
2
]);
cells
[
index
[
0
]][
index
[
1
]][
index
[
2
]].
object3D
.
rotation
.
set
(
this
.
translation
[
rgbaIndex
+
4
*
textureSize
],
this
.
translation
[
rgbaIndex
+
1
+
4
*
textureSize
],
this
.
translation
[
rgbaIndex
+
2
+
4
*
textureSize
]);
cells
[
index
[
0
]][
index
[
1
]][
index
[
2
]].
object3D
.
rotation
.
set
(
this
.
translation
[
rgbaIndex
+
4
*
textureSize
],
this
.
translation
[
rgbaIndex
+
1
+
4
*
textureSize
],
this
.
translation
[
rgbaIndex
+
2
+
4
*
textureSize
]);
...
@@ -877,7 +877,8 @@ define(['underscore', 'backbone', 'threeModel', 'lattice', 'plist', 'emWire', 'G
...
@@ -877,7 +877,8 @@ define(['underscore', 'backbone', 'threeModel', 'lattice', 'plist', 'emWire', 'G
var
s2
=
Math
.
sin
(
euler
[
1
]
/
2
);
var
s2
=
Math
.
sin
(
euler
[
1
]
/
2
);
var
s3
=
Math
.
sin
(
euler
[
2
]
/
2
);
var
s3
=
Math
.
sin
(
euler
[
2
]
/
2
);
return
[
s1
*
c2
*
c3
+
c1
*
s2
*
s3
,
c1
*
s2
*
c3
-
s1
*
c2
*
s3
,
c1
*
c2
*
s3
+
s1
*
s2
*
c3
,
c1
*
c2
*
c3
-
s1
*
s2
*
s3
];
return
[
s1
*
c2
*
c3
-
c1
*
s2
*
s3
,
c1
*
s2
*
c3
+
s1
*
c2
*
s3
,
c1
*
c2
*
s3
-
s1
*
s2
*
c3
,
c1
*
c2
*
c3
+
s1
*
s2
*
s3
];
//zyx
//return [s1 * c2 * c3 + c1 * s2 * s3, c1 * s2 * c3 - s1 * c2 * s3, c1 * c2 * s3 + s1 * s2 * c3, c1 * c2 * c3 - s1 * s2 * s3];//xyz
},
},
_clamp
:
function
(
x
,
a
,
b
)
{
_clamp
:
function
(
x
,
a
,
b
)
{
...
...
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