KDTree: deprecate 'normal' argument
[blender.git] / source / blender / editors / physics / particle_edit.c
index 0dee36d31cd7e0afb2782422597661ec7604c13a..aa1d01775f55a9b27b8ccc26886db907403f5e4b 100644 (file)
@@ -749,7 +749,7 @@ static void PE_update_mirror_cache(Object *ob, ParticleSystem *psys)
                psys_mat_hair_to_orco(ob, psmd->dm, psys->part->from, pa, mat);
                copy_v3_v3(co, key->co);
                mul_m4_v3(mat, co);
-               BLI_kdtree_insert(tree, p, co, NULL);
+               BLI_kdtree_insert(tree, p, co);
        }
 
        BLI_kdtree_balance(tree);
@@ -765,7 +765,7 @@ static void PE_update_mirror_cache(Object *ob, ParticleSystem *psys)
                mul_m4_v3(mat, co);
                co[0] = -co[0];
 
-               index= BLI_kdtree_find_nearest(tree, co, NULL, &nearest);
+               index= BLI_kdtree_find_nearest(tree, co, &nearest);
 
                /* this needs a custom threshold still, duplicated for editmode mirror */
                if (index != -1 && index != p && (nearest.dist <= 0.0002f))
@@ -939,7 +939,7 @@ static void pe_deflect_emitter(Scene *scene, Object *ob, PTCacheEdit *edit)
                                dist_1st *= dist * pset->emitterdist;
                        }
                        else {
-                               index= BLI_kdtree_find_nearest(edit->emitter_field, key->co, NULL, NULL);
+                               index= BLI_kdtree_find_nearest(edit->emitter_field, key->co, NULL);
                                
                                vec=edit->emitter_cosnos +index*6;
                                nor=vec+3;
@@ -1123,7 +1123,7 @@ static void recalc_emitter_field(Object *ob, ParticleSystem *psys)
 
                normalize_v3(nor);
 
-               BLI_kdtree_insert(edit->emitter_field, i, vec, NULL);
+               BLI_kdtree_insert(edit->emitter_field, i, vec);
        }
 
        BLI_kdtree_balance(edit->emitter_field);
@@ -2459,7 +2459,7 @@ static int remove_doubles_exec(bContext *C, wmOperator *op)
                        psys_mat_hair_to_object(ob, psmd->dm, psys->part->from, psys->particles+p, mat);
                        copy_v3_v3(co, point->keys->co);
                        mul_m4_v3(mat, co);
-                       BLI_kdtree_insert(tree, p, co, NULL);
+                       BLI_kdtree_insert(tree, p, co);
                }
 
                BLI_kdtree_balance(tree);
@@ -2470,7 +2470,7 @@ static int remove_doubles_exec(bContext *C, wmOperator *op)
                        copy_v3_v3(co, point->keys->co);
                        mul_m4_v3(mat, co);
 
-                       totn = BLI_kdtree_find_nearest_n(tree, co, NULL, nearest, 10);
+                       totn = BLI_kdtree_find_nearest_n(tree, co, nearest, 10);
 
                        for (n=0; n<totn; n++) {
                                /* this needs a custom threshold still */
@@ -3023,7 +3023,7 @@ static void brush_puff(PEData *data, int point_index)
                        mul_m4_v3(mat, co);
                        mul_v3_m4v3(kco, data->ob->imat, co); /* use 'kco' as the object space version of worldspace 'co', ob->imat is set before calling */
 
-                       point_index= BLI_kdtree_find_nearest(edit->emitter_field, kco, NULL, NULL);
+                       point_index= BLI_kdtree_find_nearest(edit->emitter_field, kco, NULL);
                        if (point_index == -1) return;
 
                        copy_v3_v3(co_root, co);
@@ -3107,7 +3107,7 @@ static void brush_puff(PEData *data, int point_index)
                                                mul_m4_v3(mat, oco);
                                                mul_v3_m4v3(kco, data->ob->imat, oco); /* use 'kco' as the object space version of worldspace 'co', ob->imat is set before calling */
 
-                                               point_index= BLI_kdtree_find_nearest(edit->emitter_field, kco, NULL, NULL);
+                                               point_index= BLI_kdtree_find_nearest(edit->emitter_field, kco, NULL);
                                                if (point_index != -1) {
                                                        copy_v3_v3(onor, &edit->emitter_cosnos[point_index*6+3]);
                                                        mul_mat3_m4_v3(data->ob->obmat, onor); /* normal into worldspace */
@@ -3434,7 +3434,7 @@ static int brush_add(PEData *data, short number)
                        
                        for (i=0, pa=psys->particles; i<totpart; i++, pa++) {
                                psys_particle_on_dm(psmd->dm, psys->part->from, pa->num, pa->num_dmcache, pa->fuv, pa->foffset, cur_co, 0, 0, 0, 0, 0);
-                               BLI_kdtree_insert(tree, i, cur_co, NULL);
+                               BLI_kdtree_insert(tree, i, cur_co);
                        }
 
                        BLI_kdtree_balance(tree);
@@ -3478,7 +3478,7 @@ static int brush_add(PEData *data, short number)
                                float maxd, totw=0.0, weight[3];
 
                                psys_particle_on_dm(psmd->dm, psys->part->from, pa->num, pa->num_dmcache, pa->fuv, pa->foffset, co1, 0, 0, 0, 0, 0);
-                               maxw = BLI_kdtree_find_nearest_n(tree, co1, NULL, ptn, 3);
+                               maxw = BLI_kdtree_find_nearest_n(tree, co1, ptn, 3);
 
                                maxd= ptn[maxw-1].dist;