Commit: 0d51aadbfed6c0c72ca74085e3744d86e879d3b9
Author: Kévin Dietrich
Date:   Thu May 28 23:38:39 2015 +0200
Branches: openvdb
https://developer.blender.org/rB0d51aadbfed6c0c72ca74085e3744d86e879d3b9

Cleanup: use madd_v3_v3fl to avoid unnecessary steps and local variable.

===================================================================

M       source/blender/blenkernel/intern/smoke.c

===================================================================

diff --git a/source/blender/blenkernel/intern/smoke.c 
b/source/blender/blenkernel/intern/smoke.c
index b84881d..9d75eeaa 100644
--- a/source/blender/blenkernel/intern/smoke.c
+++ b/source/blender/blenkernel/intern/smoke.c
@@ -3055,7 +3055,6 @@ int smoke_get_data_flags(SmokeDomainSettings *sds)
 static void compute_fluid_matrices(SmokeDomainSettings *sds)
 {
        float bbox_min[3];
-       float adjust[3];
 
        copy_v3_v3(bbox_min, sds->p0);
 
@@ -3072,8 +3071,7 @@ static void compute_fluid_matrices(SmokeDomainSettings 
*sds)
 
        /* The smoke simulator stores voxels cell-centered, whilst VDB is node
         * centered, so we offset the matrix by half a voxel to compensate. */
-       mul_v3_v3fl(adjust, sds->cell_size, 0.5f);
-       add_v3_v3(sds->fluidmat[3], adjust);
+       madd_v3_v3fl(sds->fluidmat[3], sds->cell_size, 0.5f);
 
        mul_m4_m4m4(sds->fluidmat, sds->obmat, sds->fluidmat);
 
@@ -3085,8 +3083,7 @@ static void compute_fluid_matrices(SmokeDomainSettings 
*sds)
                copy_v3_v3(sds->fluidmat_wt[3], bbox_min);
 
                /* Same here, add half a voxel to adjust the position of the 
fluid. */
-               mul_v3_v3fl(adjust, voxel_size_high, 0.5f);
-               add_v3_v3(sds->fluidmat_wt[3], adjust);
+               madd_v3_v3fl(sds->fluidmat_wt[3], voxel_size_high, 0.5f);
 
                mul_m4_m4m4(sds->fluidmat_wt, sds->obmat, sds->fluidmat_wt);
        }

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to