code cleanup: use const for passing vectors

This commit is contained in:
Campbell Barton 2012-07-11 12:42:02 +00:00
parent 7620c27554
commit 81829f5221
4 changed files with 11 additions and 7 deletions

@ -104,7 +104,7 @@ int BLI_bvhtree_find_nearest(BVHTree *tree, const float co[3], BVHTreeNearest *n
int BLI_bvhtree_ray_cast(BVHTree *tree, const float co[3], const float *dir, float radius, BVHTreeRayHit *hit, BVHTree_RayCastCallback callback, void *userdata);
float BLI_bvhtree_bb_raycast(float *bv, const float light_start[3], const float light_end[3], float pos[3]);
float BLI_bvhtree_bb_raycast(const float *bv, const float light_start[3], const float light_end[3], float pos[3]);
/* range query */
int BLI_bvhtree_range_query(BVHTree *tree, const float co[3], float radius, BVHTree_RangeQuery callback, void *userdata);

@ -1343,7 +1343,7 @@ int BLI_bvhtree_find_nearest(BVHTree *tree, const float co[3], BVHTreeNearest *n
/* Determines the distance that the ray must travel to hit the bounding volume of the given node */
static float ray_nearest_hit(BVHRayCastData *data, float *bv)
static float ray_nearest_hit(BVHRayCastData *data, const float *bv)
{
int i;
@ -1521,7 +1521,7 @@ int BLI_bvhtree_ray_cast(BVHTree *tree, const float co[3], const float dir[3], f
return data.hit.index;
}
float BLI_bvhtree_bb_raycast(float *bv, const float light_start[3], const float light_end[3], float pos[3])
float BLI_bvhtree_bb_raycast(const float *bv, const float light_start[3], const float light_end[3], float pos[3])
{
BVHRayCastData data;
float dist = 0.0;

@ -583,7 +583,7 @@ static int project_bucket_offset_safe(const ProjPaintState *ps, const float proj
}
/* still use 2D X,Y space but this works for verts transformed by a perspective matrix, using their 4th component as a weight */
static void barycentric_weights_v2_persp(float v1[4], float v2[4], float v3[4], float co[2], float w[3])
static void barycentric_weights_v2_persp(const float v1[4], const float v2[4], const float v3[4], const float co[2], float w[3])
{
float wtot_inv, wtot;
@ -603,13 +603,17 @@ static void barycentric_weights_v2_persp(float v1[4], float v2[4], float v3[4],
w[0] = w[1] = w[2] = 1.0f / 3.0f;
}
static float VecZDepthOrtho(float pt[2], float v1[3], float v2[3], float v3[3], float w[3])
static float VecZDepthOrtho(const float pt[2],
const float v1[3], const float v2[3], const float v3[3],
float w[3])
{
barycentric_weights_v2(v1, v2, v3, pt, w);
return (v1[2] * w[0]) + (v2[2] * w[1]) + (v3[2] * w[2]);
}
static float VecZDepthPersp(float pt[2], float v1[4], float v2[4], float v3[4], float w[3])
static float VecZDepthPersp(const float pt[2],
const float v1[4], const float v2[4], const float v3[4],
float w[3])
{
float wtot_inv, wtot;
float w_tmp[3];

@ -1618,7 +1618,7 @@ static void execute_scene(Scene *blscene, IK_Scene *ikscene, bItasc *ikparam, fl
timestep = sts / 1000.0;
}
}
// don't cache if we are reiterating because we don't want to distroy the cache unnecessarily
// don't cache if we are reiterating because we don't want to destroy the cache unnecessarily
ikscene->scene->update(timestamp, timestep, numstep, false, !reiterate, simulation);
if (reiterate) {
// how many times do we reiterate?