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
bbguimaraes
college
Commits
30d46db1
Commit
30d46db1
authored
Jul 16, 2016
by
bbguimaraes
Browse files
sms: simulation tweaks
parent
f54d413b
Changes
3
Hide whitespace changes
Inline
Side-by-side
sms/libsms/src/springmasssystem.cpp
View file @
30d46db1
...
...
@@ -5,7 +5,7 @@
#include "sms/spring.h"
/*static*/
const
float
SpringMassSystem
::
DAMPING
=
0.9
5
f
;
const
float
SpringMassSystem
::
DAMPING
=
0.9
8
f
;
/*static*/
void
SpringMassSystem
::
link
(
Mass
*
mass0
,
Mass
*
mass1
,
Spring
*
spring
)
{
...
...
sms/sms/src/main.cpp
View file @
30d46db1
...
...
@@ -15,7 +15,7 @@ void init_sm_system3(SpringMassSystem * system);
GLuint
load_texture
(
const
std
::
string
&
filename
);
int
main
(
int
argc
,
char
**
argv
)
{
const
double
UPDATE_RATE
=
1.0
f
/
5
000.0
f
;
const
double
UPDATE_RATE
=
1.0
f
/
3
000.0
f
;
QApplication
app
(
argc
,
argv
);
SpringMassSystem
sms0
,
sms1
;
init_sm_system3
(
&
sms0
);
...
...
@@ -82,7 +82,7 @@ void init_sm_system2(SpringMassSystem * system) {
system
,
Vector
(
-
5.0
f
,
10.0
f
),
Vector
(
5.0
f
,
0.0
f
),
W
,
5
,
1.0
f
,
1
0.0
f
);
1.0
f
,
3
0.0
f
);
(
*
system
->
masses
())[
0
].
set_fixed
(
true
);
(
*
system
->
masses
())[
W
-
1
].
set_fixed
(
true
);
}
...
...
sms/sms/src/smscreator.cpp
View file @
30d46db1
...
...
@@ -177,7 +177,9 @@ void SMSCreator::create_crossed_flag(
for
(
unsigned
int
x
=
0
;
x
<
x_masses
-
1
;
++
x
)
{
link
(
x
,
y
,
x
+
1
,
y
,
INCREMENT
.
x
());
link
(
x
,
y
,
x
,
y
+
1
,
INCREMENT
.
y
());
spring_it
->
set_k
(
k
*
0.05
f
);
link
(
x
,
y
,
x
+
1
,
y
+
1
,
INCREMENT_LENGTH
);
spring_it
->
set_k
(
k
*
0.05
f
);
link
(
x
+
1
,
y
,
x
,
y
+
1
,
INCREMENT_LENGTH
);
}
link
(
x_masses
-
1
,
y
,
x_masses
-
1
,
y
+
1
,
INCREMENT
.
y
());
...
...
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