Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2019-05-31 15:51:19 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-05-31 15:55:15 +0300
commitd8dbd49a2f23b7637f05fc058f39bdf6ab706624 (patch)
tree0805b9372c82ae6505d87e879824efe1d3e32f8e /source/blender/physics/intern/implicit_blender.c
parent8987f7987d8160e1f6e79e8c85d6ce65b885ab25 (diff)
Cleanup: style, use braces in source/
Automated using clang-tidy.
Diffstat (limited to 'source/blender/physics/intern/implicit_blender.c')
-rw-r--r--source/blender/physics/intern/implicit_blender.c36
1 files changed, 24 insertions, 12 deletions
diff --git a/source/blender/physics/intern/implicit_blender.c b/source/blender/physics/intern/implicit_blender.c
index d64846e4dcc..9952781b60f 100644
--- a/source/blender/physics/intern/implicit_blender.c
+++ b/source/blender/physics/intern/implicit_blender.c
@@ -1233,10 +1233,12 @@ void BPH_mass_spring_get_motion_state(struct Implicit_Data *data,
float x[3],
float v[3])
{
- if (x)
+ if (x) {
root_to_world_v3(data, index, x, data->X[index]);
- if (v)
+ }
+ if (v) {
root_to_world_v3(data, index, v, data->V[index]);
+ }
}
void BPH_mass_spring_get_position(struct Implicit_Data *data, int index, float x[3])
@@ -1595,10 +1597,12 @@ BLI_INLINE float fbstar(float length, float L, float kb, float cb)
float tempfb_fl = kb * fb(length, L);
float fbstar_fl = cb * (length - L);
- if (tempfb_fl < fbstar_fl)
+ if (tempfb_fl < fbstar_fl) {
return fbstar_fl;
- else
+ }
+ else {
return tempfb_fl;
+ }
}
// function to calculae bending spring force (taken from Choi & Co)
@@ -1925,30 +1929,38 @@ BLI_INLINE void spring_hairbend_forces(Implicit_Data *data,
zero_v3(fk);
sub_v3_v3v3(edge_ij, data->X[j], data->X[i]);
- if (q == i)
+ if (q == i) {
sub_v3_v3(edge_ij, dx);
- if (q == j)
+ }
+ if (q == j) {
add_v3_v3(edge_ij, dx);
+ }
normalize_v3_v3(dir_ij, edge_ij);
sub_v3_v3v3(edge_jk, data->X[k], data->X[j]);
- if (q == j)
+ if (q == j) {
sub_v3_v3(edge_jk, dx);
- if (q == k)
+ }
+ if (q == k) {
add_v3_v3(edge_jk, dx);
+ }
normalize_v3_v3(dir_jk, edge_jk);
sub_v3_v3v3(vel_ij, data->V[j], data->V[i]);
- if (q == i)
+ if (q == i) {
sub_v3_v3(vel_ij, dv);
- if (q == j)
+ }
+ if (q == j) {
add_v3_v3(vel_ij, dv);
+ }
sub_v3_v3v3(vel_jk, data->V[k], data->V[j]);
- if (q == j)
+ if (q == j) {
sub_v3_v3(vel_jk, dv);
- if (q == k)
+ }
+ if (q == k) {
add_v3_v3(vel_jk, dv);
+ }
/* bending force */
sub_v3_v3v3(dist, goal, edge_jk);