Commit: 3df139c53062a141403ea9d359715ca3635c243c
Author: Campbell Barton
Date: Fri Oct 6 21:05:34 2017 +1100
Branches: master
https://developer.blender.org/rB3df139c53062a141403ea9d359715ca3635c243c
Cleanup: Math lib naming (use v3 suffix)
===================================================================
M source/blender/blenkernel/intern/mball_tessellate.c
M source/blender/blenkernel/intern/mesh_evaluate.c
M source/blender/blenkernel/intern/pbvh.c
M source/blender/blenkernel/intern/softbody.c
M source/blender/blenlib/BLI_math_geom.h
M source/blender/blenlib/intern/math_geom.c
M source/blender/bmesh/intern/bmesh_mesh.c
M source/blender/editors/sculpt_paint/paint_vertex.c
M source/blender/editors/sculpt_paint/sculpt.c
M source/blender/render/intern/source/convertblender.c
===================================================================
diff --git a/source/blender/blenkernel/intern/mball_tessellate.c
b/source/blender/blenkernel/intern/mball_tessellate.c
index 76965176be8..82d82ce71c4 100644
--- a/source/blender/blenkernel/intern/mball_tessellate.c
+++ b/source/blender/blenkernel/intern/mball_tessellate.c
@@ -423,13 +423,13 @@ static void make_face(PROCESS *process, int i1, int i2,
int i3, int i4)
#ifdef USE_ACCUM_NORMAL
if (i4 == 0) {
normal_tri_v3(n, process->co[i1], process->co[i2],
process->co[i3]);
- accumulate_vertex_normals(
+ accumulate_vertex_normals_v3(
process->no[i1], process->no[i2], process->no[i3],
NULL, n,
process->co[i1], process->co[i2], process->co[i3],
NULL);
}
else {
normal_quad_v3(n, process->co[i1], process->co[i2],
process->co[i3], process->co[i4]);
- accumulate_vertex_normals(
+ accumulate_vertex_normals_v3(
process->no[i1], process->no[i2], process->no[i3],
process->no[i4], n,
process->co[i1], process->co[i2], process->co[i3],
process->co[i4]);
}
diff --git a/source/blender/blenkernel/intern/mesh_evaluate.c
b/source/blender/blenkernel/intern/mesh_evaluate.c
index 643ca3ee536..b28ec7f4fff 100644
--- a/source/blender/blenkernel/intern/mesh_evaluate.c
+++ b/source/blender/blenkernel/intern/mesh_evaluate.c
@@ -225,7 +225,7 @@ static void mesh_calc_normals_poly_accum_task_cb(void
*userdata, const int pidx)
}
/* accumulate angle weighted face normal */
- /* inline version of #accumulate_vertex_normals_poly */
+ /* inline version of #accumulate_vertex_normals_poly_v3 */
{
const float *prev_edge = edgevecbuf[nverts - 1];
@@ -334,8 +334,9 @@ void BKE_mesh_calc_normals_tessface(
else
normal_tri_v3(f_no, mverts[mf->v1].co,
mverts[mf->v2].co, mverts[mf->v3].co);
- accumulate_vertex_normals(tnorms[mf->v1], tnorms[mf->v2],
tnorms[mf->v3], n4,
- f_no, mverts[mf->v1].co,
mverts[mf->v2].co, mverts[mf->v3].co, c4);
+ accumulate_vertex_normals_v3(
+ tnorms[mf->v1], tnorms[mf->v2], tnorms[mf->v3], n4,
+ f_no, mverts[mf->v1].co, mverts[mf->v2].co,
mverts[mf->v3].co, c4);
}
/* following Mesh convention; we use vertex coordinate itself for
normal in this case */
@@ -379,7 +380,7 @@ void BKE_mesh_calc_normals_looptri(
f_no,
mverts[vtri[0]].co, mverts[vtri[1]].co,
mverts[vtri[2]].co);
- accumulate_vertex_normals_tri(
+ accumulate_vertex_normals_tri_v3(
tnorms[vtri[0]], tnorms[vtri[1]], tnorms[vtri[2]],
f_no, mverts[vtri[0]].co, mverts[vtri[1]].co,
mverts[vtri[2]].co);
}
@@ -845,7 +846,7 @@ static void split_loop_nor_fan_do(LoopSplitTaskDataCommon
*common_data, LoopSpli
// printf("\thandling edge %d / loop %d\n", mlfan_curr->e,
mlfan_curr_index);
{
- /* Code similar to accumulate_vertex_normals_poly. */
+ /* Code similar to accumulate_vertex_normals_poly_v3. */
/* Calculate angle between the two poly edges incident
on this vertex. */
const float fac = saacos(dot_v3v3(vec_curr, vec_prev));
/* Accumulate */
diff --git a/source/blender/blenkernel/intern/pbvh.c
b/source/blender/blenkernel/intern/pbvh.c
index d739f804fef..aa8ab07518f 100644
--- a/source/blender/blenkernel/intern/pbvh.c
+++ b/source/blender/blenkernel/intern/pbvh.c
@@ -1837,7 +1837,7 @@ static bool nearest_to_ray_aabb_dist_sq(PBVHNode *node,
void *data_v)
}
float co_dummy[3], depth;
- node->tmin = dist_squared_ray_to_aabb(&rcd->dist_ray_to_aabb_precalc,
bb_min, bb_max, co_dummy, &depth);
+ node->tmin =
dist_squared_ray_to_aabb_v3(&rcd->dist_ray_to_aabb_precalc, bb_min, bb_max,
co_dummy, &depth);
/* Ideally we would skip distances outside the range. */
return depth > 0.0f;
}
@@ -1849,7 +1849,7 @@ void BKE_pbvh_find_nearest_to_ray(
{
FindNearestRayData ncd;
- dist_squared_ray_to_aabb_precalc(&ncd.dist_ray_to_aabb_precalc,
ray_start, ray_normal);
+ dist_squared_ray_to_aabb_v3_precalc(&ncd.dist_ray_to_aabb_precalc,
ray_start, ray_normal);
ncd.original = original;
BKE_pbvh_search_callback_occluded(bvh, nearest_to_ray_aabb_dist_sq,
&ncd, cb, data);
diff --git a/source/blender/blenkernel/intern/softbody.c
b/source/blender/blenkernel/intern/softbody.c
index 600bc3f453d..3052a708137 100644
--- a/source/blender/blenkernel/intern/softbody.c
+++ b/source/blender/blenkernel/intern/softbody.c
@@ -3412,7 +3412,7 @@ static void softbody_update_positions(Object *ob,
SoftBody *sb, float (*vertexCo
* lloc, lrot, lscale are allowed to be NULL, just in case you don't need it.
* should be pretty useful for pythoneers :)
* not! velocity .. 2nd order stuff
- * vcloud_estimate_transform see
+ * vcloud_estimate_transform_v3 see
*/
void SB_estimate_transform(Object *ob, float lloc[3], float lrot[3][3], float
lscale[3][3])
@@ -3436,7 +3436,7 @@ void SB_estimate_transform(Object *ob, float lloc[3],
float lrot[3][3], float ls
copy_v3_v3(opos[a], bp->pos);
}
- vcloud_estimate_transform(sb->totpoint, opos, NULL, rpos, NULL, com,
rcom, lrot, lscale);
+ vcloud_estimate_transform_v3(sb->totpoint, opos, NULL, rpos, NULL, com,
rcom, lrot, lscale);
//sub_v3_v3(com, rcom);
if (lloc) copy_v3_v3(lloc, com);
copy_v3_v3(sb->lcom, com);
diff --git a/source/blender/blenlib/BLI_math_geom.h
b/source/blender/blenlib/BLI_math_geom.h
index d0b59244384..933e31ba84b 100644
--- a/source/blender/blenlib/BLI_math_geom.h
+++ b/source/blender/blenlib/BLI_math_geom.h
@@ -126,15 +126,15 @@ struct DistRayAABB_Precalc {
float ray_inv_dir[3];
bool sign[3];
};
-void dist_squared_ray_to_aabb_precalc(
+void dist_squared_ray_to_aabb_v3_precalc(
struct DistRayAABB_Precalc *neasrest_precalc,
const float ray_origin[3], const float ray_direction[3]);
-float dist_squared_ray_to_aabb(
+float dist_squared_ray_to_aabb_v3(
const struct DistRayAABB_Precalc *data,
const float bb_min[3], const float bb_max[3],
float r_point[3], float *r_depth);
/* when there is no advantage to precalc. */
-float dist_squared_to_ray_to_aabb_simple(
+float dist_squared_ray_to_aabb_v3_simple(
const float ray_origin[3], const float ray_direction[3],
const float bb_min[3], const float bb_max[3],
float r_point[3], float *r_depth);
@@ -407,23 +407,23 @@ void map_to_plane_axis_angle_v2_v3v3fl(float r_co[2],
const float co[3], const f
/********************************** Normals **********************************/
-void accumulate_vertex_normals_tri(
+void accumulate_vertex_normals_tri_v3(
float n1[3], float n2[3], float n3[3],
const float f_no[3],
const float co1[3], const float co2[3], const float co3[3]);
-void accumulate_vertex_normals(
+void accumulate_vertex_normals_v3(
float n1[3], float n2[3], float n3[3], float n4[3],
const float f_no[3],
const float co1[3], const float co2[3], const float co3[3], const
float co4[3]);
-void accumulate_vertex_normals_poly(
+void accumulate_vertex_normals_poly_v3(
float **vertnos, const float polyno[3],
const float **vertcos, float vdiffs[][3], const int nverts);
/********************************* Tangents **********************************/
-void tangent_from_uv(
+void tangent_from_uv_v3(
const float uv1[2], const float uv2[2], const float uv3[2],
const float co1[3], const float co2[3], const float co3[3],
const float n[3],
@@ -431,9 +431,9 @@ void tangent_from_uv(
/******************************** Vector Clouds ******************************/
-void vcloud_estimate_transform(int list_size, float (*pos)[3], float *weight,
- float (*rpos)[3], float *rweight,
- float lloc[3], float rloc[3], float lrot[3][3],
float lscale[3][3]);
+void vcloud_estimate_transform_v3(
+ const int list_size, const float (*pos)[3], const float *weight, const
float (*rpos)[3], const float *rweight,
+ float lloc[3], float rloc[3], float lrot[3][3], float lscale[3][3]);
/****************************** Spherical Harmonics *************************/
@@ -464,7 +464,7 @@ float form_factor_hemi_poly(float p[3], float n[3],
float v1[3], float v2[3], float v3[3], float
v4[3]);
void axis_dominant_v3_to_m3_negate(float r_mat[3][3], const float normal[3]);
-void axis_dominant_v3_to_m3(float r_mat[3][3], const float normal[3]);
+void axis_dominant_v3_to_m3(float r_mat[3][3], const float normal[3]);
MINLINE void axis_dominant_v3(int *r_axis_a, int *r_axis_b, const float
axis[3]);
MINLINE float axis_dominant_v3_max(int *r_axis_a, int *r_axis_b, const float
axis[3]) ATTR_WARN_UNUSED_RESULT;
diff --git a/source/blender/blenlib/intern/math_geom.c
b/source/blender/blenlib/intern/math_geom.c
index dbbc1adb534..d3080e5530f 100644
--- a/source/blender/blenlib/intern/math_geom.c
+++ b/source/blender/blenlib/intern/math_geom.c
@@ -623,7 +623,7 @@ float dist_squared_ray_to_seg_v3(
/** \name dist_squared_to_ray_to_aabb and helpers
* \{ */
-void dist_squared_ray_to_aabb_precalc(
+void dist_squared_ray_to_aabb_v3_precalc(
struct DistRayAABB_Precalc *neasrest_precalc,
const float ray_origin[3], const float ray_direction[3])
{
@@ -641,7 +641,7 @@ void dist_squared_ray_to_aabb_precalc(
/**
* Returns the distance from a ray to a bound-box (projected on ray)
*/
-float dist_squared_ray_to_aabb(
+float dist_squared_ray_to_aabb_v3(
const struct DistRayAABB_Precalc *data,
const float bb_min[3], const float bb_max[3],
float r_point[3], float *r_depth)
@@ -753,14 +753,14 @@ float dist_squared_ray_to_aabb(
r_point, r_depth);
}
-float dist_squared_to_ray_to_aabb_simple(
+float dist_squared_ray_to_aabb_v3_simple(
const float ray_origin[3], const float ray_direction[3],
const float bbmin[3], const float bbmax[3],
float r_point[3], float *r_depth)
{
struct DistRayAABB_Precalc data;
- dist_squared_ray_to_aabb_precalc(&data, ray_origin, ray_direction);
- return dist_squared_ray_to_aabb(&data, bbmin, bbmax, r_point, r_depth);
+ dist_squared_ray_to_aabb_v3_precalc(&data, ray_origin, ray_direction);
+ return dist_squared_ray_to_aabb_v3(&data, bbmin, bbmax, r_point,
r_depth);
}
/** \} */
@@ -40
@@ Diff output truncated at 10240 characters. @@
_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs