Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SWIFT
SWIFTsim
Commits
d5e85e12
Commit
d5e85e12
authored
Apr 12, 2016
by
Matthieu Schaller
Browse files
Made the magical constant in the potential timestep a #define constant
parent
288b3ca8
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/potentials.h
View file @
d5e85e12
...
...
@@ -48,6 +48,8 @@ struct external_potential {
/* Include exteral pointmass potential */
#ifdef EXTERNAL_POTENTIAL_POINTMASS
#define EXTERNAL_GRAVITY_TIMESTEP_PREFACTOR 0.03f
/**
* @brief Computes the time-step due to the acceleration from a point mass
*
...
...
@@ -79,7 +81,7 @@ __attribute__((always_inline))
const
float
a_2
=
g
->
a_grav
[
0
]
*
g
->
a_grav
[
0
]
+
g
->
a_grav
[
1
]
*
g
->
a_grav
[
1
]
+
g
->
a_grav
[
2
]
*
g
->
a_grav
[
2
];
return
0
.
03
f
*
sqrtf
(
a_2
/
dota_2
);
return
EXTERNAL_GRAVITY_TIMESTEP_PREFACTOR
*
sqrtf
(
a_2
/
dota_2
);
}
/**
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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