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
OrigamiSimulator
Commits
aed802b3
Commit
aed802b3
authored
Jun 01, 2017
by
amandaghassaei
Browse files
sign fixed
parent
ef8e07ef
Changes
1
Show whitespace changes
Inline
Side-by-side
index.html
View file @
aed802b3
...
...
@@ -305,19 +305,19 @@
//calc forces
float
triangleStiffness
=
0.1
;
anglesDiff
*=
-
triangleStiffness
;
anglesDiff
*=
triangleStiffness
;
if
(
faceIndex
==
0
){
//a
force
-=
anglesDiff
[
0
]
*
(
cross
(
ac
,
normal
)
/
lengthAC
-
cross
(
ab
,
normal
)
/
lengthAB
);
force
+=
anglesDiff
[
1
]
*
cross
(
-
ab
,
normal
)
/
lengthAB
;
force
-=
anglesDiff
[
2
]
*
cross
(
-
ac
,
normal
)
/
lengthAC
;
force
-=
anglesDiff
[
0
]
*
(
cross
(
normal
,
ac
)
/
lengthAC
-
cross
(
normal
,
ab
)
/
lengthAB
);
force
+=
anglesDiff
[
1
]
*
cross
(
normal
,
-
ab
)
/
lengthAB
;
force
-=
anglesDiff
[
2
]
*
cross
(
normal
,
-
ac
)
/
lengthAC
;
}
else
if
(
faceIndex
==
1
){
force
-=
anglesDiff
[
0
]
*
cross
(
ab
,
normal
)
/
lengthAB
;
force
-=
anglesDiff
[
1
]
*
(
cross
(
-
ab
,
normal
)
/
lengthAB
-
cross
(
bc
,
normal
)
/
lengthBC
);
force
+=
anglesDiff
[
2
]
*
cross
(
-
bc
,
normal
)
/
lengthBC
;
force
-=
anglesDiff
[
0
]
*
cross
(
normal
,
ab
)
/
lengthAB
;
force
-=
anglesDiff
[
1
]
*
(
cross
(
normal
,
-
ab
)
/
lengthAB
-
cross
(
normal
,
bc
)
/
lengthBC
);
force
+=
anglesDiff
[
2
]
*
cross
(
normal
,
-
bc
)
/
lengthBC
;
}
else
if
(
faceIndex
==
2
){
force
+=
anglesDiff
[
0
]
*
cross
(
ac
,
normal
)
/
lengthAC
;
force
-=
anglesDiff
[
1
]
*
cross
(
bc
,
normal
)
/
lengthBC
;
force
-=
anglesDiff
[
2
]
*
(
cross
(
-
bc
,
normal
)
/
lengthBC
-
cross
(
-
ac
,
normal
)
/
lengthAC
);
force
+=
anglesDiff
[
0
]
*
cross
(
normal
,
ac
)
/
lengthAC
;
force
-=
anglesDiff
[
1
]
*
cross
(
normal
,
bc
)
/
lengthBC
;
force
-=
anglesDiff
[
2
]
*
(
cross
(
normal
,
-
bc
)
/
lengthBC
-
cross
(
normal
,
-
ac
)
/
lengthAC
);
}
}
...
...
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