Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
AMOEBA
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Amanda Ghassaei
AMOEBA
Commits
147f2aba
Commit
147f2aba
authored
Jul 10, 2016
by
amandaghassaei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
verlet translational
parent
3522f626
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
3 deletions
+17
-3
js/simulation/function/EM/emSimLattice.js
js/simulation/function/EM/emSimLattice.js
+17
-3
No files found.
js/simulation/function/EM/emSimLattice.js
View file @
147f2aba
...
...
@@ -745,8 +745,15 @@ define(['underscore', 'backbone', 'threeModel', 'lattice', 'plist', 'emWire', 'G
}
var
acceleration
=
[
force
[
0
]
/
mass
,
force
[
1
]
/
mass
,
force
[
2
]
/
mass
];
var
nextVelocity
=
[
velocity
[
0
]
+
acceleration
[
0
]
*
dt
,
velocity
[
1
]
+
acceleration
[
1
]
*
dt
,
velocity
[
2
]
+
acceleration
[
2
]
*
dt
];
var
nextTranslation
=
[
translation
[
0
]
+
velocity
[
0
]
*
dt
,
translation
[
1
]
+
velocity
[
1
]
*
dt
,
translation
[
2
]
+
velocity
[
2
]
*
dt
];
var
nextTranslation
=
[
translation
[
0
]
*
2
-
this
.
lastLastTranslation
[
rgbaIndex
]
+
acceleration
[
0
]
*
dt
*
dt
,
translation
[
1
]
*
2
-
this
.
lastLastTranslation
[
rgbaIndex
+
1
]
+
acceleration
[
1
]
*
dt
*
dt
,
translation
[
2
]
*
2
-
this
.
lastLastTranslation
[
rgbaIndex
+
2
]
+
acceleration
[
2
]
*
dt
*
dt
];
var
nextVelocity
=
[
(
nextTranslation
[
0
]
-
translation
[
0
])
/
dt
,
(
nextTranslation
[
1
]
-
translation
[
1
])
/
dt
,
(
nextTranslation
[
2
]
-
translation
[
2
])
/
dt
];
this
.
translation
[
rgbaIndex
]
=
nextTranslation
[
0
];
this
.
translation
[
rgbaIndex
+
1
]
=
nextTranslation
[
1
];
...
...
@@ -801,7 +808,7 @@ define(['underscore', 'backbone', 'threeModel', 'lattice', 'plist', 'emWire', 'G
}
this
.
_swapArrays
(
"
velocity
"
,
"
lastVelocity
"
);
this
.
_swap
Arrays
(
"
translation
"
,
"
l
astTranslation
"
);
this
.
_swap
3Arrays
(
"
translation
"
,
"
lastTranslation
"
,
"
lastL
astTranslation
"
);
this
.
_swapArrays
(
"
quaternion
"
,
"
lastQuaternion
"
);
this
.
_swapArrays
(
"
angVelocity
"
,
"
lastAngVelocity
"
);
},
...
...
@@ -1092,6 +1099,13 @@ define(['underscore', 'backbone', 'threeModel', 'lattice', 'plist', 'emWire', 'G
this
[
array2Name
]
=
temp
;
},
_swap3Arrays
:
function
(
array1Name
,
array2Name
,
array3Name
){
var
temp
=
this
[
array3Name
];
this
[
array3Name
]
=
this
[
array2Name
];
this
[
array2Name
]
=
this
[
array1Name
];
this
[
array1Name
]
=
temp
;
},
reset
:
function
(){
if
(
!
this
.
textureSize
)
return
;
//no cells
var
textureSize
=
this
.
textureSize
[
0
]
*
this
.
textureSize
[
1
];
...
...
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