code cleanup: spelling labda -> lambda
authorCampbell Barton <ideasman42@gmail.com>
Tue, 11 Dec 2012 14:18:37 +0000 (14:18 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 11 Dec 2012 14:18:37 +0000 (14:18 +0000)
source/blender/blenkernel/intern/curve.c
source/blender/blenlib/intern/math_geom.c
source/blender/blenlib/intern/rct.c
source/blender/editors/armature/meshlaplacian.c
source/blender/editors/mesh/editmesh_knife.c
source/blender/editors/mesh/editmesh_select.c
source/blender/render/intern/raytrace/rayobject_octree.cpp
source/blender/render/intern/source/envmap.c
source/blender/render/intern/source/shadbuf.c
source/blender/render/intern/source/zbuf.c

index 754a4fb..4b4ca1c 100644 (file)
@@ -68,7 +68,7 @@
 /* local */
 static int cu_isectLL(const float v1[3], const float v2[3], const float v3[3], const float v4[3],
                       short cox, short coy,
-                      float *labda, float *mu, float vec[3]);
+                      float *lambda, float *mu, float vec[3]);
 
 void BKE_curve_unlink(Curve *cu)
 {
@@ -1615,7 +1615,7 @@ void BKE_curve_bevel_make(Scene *scene, Object *ob, ListBase *disp, int forRende
 
 static int cu_isectLL(const float v1[3], const float v2[3], const float v3[3], const float v4[3],
                       short cox, short coy,
-                      float *labda, float *mu, float vec[3])
+                      float *lambda, float *mu, float vec[3])
 {
        /* return:
         * -1: collinear
@@ -1629,22 +1629,22 @@ static int cu_isectLL(const float v1[3], const float v2[3], const float v3[3], c
        if (deler == 0.0f)
                return -1;
 
-       *labda = (v1[coy] - v3[coy]) * (v3[cox] - v4[cox]) - (v1[cox] - v3[cox]) * (v3[coy] - v4[coy]);
-       *labda = -(*labda / deler);
+       *lambda = (v1[coy] - v3[coy]) * (v3[cox] - v4[cox]) - (v1[cox] - v3[cox]) * (v3[coy] - v4[coy]);
+       *lambda = -(*lambda / deler);
 
        deler = v3[coy] - v4[coy];
        if (deler == 0) {
                deler = v3[cox] - v4[cox];
-               *mu = -(*labda * (v2[cox] - v1[cox]) + v1[cox] - v3[cox]) / deler;
+               *mu = -(*lambda * (v2[cox] - v1[cox]) + v1[cox] - v3[cox]) / deler;
        }
        else {
-               *mu = -(*labda * (v2[coy] - v1[coy]) + v1[coy] - v3[coy]) / deler;
+               *mu = -(*lambda * (v2[coy] - v1[coy]) + v1[coy] - v3[coy]) / deler;
        }
-       vec[cox] = *labda * (v2[cox] - v1[cox]) + v1[cox];
-       vec[coy] = *labda * (v2[coy] - v1[coy]) + v1[coy];
+       vec[cox] = *lambda * (v2[cox] - v1[cox]) + v1[cox];
+       vec[coy] = *lambda * (v2[coy] - v1[coy]) + v1[coy];
 
-       if (*labda >= 0.0f && *labda <= 1.0f && *mu >= 0.0f && *mu <= 1.0f) {
-               if (*labda == 0.0f || *labda == 1.0f || *mu == 0.0f || *mu == 1.0f)
+       if (*lambda >= 0.0f && *lambda <= 1.0f && *mu >= 0.0f && *mu <= 1.0f) {
+               if (*lambda == 0.0f || *lambda == 1.0f || *mu == 0.0f || *mu == 1.0f)
                        return 1;
                return 2;
        }
@@ -1654,7 +1654,7 @@ static int cu_isectLL(const float v1[3], const float v2[3], const float v3[3], c
 
 static short bevelinside(BevList *bl1, BevList *bl2)
 {
-       /* is bl2 INSIDE bl1 ? with left-right method and "labda's" */
+       /* is bl2 INSIDE bl1 ? with left-right method and "lambda's" */
        /* returns '1' if correct hole  */
        BevPoint *bevp, *prevbevp;
        float min, max, vec[3], hvec1[3], hvec2[3], lab, mu;
index 74abd7e..6938cde 100644 (file)
@@ -180,7 +180,7 @@ float dist_to_line_v2(const float p[2], const float l1[2], const float l2[2])
 /* distance p to line-piece v1-v2 */
 float dist_squared_to_line_segment_v2(const float p[2], const float l1[2], const float l2[2])
 {
-       float labda, rc[2], pt[2], len;
+       float lambda, rc[2], pt[2], len;
 
        rc[0] = l2[0] - l1[0];
        rc[1] = l2[1] - l1[1];
@@ -191,18 +191,18 @@ float dist_squared_to_line_segment_v2(const float p[2], const float l1[2], const
                return (rc[0] * rc[0] + rc[1] * rc[1]);
        }
 
-       labda = (rc[0] * (p[0] - l1[0]) + rc[1] * (p[1] - l1[1])) / len;
-       if (labda <= 0.0f) {
+       lambda = (rc[0] * (p[0] - l1[0]) + rc[1] * (p[1] - l1[1])) / len;
+       if (lambda <= 0.0f) {
                pt[0] = l1[0];
                pt[1] = l1[1];
        }
-       else if (labda >= 1.0f) {
+       else if (lambda >= 1.0f) {
                pt[0] = l2[0];
                pt[1] = l2[1];
        }
        else {
-               pt[0] = labda * rc[0] + l1[0];
-               pt[1] = labda * rc[1] + l1[1];
+               pt[0] = lambda * rc[0] + l1[0];
+               pt[1] = lambda * rc[1] + l1[1];
        }
 
        rc[0] = pt[0] - p[0];
@@ -301,17 +301,17 @@ float dist_to_line_segment_v3(const float v1[3], const float v2[3], const float
 /* intersect Line-Line, shorts */
 int isect_line_line_v2_int(const int v1[2], const int v2[2], const int v3[2], const int v4[2])
 {
-       float div, labda, mu;
+       float div, lambda, mu;
 
        div = (float)((v2[0] - v1[0]) * (v4[1] - v3[1]) - (v2[1] - v1[1]) * (v4[0] - v3[0]));
        if (div == 0.0f) return ISECT_LINE_LINE_COLINEAR;
 
-       labda = ((float)(v1[1] - v3[1]) * (v4[0] - v3[0]) - (v1[0] - v3[0]) * (v4[1] - v3[1])) / div;
+       lambda = ((float)(v1[1] - v3[1]) * (v4[0] - v3[0]) - (v1[0] - v3[0]) * (v4[1] - v3[1])) / div;
 
        mu = ((float)(v1[1] - v3[1]) * (v2[0] - v1[0]) - (v1[0] - v3[0]) * (v2[1] - v1[1])) / div;
 
-       if (labda >= 0.0f && labda <= 1.0f && mu >= 0.0f && mu <= 1.0f) {
-               if (labda == 0.0f || labda == 1.0f || mu == 0.0f || mu == 1.0f) return ISECT_LINE_LINE_EXACT;
+       if (lambda >= 0.0f && lambda <= 1.0f && mu >= 0.0f && mu <= 1.0f) {
+               if (lambda == 0.0f || lambda == 1.0f || mu == 0.0f || mu == 1.0f) return ISECT_LINE_LINE_EXACT;
                return ISECT_LINE_LINE_CROSS;
        }
        return ISECT_LINE_LINE_NONE;
@@ -335,17 +335,17 @@ int isect_line_line_v2_point(const float v1[2], const float v2[2], const float v
 /* intersect Line-Line, floats */
 int isect_line_line_v2(const float v1[2], const float v2[2], const float v3[2], const float v4[2])
 {
-       float div, labda, mu;
+       float div, lambda, mu;
 
        div = (v2[0] - v1[0]) * (v4[1] - v3[1]) - (v2[1] - v1[1]) * (v4[0] - v3[0]);
        if (div == 0.0f) return ISECT_LINE_LINE_COLINEAR;
 
-       labda = ((float)(v1[1] - v3[1]) * (v4[0] - v3[0]) - (v1[0] - v3[0]) * (v4[1] - v3[1])) / div;
+       lambda = ((float)(v1[1] - v3[1]) * (v4[0] - v3[0]) - (v1[0] - v3[0]) * (v4[1] - v3[1])) / div;
 
        mu = ((float)(v1[1] - v3[1]) * (v2[0] - v1[0]) - (v1[0] - v3[0]) * (v2[1] - v1[1])) / div;
 
-       if (labda >= 0.0f && labda <= 1.0f && mu >= 0.0f && mu <= 1.0f) {
-               if (labda == 0.0f || labda == 1.0f || mu == 0.0f || mu == 1.0f) return ISECT_LINE_LINE_EXACT;
+       if (lambda >= 0.0f && lambda <= 1.0f && mu >= 0.0f && mu <= 1.0f) {
+               if (lambda == 0.0f || lambda == 1.0f || mu == 0.0f || mu == 1.0f) return ISECT_LINE_LINE_EXACT;
                return ISECT_LINE_LINE_CROSS;
        }
        return ISECT_LINE_LINE_NONE;
index ee073d5..fb767f5 100644 (file)
@@ -109,9 +109,9 @@ static int isect_segments_i(const int v1[2], const int v2[2], const int v3[2], c
                return 1; /* co-linear */
        }
        else {
-               const double labda = (double)((v1[1] - v3[1]) * (v4[0] - v3[0]) - (v1[0] - v3[0]) * (v4[1] - v3[1])) / div;
+               const double lambda = (double)((v1[1] - v3[1]) * (v4[0] - v3[0]) - (v1[0] - v3[0]) * (v4[1] - v3[1])) / div;
                const double mu    = (double)((v1[1] - v3[1]) * (v2[0] - v1[0]) - (v1[0] - v3[0]) * (v2[1] - v1[1])) / div;
-               return (labda >= 0.0 && labda <= 1.0 && mu >= 0.0 && mu <= 1.0);
+               return (lambda >= 0.0 && lambda <= 1.0 && mu >= 0.0 && mu <= 1.0);
        }
 }
 static int isect_segments_fl(const float v1[2], const float v2[2], const float v3[2], const float v4[2])
@@ -121,9 +121,9 @@ static int isect_segments_fl(const float v1[2], const float v2[2], const float v
                return 1; /* co-linear */
        }
        else {
-               const double labda = (double)((v1[1] - v3[1]) * (v4[0] - v3[0]) - (v1[0] - v3[0]) * (v4[1] - v3[1])) / div;
+               const double lambda = (double)((v1[1] - v3[1]) * (v4[0] - v3[0]) - (v1[0] - v3[0]) * (v4[1] - v3[1])) / div;
                const double mu    = (double)((v1[1] - v3[1]) * (v2[0] - v1[0]) - (v1[0] - v3[0]) * (v2[1] - v1[1])) / div;
-               return (labda >= 0.0 && labda <= 1.0 && mu >= 0.0 && mu <= 1.0);
+               return (lambda >= 0.0 && lambda <= 1.0 && mu >= 0.0 && mu <= 1.0);
        }
 }
 
index 9152ea8..1d97542 100644 (file)
@@ -1120,7 +1120,7 @@ typedef struct MeshDeformBind {
 typedef struct MeshDeformIsect {
        float start[3];
        float vec[3];
-       float labda;
+       float lambda;
 
        void *face;
        int isect;
@@ -1227,7 +1227,7 @@ static void harmonic_ray_callback(void *userdata, int index, const BVHTreeRay *r
                copy_v3_v3(hit->co, co);
                
                isec->isect = (dot_v3v3(no, ray->direction) <= 0.0f);
-               isec->labda = dist;
+               isec->lambda = dist;
                isec->face = mf;
        }
 }
@@ -1245,7 +1245,7 @@ static MDefBoundIsect *meshdeform_ray_tree_intersect(MeshDeformBind *mdb, float
 
        /* setup isec */
        memset(&isect_mdef, 0, sizeof(isect_mdef));
-       isect_mdef.labda = 1e10f;
+       isect_mdef.lambda = 1e10f;
 
        add_v3_v3v3(isect_mdef.start, co1, epsilon);
        add_v3_v3v3(end, co2, epsilon);
@@ -1256,7 +1256,7 @@ static MDefBoundIsect *meshdeform_ray_tree_intersect(MeshDeformBind *mdb, float
        if (BLI_bvhtree_ray_cast(mdb->bvhtree, isect_mdef.start, isect_mdef.vec,
                                 0.0, &hit, harmonic_ray_callback, data) != -1)
        {
-               len = isect_mdef.labda;
+               len = isect_mdef.lambda;
                isect_mdef.face = mface = mface1 + hit.index;
 
                /* create MDefBoundIsect */
index a59c491..f18168a 100644 (file)
@@ -1594,10 +1594,10 @@ static KnifeEdge *knife_find_closest_edge(KnifeTool_OpData *kcd, float p[3], flo
                        dis = dist_to_line_segment_v2(sco, kfe->v1->sco, kfe->v2->sco);
                        if (dis < curdis && dis < maxdist) {
                                if (kcd->vc.rv3d->rflag & RV3D_CLIPPING) {
-                                       float labda = line_point_factor_v2(sco, kfe->v1->sco, kfe->v2->sco);
+                                       float lambda = line_point_factor_v2(sco, kfe->v1->sco, kfe->v2->sco);
                                        float vec[3];
 
-                                       interp_v3_v3v3(vec, kfe->v1->cageco, kfe->v2->cageco, labda);
+                                       interp_v3_v3v3(vec, kfe->v1->cageco, kfe->v2->cageco, lambda);
 
                                        if (ED_view3d_clipping_test(kcd->vc.rv3d, vec, TRUE) == 0) {
                                                cure = kfe;
index 3335f03..1c9fc75 100644 (file)
@@ -464,12 +464,12 @@ static void findnearestedge__doClosest(void *userData, BMEdge *eed, const float
 
        if (distance < data->dist) {
                if (data->vc.rv3d->rflag & RV3D_CLIPPING) {
-                       float labda = line_point_factor_v2(data->mval_fl, screen_co_a, screen_co_b);
+                       float lambda = line_point_factor_v2(data->mval_fl, screen_co_a, screen_co_b);
                        float vec[3];
 
-                       vec[0] = eed->v1->co[0] + labda * (eed->v2->co[0] - eed->v1->co[0]);
-                       vec[1] = eed->v1->co[1] + labda * (eed->v2->co[1] - eed->v1->co[1]);
-                       vec[2] = eed->v1->co[2] + labda * (eed->v2->co[2] - eed->v1->co[2]);
+                       vec[0] = eed->v1->co[0] + lambda * (eed->v2->co[0] - eed->v1->co[0]);
+                       vec[1] = eed->v1->co[1] + lambda * (eed->v2->co[1] - eed->v1->co[1]);
+                       vec[2] = eed->v1->co[2] + lambda * (eed->v2->co[2] - eed->v1->co[2]);
 
                        if (ED_view3d_clipping_test(data->vc.rv3d, vec, TRUE) == 0) {
                                data->dist = distance;
index afb8fe6..7800a7d 100644 (file)
@@ -326,7 +326,7 @@ static void d2dda(Octree *oc, short b1, short b2, short c1, short c2, char *ocfa
        int ocx1, ocx2, ocy1, ocy2;
        int x, y, dx = 0, dy = 0;
        float ox1, ox2, oy1, oy2;
-       float labda, labdao, labdax, labday, ldx, ldy;
+       float lambda, lambda_o, lambda_x, lambda_y, ldx, ldy;
 
        ocx1 = rts[b1][c1];
        ocy1 = rts[b1][c2];
@@ -345,40 +345,40 @@ static void d2dda(Octree *oc, short b1, short b2, short c1, short c2, char *ocfa
 
        if (ox1 != ox2) {
                if (ox2 - ox1 > 0.0f) {
-                       labdax = (ox1 - ocx1 - 1.0f) / (ox1 - ox2);
+                       lambda_x = (ox1 - ocx1 - 1.0f) / (ox1 - ox2);
                        ldx = -1.0f / (ox1 - ox2);
                        dx = 1;
                }
                else {
-                       labdax = (ox1 - ocx1) / (ox1 - ox2);
+                       lambda_x = (ox1 - ocx1) / (ox1 - ox2);
                        ldx = 1.0f / (ox1 - ox2);
                        dx = -1;
                }
        }
        else {
-               labdax = 1.0f;
+               lambda_x = 1.0f;
                ldx = 0;
        }
 
        if (oy1 != oy2) {
                if (oy2 - oy1 > 0.0f) {
-                       labday = (oy1 - ocy1 - 1.0f) / (oy1 - oy2);
+                       lambda_y = (oy1 - ocy1 - 1.0f) / (oy1 - oy2);
                        ldy = -1.0f / (oy1 - oy2);
                        dy = 1;
                }
                else {
-                       labday = (oy1 - ocy1) / (oy1 - oy2);
+                       lambda_y = (oy1 - ocy1) / (oy1 - oy2);
                        ldy = 1.0f / (oy1 - oy2);
                        dy = -1;
                }
        }
        else {
-               labday = 1.0f;
+               lambda_y = 1.0f;
                ldy = 0;
        }
        
        x = ocx1; y = ocy1;
-       labda = MIN2(labdax, labday);
+       lambda = MIN2(lambda_x, lambda_y);
        
        while (TRUE) {
                
@@ -389,26 +389,26 @@ static void d2dda(Octree *oc, short b1, short b2, short c1, short c2, char *ocfa
                        ocface[oc->ocres * x + y] = 1;
                }
                
-               labdao = labda;
-               if (labdax == labday) {
-                       labdax += ldx;
+               lambda_o = lambda;
+               if (lambda_x == lambda_y) {
+                       lambda_x += ldx;
                        x += dx;
-                       labday += ldy;
+                       lambda_y += ldy;
                        y += dy;
                }
                else {
-                       if (labdax < labday) {
-                               labdax += ldx;
+                       if (lambda_x < lambda_y) {
+                               lambda_x += ldx;
                                x += dx;
                        }
                        else {
-                               labday += ldy;
+                               lambda_y += ldy;
                                y += dy;
                        }
                }
-               labda = MIN2(labdax, labday);
-               if (labda == labdao) break;
-               if (labda >= 1.0f) break;
+               lambda = MIN2(lambda_x, lambda_y);
+               if (lambda == lambda_o) break;
+               if (lambda >= 1.0f) break;
        }
        ocface[oc->ocres * ocx2 + ocy2] = 1;
 }
@@ -851,8 +851,8 @@ static int RE_rayobject_octree_intersect(RayObject *tree, Isect *is)
        OcVal ocval;
        float vec1[3], vec2[3], start[3], end[3];
        float u1, u2, ox1, ox2, oy1, oy2, oz1, oz2;
-       float labdao, labdax, ldx, labday, ldy, labdaz, ldz, ddalabda;
-       float olabda = 0;
+       float lambda_o, lambda_x, ldx, lambda_y, ldy, lambda_z, ldz, dda_lambda;
+       float o_lambda = 0;
        int dx, dy, dz;
        int xo, yo, zo, c1 = 0;
        int ocx1, ocx2, ocy1, ocy2, ocz1, ocz2;
@@ -871,7 +871,7 @@ static int RE_rayobject_octree_intersect(RayObject *tree, Isect *is)
        copy_v3_v3(start, is->start);
        madd_v3_v3v3fl(end, is->start, is->dir, is->dist);
        ldx = is->dir[0] * is->dist;
-       olabda = is->dist;
+       o_lambda = is->dist;
        u1 = 0.0f;
        u2 = 1.0f;
        
@@ -939,68 +939,68 @@ static int RE_rayobject_octree_intersect(RayObject *tree, Isect *is)
                float dox, doy, doz;
                int eqval;
                
-               /* calc labda en ld */
+               /* calc lambda en ld */
                dox = ox1 - ox2;
                doy = oy1 - oy2;
                doz = oz1 - oz2;
 
                if (dox < -FLT_EPSILON) {
                        ldx = -1.0f / dox;
-                       labdax = (ocx1 - ox1 + 1.0f) * ldx;
+                       lambda_x = (ocx1 - ox1 + 1.0f) * ldx;
                        dx = 1;
                }
                else if (dox > FLT_EPSILON) {
                        ldx = 1.0f / dox;
-                       labdax = (ox1 - ocx1) * ldx;
+                       lambda_x = (ox1 - ocx1) * ldx;
                        dx = -1;
                }
                else {
-                       labdax = 1.0f;
+                       lambda_x = 1.0f;
                        ldx = 0;
                        dx = 0;
                }
 
                if (doy < -FLT_EPSILON) {
                        ldy = -1.0f / doy;
-                       labday = (ocy1 - oy1 + 1.0f) * ldy;
+                       lambda_y = (ocy1 - oy1 + 1.0f) * ldy;
                        dy = 1;
                }
                else if (doy > FLT_EPSILON) {
                        ldy = 1.0f / doy;
-                       labday = (oy1 - ocy1) * ldy;
+                       lambda_y = (oy1 - ocy1) * ldy;
                        dy = -1;
                }
                else {
-                       labday = 1.0f;
+                       lambda_y = 1.0f;
                        ldy = 0;
                        dy = 0;
                }
 
                if (doz < -FLT_EPSILON) {
                        ldz = -1.0f / doz;
-                       labdaz = (ocz1 - oz1 + 1.0f) * ldz;
+                       lambda_z = (ocz1 - oz1 + 1.0f) * ldz;
                        dz = 1;
                }
                else if (doz > FLT_EPSILON) {
                        ldz = 1.0f / doz;
-                       labdaz = (oz1 - ocz1) * ldz;
+                       lambda_z = (oz1 - ocz1) * ldz;
                        dz = -1;
                }
                else {
-                       labdaz = 1.0f;
+                       lambda_z = 1.0f;
                        ldz = 0;
                        dz = 0;
                }
                
                xo = ocx1; yo = ocy1; zo = ocz1;
-               ddalabda = MIN3(labdax, labday, labdaz);
+               dda_lambda = MIN3(lambda_x, lambda_y, lambda_z);
                
                vec2[0] = ox1;
                vec2[1] = oy1;
                vec2[2] = oz1;
                
                /* this loop has been constructed to make sure the first and last node of ray
-                * are always included, even when ddalabda==1.0f or larger */
+                * are always included, even when dda_lambda==1.0f or larger */
 
                while (TRUE) {
 
@@ -1010,83 +1010,83 @@ static int RE_rayobject_octree_intersect(RayObject *tree, Isect *is)
                                /* calculate ray intersection with octree node */
                                copy_v3_v3(vec1, vec2);
                                // dox, y, z is negative
-                               vec2[0] = ox1 - ddalabda * dox;
-                               vec2[1] = oy1 - ddalabda * doy;
-                               vec2[2] = oz1 - ddalabda * doz;
+                               vec2[0] = ox1 - dda_lambda * dox;
+                               vec2[1] = oy1 - dda_lambda * doy;
+                               vec2[2] = oz1 - dda_lambda * doz;
                                calc_ocval_ray(&ocval, (float)xo, (float)yo, (float)zo, vec1, vec2);
 
-                               //is->dist = (u1+ddalabda*(u2-u1))*olabda;
+                               //is->dist = (u1+dda_lambda*(u2-u1))*o_lambda;
                                if (testnode(oc, is, no, ocval) )
                                        found = 1;
 
-                               if (is->dist < (u1 + ddalabda * (u2 - u1)) * olabda)
+                               if (is->dist < (u1 + dda_lambda * (u2 - u1)) * o_lambda)
                                        return found;
                        }
 
 
-                       labdao = ddalabda;
+                       lambda_o = dda_lambda;
                        
                        /* traversing octree nodes need careful detection of smallest values, with proper
-                        * exceptions for equal labdas */
-                       eqval = (labdax == labday);
-                       if (labday == labdaz) eqval += 2;
-                       if (labdax == labdaz) eqval += 4;
+                        * exceptions for equal lambdas */
+                       eqval = (lambda_x == lambda_y);
+                       if (lambda_y == lambda_z) eqval += 2;
+                       if (lambda_x == lambda_z) eqval += 4;
 
                        if (eqval) {    // only 4 cases exist!
                                if (eqval == 7) { // x=y=z
-                                       xo += dx; labdax += ldx;
-                                       yo += dy; labday += ldy;
-                                       zo += dz; labdaz += ldz;
+                                       xo += dx; lambda_x += ldx;
+                                       yo += dy; lambda_y += ldy;
+                                       zo += dz; lambda_z += ldz;
                                }
                                else if (eqval == 1) { // x=y
-                                       if (labday < labdaz) {
-                                               xo += dx; labdax += ldx;
-                                               yo += dy; labday += ldy;
+                                       if (lambda_y < lambda_z) {
+                                               xo += dx; lambda_x += ldx;
+                                               yo += dy; lambda_y += ldy;
                                        }
                                        else {
-                                               zo += dz; labdaz += ldz;
+                                               zo += dz; lambda_z += ldz;
                                        }
                                }
                                else if (eqval == 2) { // y=z
-                                       if (labdax < labday) {
-                                               xo += dx; labdax += ldx;
+                                       if (lambda_x < lambda_y) {
+                                               xo += dx; lambda_x += ldx;
                                        }
                                        else {
-                                               yo += dy; labday += ldy;
-                                               zo += dz; labdaz += ldz;
+                                               yo += dy; lambda_y += ldy;
+                                               zo += dz; lambda_z += ldz;
                                        }
                                }
                                else { // x=z
-                                       if (labday < labdax) {
-                                               yo += dy; labday += ldy;
+                                       if (lambda_y < lambda_x) {
+                                               yo += dy; lambda_y += ldy;
                                        }
                                        else {
-                                               xo += dx; labdax += ldx;
-                                               zo += dz; labdaz += ldz;
+                                               xo += dx; lambda_x += ldx;
+                                               zo += dz; lambda_z += ldz;
                                        }
                                }
                        }
                        else {  // all three different, just three cases exist
-                               eqval = (labdax < labday);
-                               if (labday < labdaz) eqval += 2;
-                               if (labdax < labdaz) eqval += 4;
+                               eqval = (lambda_x < lambda_y);
+                               if (lambda_y < lambda_z) eqval += 2;
+                               if (lambda_x < lambda_z) eqval += 4;
                                
                                if (eqval == 7 || eqval == 5) { // x smallest
-                                       xo += dx; labdax += ldx;
+                                       xo += dx; lambda_x += ldx;
                                }
                                else if (eqval == 2 || eqval == 6) { // y smallest
-                                       yo += dy; labday += ldy;
+                                       yo += dy; lambda_y += ldy;
                                }
                                else { // z smallest
-                                       zo += dz; labdaz += ldz;
+                                       zo += dz; lambda_z += ldz;
                                }
                                
                        }
 
-                       ddalabda = MIN3(labdax, labday, labdaz);
-                       if (ddalabda == labdao) break;
+                       dda_lambda = MIN3(lambda_x, lambda_y, lambda_z);
+                       if (dda_lambda == lambda_o) break;
                        /* to make sure the last node is always checked */
-                       if (labdao >= 1.0f) break;
+                       if (lambda_o >= 1.0f) break;
                }
        }
        
index c3126e5..e04035e 100644 (file)
@@ -587,53 +587,53 @@ void make_envmaps(Render *re)
 
 static int envcube_isect(EnvMap *env, const float vec[3], float answ[2])
 {
-       float labda;
+       float lambda;
        int face;
        
        if (env->type == ENV_PLANE) {
                face = 1;
                
-               labda = 1.0f / vec[2];
-               answ[0] = env->viewscale * labda * vec[0];
-               answ[1] = -env->viewscale * labda * vec[1];
+               lambda = 1.0f / vec[2];
+               answ[0] = env->viewscale * lambda * vec[0];
+               answ[1] = -env->viewscale * lambda * vec[1];
        }
        else {
                /* which face */
                if (vec[2] <= -fabsf(vec[0]) && vec[2] <= -fabsf(vec[1]) ) {
                        face = 0;
-                       labda = -1.0f / vec[2];
-                       answ[0] = labda * vec[0];
-                       answ[1] = labda * vec[1];
+                       lambda = -1.0f / vec[2];
+                       answ[0] = lambda * vec[0];
+                       answ[1] = lambda * vec[1];
                }
                else if (vec[2] >= fabsf(vec[0]) && vec[2] >= fabsf(vec[1])) {
                        face = 1;
-                       labda = 1.0f / vec[2];
-                       answ[0] = labda * vec[0];
-                       answ[1] = -labda * vec[1];
+                       lambda = 1.0f / vec[2];
+                       answ[0] = lambda * vec[0];
+                       answ[1] = -lambda * vec[1];
                }
                else if (vec[1] >= fabsf(vec[0])) {
                        face = 2;
-                       labda = 1.0f / vec[1];
-                       answ[0] = labda * vec[0];
-                       answ[1] = labda * vec[2];
+                       lambda = 1.0f / vec[1];
+                       answ[0] = lambda * vec[0];
+                       answ[1] = lambda * vec[2];
                }
                else if (vec[0] <= -fabsf(vec[1])) {
                        face = 3;
-                       labda = -1.0f / vec[0];
-                       answ[0] = labda * vec[1];
-                       answ[1] = labda * vec[2];
+                       lambda = -1.0f / vec[0];
+                       answ[0] = lambda * vec[1];
+                       answ[1] = lambda * vec[2];
                }
                else if (vec[1] <= -fabsf(vec[0])) {
                        face = 4;
-                       labda = -1.0f / vec[1];
-                       answ[0] = -labda * vec[0];
-                       answ[1] = labda * vec[2];
+                       lambda = -1.0f / vec[1];
+                       answ[0] = -lambda * vec[0];
+                       answ[1] = lambda * vec[2];
                }
                else {
                        face = 5;
-                       labda = 1.0f / vec[0];
-                       answ[0] = -labda * vec[1];
-                       answ[1] = labda * vec[2];
+                       lambda = 1.0f / vec[0];
+                       answ[0] = -lambda * vec[1];
+                       answ[1] = lambda * vec[2];
                }
        }
        
index a7f6b40..078c11a 100644 (file)
@@ -1302,7 +1302,7 @@ float shadow_halo(LampRen *lar, const float p1[3], const float p2[3])
        ShadBuf *shb= lar->shb;
        ShadSampleBuf *shsample;
        float co[4], siz;
-       float labda, labdao, labdax, labday, ldx, ldy;
+       float lambda, lambda_o, lambda_x, lambda_y, ldx, ldy;
        float zf, xf1, yf1, zf1, xf2, yf2, zf2;
        float count, lightcount;
        int x, y, z, xs1, ys1;
@@ -1336,68 +1336,68 @@ float shadow_halo(LampRen *lar, const float p1[3], const float p2[3])
 
        if (xf1 != xf2) {
                if (xf2-xf1 > 0.0f) {
-                       labdax= (xf1-xs1-1.0f)/(xf1-xf2);
+                       lambda_x= (xf1-xs1-1.0f)/(xf1-xf2);
                        ldx= -shb->shadhalostep/(xf1-xf2);
                        dx= shb->shadhalostep;
                }
                else {
-                       labdax= (xf1-xs1)/(xf1-xf2);
+                       lambda_x= (xf1-xs1)/(xf1-xf2);
                        ldx= shb->shadhalostep/(xf1-xf2);
                        dx= -shb->shadhalostep;
                }
        }
        else {
-               labdax= 1.0;
+               lambda_x= 1.0;
                ldx= 0.0;
        }
 
        if (yf1 != yf2) {
                if (yf2-yf1 > 0.0f) {
-                       labday= (yf1-ys1-1.0f)/(yf1-yf2);
+                       lambda_y= (yf1-ys1-1.0f)/(yf1-yf2);
                        ldy= -shb->shadhalostep/(yf1-yf2);
                        dy= shb->shadhalostep;
                }
                else {
-                       labday= (yf1-ys1)/(yf1-yf2);
+                       lambda_y= (yf1-ys1)/(yf1-yf2);
                        ldy= shb->shadhalostep/(yf1-yf2);
                        dy= -shb->shadhalostep;
                }
        }
        else {
-               labday= 1.0;
+               lambda_y= 1.0;
                ldy= 0.0;
        }
        
        x= xs1;
        y= ys1;
-       labda= count= lightcount= 0.0;
+       lambda= count= lightcount= 0.0;
 
 /* printf("start %x %x \n", (int)(0x7FFFFFFF*zf1), (int)(0x7FFFFFFF*zf2)); */
 
        while (1) {
-               labdao= labda;
+               lambda_o= lambda;
                
-               if (labdax==labday) {
-                       labdax+= ldx;
+               if (lambda_x==lambda_y) {
+                       lambda_x+= ldx;
                        x+= dx;
-                       labday+= ldy;
+                       lambda_y+= ldy;
                        y+= dy;
                }
                else {
-                       if (labdax<labday) {
-                               labdax+= ldx;
+                       if (lambda_x<lambda_y) {
+                               lambda_x+= ldx;
                                x+= dx;
                        }
                        else {
-                               labday+= ldy;
+                               lambda_y+= ldy;
                                y+= dy;
                        }
                }
                
-               labda = min_ff(labdax, labday);
-               if (labda==labdao || labda>=1.0f) break;
+               lambda = min_ff(lambda_x, lambda_y);
+               if (lambda==lambda_o || lambda>=1.0f) break;
                
-               zf= zf1 + labda*(zf2-zf1);
+               zf= zf1 + lambda*(zf2-zf1);
                count+= (float)shb->totbuf;
 
                if (zf<= -1.0f) lightcount += 1.0f;     /* close to the spot */
@@ -1686,21 +1686,21 @@ static int point_behind_strand(const float p[3], BSPFace *face)
                        return 1;
        }
        else {
-               float labda= ( face->rc[0]*(p[0]-face->vec1[0]) + face->rc[1]*(p[1]-face->vec1[1]) )*face->len;
+               float lambda= ( face->rc[0]*(p[0]-face->vec1[0]) + face->rc[1]*(p[1]-face->vec1[1]) )*face->len;
                
-               if (labda > -face->radline_end && labda < 1.0f+face->radline_end) {
+               if (lambda > -face->radline_end && lambda < 1.0f+face->radline_end) {
                        /* hesse for dist: */
                        //dist= (float)(fabs( (p[0]-vec2[0])*rc[1] + (p[1]-vec2[1])*rc[0])/len);
                        
-                       pt[0]= labda*face->rc[0]+face->vec1[0];
-                       pt[1]= labda*face->rc[1]+face->vec1[1];
+                       pt[0]= lambda*face->rc[0]+face->vec1[0];
+                       pt[1]= lambda*face->rc[1]+face->vec1[1];
                        
                        rc[0]= pt[0]-p[0];
                        rc[1]= pt[1]-p[1];
                        dist= (float)sqrt(rc[0]*rc[0]+ rc[1]*rc[1]);
                        
                        if (dist < face->radline) {
-                               float zval= face->vec1[2] + labda*face->rc[2];
+                               float zval= face->vec1[2] + lambda*face->rc[2];
                                if (p[2] > zval)
                                        return 1;
                        }
index c52fb84..2335725 100644 (file)
@@ -1600,8 +1600,8 @@ void zspan_scanconvert(ZSpan *zspan, void *handle, float *v1, float *v2, float *
 
 /**
  * (clip pyramid)
- * Sets labda: flag, and parametrize the clipping of vertices in
- * viewspace coordinates. labda = -1 means no clipping, labda in [0, 1] means a clipping.
+ * Sets lambda: flag, and parametrize the clipping of vertices in
+ * viewspace coordinates. lambda = -1 means no clipping, lambda in [0, 1] means a clipping.
  * Note: uses globals.
  * \param v1 start coordinate s
  * \param v2 target coordinate t
@@ -1611,13 +1611,13 @@ void zspan_scanconvert(ZSpan *zspan, void *handle, float *v1, float *v2, float *
  * \param a index for coordinate (x, y, or z)
  */
 
-static void clippyra(float *labda, float *v1, float *v2, int *b2, int *b3, int a, float clipcrop)
+static void clippyra(float *lambda, float *v1, float *v2, int *b2, int *b3, int a, float clipcrop)
 {
        float da, dw, u1=0.0, u2=1.0;
        float v13;
        
-       labda[0]= -1.0;
-       labda[1]= -1.0;
+       lambda[0]= -1.0;
+       lambda[1]= -1.0;
 
        da= v2[a]-v1[a];
        /* prob; we clip slightly larger, osa renders add 2 pixels on edges, should become variable? */
@@ -1641,16 +1641,16 @@ static void clippyra(float *labda, float *v1, float *v2, int *b2, int *b3, int a
                if (cliptestf(da, -dw, v13, -v1[a], &u1, &u2)) {
                        *b3=1;
                        if (u2<1.0f) {
-                               labda[1]= u2;
+                               lambda[1]= u2;
                                *b2=1;
                        }
-                       else labda[1]=1.0;  /* u2 */
+                       else lambda[1]=1.0;  /* u2 */
                        if (u1>0.0f) {
-                               labda[0] = u1;
+                               lambda[0] = u1;
                                *b2 = 1;
                        }
                        else {
-                               labda[0] = 0.0;
+                               lambda[0] = 0.0;
                        }
                }
        }
@@ -1658,8 +1658,8 @@ static void clippyra(float *labda, float *v1, float *v2, int *b2, int *b3, int a
 
 /**
  * (make vertex pyramide clip)
- * Checks labda and uses this to make decision about clipping the line
- * segment from v1 to v2. labda is the factor by which the vector is
+ * Checks lambda and uses this to make decision about clipping the line
+ * segment from v1 to v2. lambda is the factor by which the vector is
  * cut. ( calculate s + l * ( t - s )). The result is appended to the
  * vertex list of this face.
  * 
@@ -1671,12 +1671,12 @@ static void clippyra(float *labda, float *v1, float *v2, int *b2, int *b3, int a
  * \param clve vertex vector.
  */
 
-static void makevertpyra(float *vez, float *labda, float **trias, float *v1, float *v2, int *b1, int *clve)
+static void makevertpyra(float *vez, float *lambda, float **trias, float *v1, float *v2, int *b1, int *clve)
 {
        float l1, l2, *adr;
 
-       l1= labda[0];
-       l2= labda[1];
+       l1= lambda[0];
+       l2= lambda[1];
 
        if (l1!= -1.0f) {
                if (l1!= 0.0f) {
@@ -1847,7 +1847,7 @@ void zbuf_make_winmat(Render *re, float winmat[][4])
 
 void zbufclip(ZSpan *zspan, int obi, int zvlnr, float *f1, float *f2, float *f3, int c1, int c2, int c3)
 {
-       float *vlzp[32][3], labda[3][2];
+       float *vlzp[32][3], lambda[3][2];
        float vez[400], *trias[40];
        
        if (c1 | c2 | c3) {     /* not in middle */
@@ -1887,9 +1887,9 @@ void zbufclip(ZSpan *zspan, int obi, int zvlnr, float *f1, float *f2, float *f3,
                                                        else if (b==1) arg= 0;
                                                        else arg= 1;
                                                        
-                                                       clippyra(labda[0], vlzp[v][0], vlzp[v][1], &b2, &b3, arg, zspan->clipcrop);
-                                                       clippyra(labda[1], vlzp[v][1], vlzp[v][2], &b2, &b3, arg, zspan->clipcrop);
-                                                       clippyra(labda[2], vlzp[v][2], vlzp[v][0], &b2, &b3, arg, zspan->clipcrop);
+                                                       clippyra(lambda[0], vlzp[v][0], vlzp[v][1], &b2, &b3, arg, zspan->clipcrop);
+                                                       clippyra(lambda[1], vlzp[v][1], vlzp[v][2], &b2, &b3, arg, zspan->clipcrop);
+                                                       clippyra(lambda[2], vlzp[v][2], vlzp[v][0], &b2, &b3, arg, zspan->clipcrop);
 
                                                        if (b2==0 && b3==1) {
                                                                /* completely 'in', but we copy because of last for () loop in this section */;
@@ -1905,9 +1905,9 @@ void zbufclip(ZSpan *zspan, int obi, int zvlnr, float *f1, float *f2, float *f3,
                                                        }
                                                        else {
                                                                b1=0;
-                                                               makevertpyra(vez, labda[0], trias, vlzp[v][0], vlzp[v][1], &b1, &clve);
-                                                               makevertpyra(vez, labda[1], trias, vlzp[v][1], vlzp[v][2], &b1, &clve);
-                                                               makevertpyra(vez, labda[2], trias, vlzp[v][2], vlzp[v][0], &b1, &clve);
+                                                               makevertpyra(vez, lambda[0], trias, vlzp[v][0], vlzp[v][1], &b1, &clve);
+                                                               makevertpyra(vez, lambda[1], trias, vlzp[v][1], vlzp[v][2], &b1, &clve);
+                                                               makevertpyra(vez, lambda[2], trias, vlzp[v][2], vlzp[v][0], &b1, &clve);
 
                                                                /* after front clip done: now set clip flags */
                                                                if (b==0) {