diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2019-01-20 18:22:55 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2019-01-20 18:27:06 +0300 |
commit | 482c4d099ae88bea018712b92b2990617ef006f8 (patch) | |
tree | cdc6dd9d345da7a6edb2106ecb63d314d14b7a61 /source/blender/blenkernel/intern/collision.c | |
parent | b0dee09a6d5531fb3bc7bbb00069c75e18dfbd1d (diff) |
Cleanup: remove all BLI_utiledefines' ugly vectorial macros.
Not only were those often making doublons with already existing
BLI_math's stuff, but they were also used to hide implicit type
conversions...
As usual this adds some more exotic inlined vector functions (one of
the rare cases where I really miss C++ and its templates... ;) ).
Diffstat (limited to 'source/blender/blenkernel/intern/collision.c')
-rw-r--r-- | source/blender/blenkernel/intern/collision.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/source/blender/blenkernel/intern/collision.c b/source/blender/blenkernel/intern/collision.c index 53278d76399..e392f499b08 100644 --- a/source/blender/blenkernel/intern/collision.c +++ b/source/blender/blenkernel/intern/collision.c @@ -428,9 +428,9 @@ static void collision_compute_barycentric ( float pv[3], float p1[3], float p2[3 double tempV1[3], tempV2[3], tempV4[3]; double a, b, c, d, e, f; - VECSUB ( tempV1, p1, p3 ); - VECSUB ( tempV2, p2, p3 ); - VECSUB ( tempV4, pv, p3 ); + sub_v3db_v3fl_v3fl(tempV1, p1, p3); + sub_v3db_v3fl_v3fl(tempV2, p2, p3); + sub_v3db_v3fl_v3fl(tempV4, pv, p3); a = INPR ( tempV1, tempV1 ); b = INPR ( tempV1, tempV2 ); @@ -1131,8 +1131,8 @@ static int cloth_bvh_objcollisions_resolve(ClothModifierData * clmd, Object **co for (i = 0; i < mvert_num; i++) { // calculate "velocities" (just xnew = xold + v; no dt in v) if (verts[i].impulse_count) { - VECADD ( verts[i].tv, verts[i].tv, verts[i].impulse); - VECADD ( verts[i].dcvel, verts[i].dcvel, verts[i].impulse); + add_v3_v3(verts[i].tv, verts[i].impulse); + add_v3_v3(verts[i].dcvel, verts[i].impulse); zero_v3(verts[i].impulse); verts[i].impulse_count = 0; @@ -1168,8 +1168,8 @@ static int cloth_bvh_selfcollisions_resolve(ClothModifierData * clmd, CollPair * for (i = 0; i < mvert_num; i++) { if (verts[i].impulse_count) { // VECADDMUL ( verts[i].tv, verts[i].impulse, 1.0f / verts[i].impulse_count ); - VECADD ( verts[i].tv, verts[i].tv, verts[i].impulse); - VECADD ( verts[i].dcvel, verts[i].dcvel, verts[i].impulse); + add_v3_v3(verts[i].tv, verts[i].impulse); + add_v3_v3(verts[i].dcvel, verts[i].impulse); zero_v3(verts[i].impulse); verts[i].impulse_count = 0; @@ -1305,7 +1305,7 @@ int cloth_bvh_collision(Depsgraph *depsgraph, Object *ob, ClothModifierData *clm } } - VECADD(verts[i].tx, verts[i].txold, verts[i].tv); + add_v3_v3v3(verts[i].tx, verts[i].txold, verts[i].tv); } } @@ -1572,7 +1572,7 @@ void cloth_find_point_contacts(Depsgraph *depsgraph, Object *ob, ClothModifierDa } } - VECADD(verts[i].tx, verts[i].txold, verts[i].tv); + add_v3_v3v3(verts[i].tx, verts[i].txold, verts[i].tv); } //////////////////////////////////////////////////////////// |