code cleanup: replace macros VECCOPY, VECADD, VECSUB, INPR - with BLI_math funcs.
authorCampbell Barton <ideasman42@gmail.com>
Fri, 9 Mar 2012 06:04:17 +0000 (06:04 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Fri, 9 Mar 2012 06:04:17 +0000 (06:04 +0000)
added copy float/double funcs: copy_v3fl_v3db(), copy_v3db_v3fl(). 2d & 4d too.

22 files changed:
source/blender/blenkernel/intern/collision.c
source/blender/blenkernel/intern/constraint.c
source/blender/blenkernel/intern/implicit.c
source/blender/blenkernel/intern/mesh.c
source/blender/blenkernel/intern/particle.c
source/blender/blenkernel/intern/particle_system.c
source/blender/blenkernel/intern/sketch.c
source/blender/blenlib/BLI_math_vector.h
source/blender/blenlib/BLI_utildefines.h
source/blender/blenlib/intern/math_vector_inline.c
source/blender/blenlib/intern/scanfill.c
source/blender/bmesh/intern/bmesh_interp.c
source/blender/editors/armature/editarmature_generate.c
source/blender/editors/armature/reeb.c
source/blender/editors/mesh/meshtools.c
source/blender/editors/space_view3d/view3d_draw.c
source/blender/editors/space_view3d/view3d_view.c
source/blender/editors/transform/transform_conversions.c
source/blender/editors/transform/transform_manipulator.c
source/blender/nodes/composite/nodes/node_composite_normal.c
source/blender/nodes/shader/nodes/node_shader_normal.c
source/blender/render/intern/source/shadeoutput.c

index ce0de3216d3831d66e91bb79c45eb058438a43a4..f19226cedf02a1da02a736cbde1934ba6ed57882 100644 (file)
@@ -82,10 +82,10 @@ void collision_move_object ( CollisionModifierData *collmd, float step, float pr
 
        for ( i = 0; i < collmd->numverts; i++ )
        {
-               VECSUB ( tv, collmd->xnew[i].co, collmd->x[i].co );
+               sub_v3_v3v3 ( tv, collmd->xnew[i].co, collmd->x[i].co );
                VECADDS ( collmd->current_x[i].co, collmd->x[i].co, tv, prevstep );
                VECADDS ( collmd->current_xnew[i].co, collmd->x[i].co, tv, step );
-               VECSUB ( collmd->current_v[i].co, collmd->current_xnew[i].co, collmd->current_x[i].co );
+               sub_v3_v3v3 ( collmd->current_v[i].co, collmd->current_xnew[i].co, collmd->current_x[i].co );
        }
 
        bvhtree_update_from_mvert ( collmd->bvhtree, collmd->mfaces, collmd->numfaces, collmd->current_x, collmd->current_xnew, collmd->numverts, 1 );
@@ -529,10 +529,10 @@ static int cloth_collision_response_static ( ClothModifierData *clmd, CollisionM
 
                collision_interpolateOnTriangle ( v2, collmd->current_v[collpair->bp1].co, collmd->current_v[collpair->bp2].co, collmd->current_v[collpair->bp3].co, u1, u2, u3 );
 
-               VECSUB ( relativeVelocity, v2, v1 );
+               sub_v3_v3v3 ( relativeVelocity, v2, v1 );
 
                // Calculate the normal component of the relative velocity (actually only the magnitude - the direction is stored in 'normal').
-               magrelVel = INPR ( relativeVelocity, collpair->normal );
+               magrelVel = dot_v3v3( relativeVelocity, collpair->normal );
 
                // printf("magrelVel: %f\n", magrelVel);
 
@@ -551,11 +551,11 @@ static int cloth_collision_response_static ( ClothModifierData *clmd, CollisionM
                        // calculate tangential velocity
                        copy_v3_v3 ( temp, collpair->normal );
                        mul_v3_fl( temp, magrelVel );
-                       VECSUB ( vrel_t_pre, relativeVelocity, temp );
+                       sub_v3_v3v3 ( vrel_t_pre, relativeVelocity, temp );
 
                        // Decrease in magnitude of relative tangential velocity due to coulomb friction
                        // in original formula "magrelVel" should be the "change of relative velocity in normal direction"
-                       magtangent = MIN2 ( clmd->coll_parms->friction * 0.01f * magrelVel, sqrtf( INPR ( vrel_t_pre,vrel_t_pre ) ) );
+                       magtangent = MIN2 ( clmd->coll_parms->friction * 0.01f * magrelVel, sqrtf( dot_v3v3( vrel_t_pre,vrel_t_pre ) ) );
 
                        // Apply friction impulse.
                        if ( magtangent > ALMOST_ZERO )
@@ -859,10 +859,10 @@ static int cloth_edge_collision_response_moving ( ClothModifierData *clmd, Colli
                VECADDFAC(v1, cloth1->verts[collpair->ap1].tv, cloth1->verts[collpair->ap2].tv, w1);
                VECADDFAC(v2, collmd->current_v[collpair->bp1].co, collmd->current_v[collpair->bp2].co, w2);
                
-               VECSUB ( relativeVelocity, v2, v1);
+               sub_v3_v3v3 ( relativeVelocity, v2, v1);
                
                // Calculate the normal component of the relative velocity (actually only the magnitude - the direction is stored in 'normal').
-               magrelVel = INPR ( relativeVelocity, collpair->normal );
+               magrelVel = dot_v3v3 ( relativeVelocity, collpair->normal );
 
                // If v_n_mag < 0 the edges are approaching each other.
                if ( magrelVel > ALMOST_ZERO )
@@ -876,13 +876,13 @@ static int cloth_edge_collision_response_moving ( ClothModifierData *clmd, Colli
                        zero_v3(pimpulse);
                        
                        // calculate tangential velocity
-                       VECCOPY ( temp, collpair->normal );
+                       copy_v3_v3 ( temp, collpair->normal );
                        mul_v3_fl( temp, magrelVel );
-                       VECSUB ( vrel_t_pre, relativeVelocity, temp );
+                       sub_v3_v3v3 ( vrel_t_pre, relativeVelocity, temp );
 
                        // Decrease in magnitude of relative tangential velocity due to coulomb friction
                        // in original formula "magrelVel" should be the "change of relative velocity in normal direction"
-                       magtangent = MIN2 ( clmd->coll_parms->friction * 0.01 * magrelVel,sqrt ( INPR ( vrel_t_pre,vrel_t_pre ) ) );
+                       magtangent = MIN2 ( clmd->coll_parms->friction * 0.01 * magrelVel,sqrt ( dot_v3v3 ( vrel_t_pre,vrel_t_pre ) ) );
 
                        // Apply friction impulse.
                        if ( magtangent > ALMOST_ZERO )
@@ -961,10 +961,10 @@ static int cloth_collision_response_moving ( ClothModifierData *clmd, CollisionM
                        // Calculate relative "velocity".
                        collision_interpolateOnTriangle ( v1, collmd->current_v[collpair->bp1].co, collmd->current_v[collpair->bp2].co, collmd->current_v[collpair->bp3].co, w1, w2, w3);
                        
-                       VECSUB ( relativeVelocity, v1, cloth1->verts[collpair->collp].tv);
+                       sub_v3_v3v3 ( relativeVelocity, v1, cloth1->verts[collpair->collp].tv);
                        
                        // Calculate the normal component of the relative velocity (actually only the magnitude - the direction is stored in 'normal').
-                       magrelVel = INPR ( relativeVelocity, collpair->normal );
+                       magrelVel = dot_v3v3 ( relativeVelocity, collpair->normal );
        
                        // If v_n_mag < 0 the edges are approaching each other.
                        if ( magrelVel > ALMOST_ZERO )
@@ -976,13 +976,13 @@ static int cloth_collision_response_moving ( ClothModifierData *clmd, CollisionM
                                float temp[3], spf;
        
                                // calculate tangential velocity
-                               VECCOPY ( temp, collpair->normal );
+                               copy_v3_v3 ( temp, collpair->normal );
                                mul_v3_fl( temp, magrelVel );
-                               VECSUB ( vrel_t_pre, relativeVelocity, temp );
+                               sub_v3_v3v3 ( vrel_t_pre, relativeVelocity, temp );
        
                                // Decrease in magnitude of relative tangential velocity due to coulomb friction
                                // in original formula "magrelVel" should be the "change of relative velocity in normal direction"
-                               magtangent = MIN2 ( clmd->coll_parms->friction * 0.01 * magrelVel,sqrt ( INPR ( vrel_t_pre,vrel_t_pre ) ) );
+                               magtangent = MIN2 ( clmd->coll_parms->friction * 0.01 * magrelVel,sqrt ( dot_v3v3 ( vrel_t_pre,vrel_t_pre ) ) );
        
                                // Apply friction impulse.
                                if ( magtangent > ALMOST_ZERO )
@@ -1027,10 +1027,10 @@ static int cloth_collision_response_moving ( ClothModifierData *clmd, CollisionM
                        // Calculate relative "velocity".
                        collision_interpolateOnTriangle ( v1, cloth1->verts[collpair->ap1].tv, cloth1->verts[collpair->ap2].tv, cloth1->verts[collpair->ap3].tv, w1, w2, w3 );
        
-                       VECSUB ( relativeVelocity, collmd->current_v[collpair->collp].co, v1);
+                       sub_v3_v3v3 ( relativeVelocity, collmd->current_v[collpair->collp].co, v1);
                        
                        // Calculate the normal component of the relative velocity (actually only the magnitude - the direction is stored in 'normal').
-                       magrelVel = INPR ( relativeVelocity, collpair->normal );
+                       magrelVel = dot_v3v3 ( relativeVelocity, collpair->normal );
        
                        // If v_n_mag < 0 the edges are approaching each other.
                        if ( magrelVel > ALMOST_ZERO )
@@ -1042,13 +1042,13 @@ static int cloth_collision_response_moving ( ClothModifierData *clmd, CollisionM
                                float temp[3], spf;
        
                                // calculate tangential velocity
-                               VECCOPY ( temp, collpair->normal );
+                               copy_v3_v3 ( temp, collpair->normal );
                                mul_v3_fl( temp, magrelVel );
-                               VECSUB ( vrel_t_pre, relativeVelocity, temp );
+                               sub_v3_v3v3 ( vrel_t_pre, relativeVelocity, temp );
        
                                // Decrease in magnitude of relative tangential velocity due to coulomb friction
                                // in original formula "magrelVel" should be the "change of relative velocity in normal direction"
-                               magtangent = MIN2 ( clmd->coll_parms->friction * 0.01 * magrelVel,sqrt ( INPR ( vrel_t_pre,vrel_t_pre ) ) );
+                               magtangent = MIN2 ( clmd->coll_parms->friction * 0.01 * magrelVel,sqrt ( dot_v3v3 ( vrel_t_pre,vrel_t_pre ) ) );
        
                                // Apply friction impulse.
                                if ( magtangent > ALMOST_ZERO )
@@ -1545,9 +1545,9 @@ static CollPair* cloth_collision ( ModifierData *md1, ModifierData *md2,
 
                        collision_interpolateOnTriangle ( v2, collmd->current_v[collpair->bp1].co, collmd->current_v[collpair->bp2].co, collmd->current_v[collpair->bp3].co, u1, u2, u3 );
 
-                       VECSUB ( relativeVelocity, v2, v1 );
+                       sub_v3_v3v3 ( relativeVelocity, v2, v1 );
 
-                       if(sqrt(INPR(relativeVelocity, relativeVelocity)) >= distance)
+                       if(sqrt(dot_v3v3(relativeVelocity, relativeVelocity)) >= distance)
                        {
                                // check for collision in the future
                                collpair->flag |= COLLISION_IN_FUTURE;
@@ -1592,10 +1592,10 @@ static int cloth_collision_response_moving( ClothModifierData *clmd, CollisionMo
 
                collision_interpolateOnTriangle ( v2, collmd->current_v[collpair->bp1].co, collmd->current_v[collpair->bp2].co, collmd->current_v[collpair->bp3].co, u1, u2, u3 );
 
-               VECSUB ( relativeVelocity, v2, v1 );
+               sub_v3_v3v3 ( relativeVelocity, v2, v1 );
 
                // Calculate the normal component of the relative velocity (actually only the magnitude - the direction is stored in 'normal').
-               magrelVel = INPR ( relativeVelocity, collpair->normal );
+               magrelVel = dot_v3v3 ( relativeVelocity, collpair->normal );
 
                // printf("magrelVel: %f\n", magrelVel);
 
@@ -1612,13 +1612,13 @@ static int cloth_collision_response_moving( ClothModifierData *clmd, CollisionMo
                        float temp[3];
 
                        // calculate tangential velocity
-                       VECCOPY ( temp, collpair->normal );
+                       copy_v3_v3 ( temp, collpair->normal );
                        mul_v3_fl( temp, magrelVel );
-                       VECSUB ( vrel_t_pre, relativeVelocity, temp );
+                       sub_v3_v3v3 ( vrel_t_pre, relativeVelocity, temp );
 
                        // Decrease in magnitude of relative tangential velocity due to coulomb friction
                        // in original formula "magrelVel" should be the "change of relative velocity in normal direction"
-                       magtangent = MIN2 ( clmd->coll_parms->friction * 0.01 * magrelVel,sqrt ( INPR ( vrel_t_pre,vrel_t_pre ) ) );
+                       magtangent = MIN2 ( clmd->coll_parms->friction * 0.01 * magrelVel,sqrt ( dot_v3v3 ( vrel_t_pre,vrel_t_pre ) ) );
 
                        // Apply friction impulse.
                        if ( magtangent > ALMOST_ZERO )
@@ -1675,9 +1675,9 @@ static int cloth_collision_response_moving( ClothModifierData *clmd, CollisionMo
 static float projectPointOntoLine(float *p, float *a, float *b) 
 {
        float ba[3], pa[3];
-       VECSUB(ba, b, a);
-       VECSUB(pa, p, a);
-       return INPR(pa, ba) / INPR(ba, ba);
+       sub_v3_v3v3(ba, b, a);
+       sub_v3_v3v3(pa, p, a);
+       return dot_v3v3(pa, ba) / dot_v3v3(ba, ba);
 }
 
 static void calculateEENormal(float *np1, float *np2, float *np3, float *np4,float *out_normal) 
@@ -1685,8 +1685,8 @@ static void calculateEENormal(float *np1, float *np2, float *np3, float *np4,flo
        float line1[3], line2[3];
        float length;
 
-       VECSUB(line1, np2, np1);
-       VECSUB(line2, np3, np1);
+       sub_v3_v3v3(line1, np2, np1);
+       sub_v3_v3v3(line2, np3, np1);
 
        // printf("l1: %f, l1: %f, l2: %f, l2: %f\n", line1[0], line1[1], line2[0], line2[1]);
 
@@ -1697,7 +1697,7 @@ static void calculateEENormal(float *np1, float *np2, float *np3, float *np4,flo
        length = normalize_v3(out_normal);
        if (length <= FLT_EPSILON)
        { // lines are collinear
-               VECSUB(out_normal, np2, np1);
+               sub_v3_v3v3(out_normal, np2, np1);
                normalize_v3(out_normal);
        }
 }
@@ -1708,19 +1708,19 @@ static void findClosestPointsEE(float *x1, float *x2, float *x3, float *x4, floa
        
        double a, b, c, e, f; 
 
-       VECSUB(temp, x2, x1);
-       a = INPR(temp, temp);
+       sub_v3_v3v3(temp, x2, x1);
+       a = dot_v3v3(temp, temp);
 
-       VECSUB(temp2, x4, x3);
-       b = -INPR(temp, temp2);
+       sub_v3_v3v3(temp2, x4, x3);
+       b = -dot_v3v3(temp, temp2);
 
-       c = INPR(temp2, temp2);
+       c = dot_v3v3(temp2, temp2);
 
-       VECSUB(temp2, x3, x1);
-       e = INPR(temp, temp2);
+       sub_v3_v3v3(temp2, x3, x1);
+       e = dot_v3v3(temp, temp2);
 
-       VECSUB(temp, x4, x3);
-       f = -INPR(temp, temp2);
+       sub_v3_v3v3(temp, x4, x3);
+       f = -dot_v3v3(temp, temp2);
 
        *w1 = (e * c - b * f) / (a * c - b * b);
        *w2 = (f - b * *w1) / c;
@@ -1735,11 +1735,11 @@ static float edgedge_distance(float np11[3], float np12[3], float np21[3], float
        float temp[3], temp2[3];
        float dist_a1, dist_a2;
        
-       VECSUB(line1, np12, np11);
-       VECSUB(line2, np22, np21);
+       sub_v3_v3v3(line1, np12, np11);
+       sub_v3_v3v3(line2, np22, np21);
 
        cross_v3_v3v3(cross, line1, line2);
-       length = INPR(cross, cross);
+       length = dot_v3v3(cross, cross);
 
        if (length < FLT_EPSILON) 
        {
@@ -1748,11 +1748,11 @@ static float edgedge_distance(float np11[3], float np12[3], float np21[3], float
                {
                        *out_a1 = 0;
                        calculateEENormal(np11, np12, np21, np22, out_normal);
-                       VECSUB(temp, np22, np21);
+                       sub_v3_v3v3(temp, np22, np21);
                        mul_v3_fl(temp, *out_a2);
                        VECADD(temp2, temp, np21);
                        VECADD(temp2, temp2, np11);
-                       return INPR(temp2, temp2);
+                       return dot_v3v3(temp2, temp2);
                }
 
                CLAMP(*out_a2, 0.0, 1.0);
@@ -1764,11 +1764,11 @@ static float edgedge_distance(float np11[3], float np12[3], float np21[3], float
                                calculateEENormal(np11, np12, np21, np22, out_normal);
 
                                // return (np22 - (np11 + (np12 - np11) * out_a1)).lengthSquared();
-                               VECSUB(temp, np12, np11);
+                               sub_v3_v3v3(temp, np12, np11);
                                mul_v3_fl(temp, *out_a1);
                                VECADD(temp2, temp, np11);
-                               VECSUB(temp2, np22, temp2);
-                               return INPR(temp2, temp2);
+                               sub_v3_v3v3(temp2, np22, temp2);
+                               return dot_v3v3(temp2, temp2);
                        }
                } 
                else 
@@ -1779,11 +1779,11 @@ static float edgedge_distance(float np11[3], float np12[3], float np21[3], float
                                calculateEENormal(np11, np11, np21, np22, out_normal);
 
                                // return (np21 - (np11 + (np12 - np11) * out_a1)).lengthSquared();
-                               VECSUB(temp, np12, np11);
+                               sub_v3_v3v3(temp, np12, np11);
                                mul_v3_fl(temp, *out_a1);
                                VECADD(temp2, temp, np11);
-                               VECSUB(temp2, np21, temp2);
-                               return INPR(temp2, temp2);
+                               sub_v3_v3v3(temp2, np21, temp2);
+                               return dot_v3v3(temp2, temp2);
                        }
                }
 
@@ -1793,26 +1793,26 @@ static float edgedge_distance(float np11[3], float np12[3], float np21[3], float
                {
                        if(*out_a2 > .5)
                        {
-                               VECSUB(temp, np12, np22);
+                               sub_v3_v3v3(temp, np12, np22);
                        }
                        else
                        {
-                               VECSUB(temp, np12, np21);
+                               sub_v3_v3v3(temp, np12, np21);
                        }
                }
                else
                {
                        if(*out_a2 > .5)
                        {
-                               VECSUB(temp, np11, np22);
+                               sub_v3_v3v3(temp, np11, np22);
                        }
                        else
                        {
-                               VECSUB(temp, np11, np21);
+                               sub_v3_v3v3(temp, np11, np21);
                        }
                }
 
-               return INPR(temp, temp);
+               return dot_v3v3(temp, temp);
        }
        else
        {
@@ -1827,18 +1827,18 @@ static float edgedge_distance(float np11[3], float np12[3], float np21[3], float
                        float p1[3], p2[3];
                        
                        // p1= np11 + (np12 - np11) * out_a1;
-                       VECSUB(temp, np12, np11);
+                       sub_v3_v3v3(temp, np12, np11);
                        mul_v3_fl(temp, *out_a1);
                        VECADD(p1, np11, temp);
                        
                        // p2 = np21 + (np22 - np21) * out_a2;
-                       VECSUB(temp, np22, np21);
+                       sub_v3_v3v3(temp, np22, np21);
                        mul_v3_fl(temp, *out_a2);
                        VECADD(p2, np21, temp);
 
                        calculateEENormal(np11, np12, np21, np22, out_normal);
-                       VECSUB(temp, p1, p2);
-                       return INPR(temp, temp);
+                       sub_v3_v3v3(temp, p1, p2);
+                       return dot_v3v3(temp, temp);
                }
 
                
@@ -1858,7 +1858,7 @@ static float edgedge_distance(float np11[3], float np12[3], float np21[3], float
                        float p1[3];
 
                        // p1 = np11 + (np12 - np11) * out_a1;
-                       VECSUB(temp, np12, np11);
+                       sub_v3_v3v3(temp, np12, np11);
                        mul_v3_fl(temp, *out_a1);
                        VECADD(p1, np11, temp);
 
@@ -1868,11 +1868,11 @@ static float edgedge_distance(float np11[3], float np12[3], float np21[3], float
                        calculateEENormal(np11, np12, np21, np22, out_normal);
 
                        // return (p1 - (np21 + (np22 - np21) * out_a2)).lengthSquared();
-                       VECSUB(temp, np22, np21);
+                       sub_v3_v3v3(temp, np22, np21);
                        mul_v3_fl(temp, *out_a2);
                        VECADD(temp, temp, np21);
-                       VECSUB(temp, p1, temp);
-                       return INPR(temp, temp);
+                       sub_v3_v3v3(temp, p1, temp);
+                       return dot_v3v3(temp, temp);
                } 
                else 
                {       
@@ -1880,7 +1880,7 @@ static float edgedge_distance(float np11[3], float np12[3], float np21[3], float
                        float p2[3];
                        
                        // p2 = np21 + (np22 - np21) * out_a2;
-                       VECSUB(temp, np22, np21);
+                       sub_v3_v3v3(temp, np22, np21);
                        mul_v3_fl(temp, *out_a2);
                        VECADD(p2, np21, temp);
 
@@ -1890,11 +1890,11 @@ static float edgedge_distance(float np11[3], float np12[3], float np21[3], float
                        calculateEENormal(np11, np12, np21, np22, out_normal);
                        
                        // return ((np11 + (np12 - np11) * out_a1) - p2).lengthSquared();
-                       VECSUB(temp, np12, np11);
+                       sub_v3_v3v3(temp, np12, np11);
                        mul_v3_fl(temp, *out_a1);
                        VECADD(temp, temp, np11);
-                       VECSUB(temp, temp, p2);
-                       return INPR(temp, temp);
+                       sub_v3_v3v3(temp, temp, p2);
+                       return dot_v3v3(temp, temp);
                }
        }
        
@@ -2006,14 +2006,14 @@ static int cloth_collision_moving_edges ( ClothModifierData *clmd, CollisionModi
                // if ( !cloth_are_edges_adjacent ( clmd, collmd, &edgecollpair ) )
                {
                        // always put coll points in p21/p22
-                       VECSUB ( x1, verts1[edgecollpair.p12].txold, verts1[edgecollpair.p11].txold );
-                       VECSUB ( v1, verts1[edgecollpair.p12].tv, verts1[edgecollpair.p11].tv );
+                       sub_v3_v3v3 ( x1, verts1[edgecollpair.p12].txold, verts1[edgecollpair.p11].txold );
+                       sub_v3_v3v3 ( v1, verts1[edgecollpair.p12].tv, verts1[edgecollpair.p11].tv );
 
-                       VECSUB ( x2, verts2[edgecollpair.p21].co, verts1[edgecollpair.p11].txold );
-                       VECSUB ( v2, velocity2[edgecollpair.p21].co, verts1[edgecollpair.p11].tv );
+                       sub_v3_v3v3 ( x2, verts2[edgecollpair.p21].co, verts1[edgecollpair.p11].txold );
+                       sub_v3_v3v3 ( v2, velocity2[edgecollpair.p21].co, verts1[edgecollpair.p11].tv );
 
-                       VECSUB ( x3, verts2[edgecollpair.p22].co, verts1[edgecollpair.p11].txold );
-                       VECSUB ( v3, velocity2[edgecollpair.p22].co, verts1[edgecollpair.p11].tv );
+                       sub_v3_v3v3 ( x3, verts2[edgecollpair.p22].co, verts1[edgecollpair.p11].txold );
+                       sub_v3_v3v3 ( v3, velocity2[edgecollpair.p22].co, verts1[edgecollpair.p11].tv );
 
                        numsolutions = cloth_get_collision_time ( x1, v1, x2, v2, x3, v3, solution );
 
@@ -2048,27 +2048,27 @@ static int cloth_collision_moving_edges ( ClothModifierData *clmd, CollisionModi
                                        // TODO: check for collisions
                                        distance = edgedge_distance(triA[0], triA[1], triB[0], triB[1], &a, &b, out_normal);
                                        
-                                       if ((distance <= clmd->coll_parms->epsilon + BLI_bvhtree_getepsilon ( collmd->bvhtree ) + ALMOST_ZERO) && (INPR(out_normal, out_normal) > 0))
+                                       if ((distance <= clmd->coll_parms->epsilon + BLI_bvhtree_getepsilon ( collmd->bvhtree ) + ALMOST_ZERO) && (dot_v3v3(out_normal, out_normal) > 0))
                                        {
                                                float vrel_1_to_2[3], temp[3], temp2[3], out_normalVelocity;
                                                float desiredVn;
 
-                                               VECCOPY(vrel_1_to_2, verts1[edgecollpair.p11].tv);
+                                               copy_v3_v3(vrel_1_to_2, verts1[edgecollpair.p11].tv);
                                                mul_v3_fl(vrel_1_to_2, 1.0 - a);
-                                               VECCOPY(temp, verts1[edgecollpair.p12].tv);
+                                               copy_v3_v3(temp, verts1[edgecollpair.p12].tv);
                                                mul_v3_fl(temp, a);
 
                                                VECADD(vrel_1_to_2, vrel_1_to_2, temp);
 
-                                               VECCOPY(temp, verts1[edgecollpair.p21].tv);
+                                               copy_v3_v3(temp, verts1[edgecollpair.p21].tv);
                                                mul_v3_fl(temp, 1.0 - b);
-                                               VECCOPY(temp2, verts1[edgecollpair.p22].tv);
+                                               copy_v3_v3(temp2, verts1[edgecollpair.p22].tv);
                                                mul_v3_fl(temp2, b);
                                                VECADD(temp, temp, temp2);
 
-                                               VECSUB(vrel_1_to_2, vrel_1_to_2, temp);
+                                               sub_v3_v3v3(vrel_1_to_2, vrel_1_to_2, temp);
 
-                                               out_normalVelocity = INPR(vrel_1_to_2, out_normal);
+                                               out_normalVelocity = dot_v3v3(vrel_1_to_2, out_normal);
 /*
                                                // this correction results in wrong normals sometimes?
                                                if(out_normalVelocity < 0.0)
@@ -2507,7 +2507,7 @@ int cloth_bvh_objcollision (Object *ob, ClothModifierData * clmd, float step, fl
                                                        }
                                                }
        
-                                               VECSUB ( temp, verts[i].tx, verts[j].tx );
+                                               sub_v3_v3v3 ( temp, verts[i].tx, verts[j].tx );
        
                                                if ( ( ABS ( temp[0] ) > mindistance ) || ( ABS ( temp[1] ) > mindistance ) || ( ABS ( temp[2] ) > mindistance ) ) continue;
        
@@ -2538,7 +2538,7 @@ int cloth_bvh_objcollision (Object *ob, ClothModifierData * clmd, float step, fl
                                                                mul_v3_fl( temp, correction * -0.5 );
                                                                VECADD ( verts[j].tx, verts[j].tx, temp );
        
-                                                               VECSUB ( verts[i].tx, verts[i].tx, temp );
+                                                               sub_v3_v3v3 ( verts[i].tx, verts[i].tx, temp );
                                                        }
                                                        ret = 1;
                                                        ret2 += ret;
@@ -2564,7 +2564,7 @@ int cloth_bvh_objcollision (Object *ob, ClothModifierData * clmd, float step, fl
                                {
                                        if ( ! ( verts [i].flags & CLOTH_VERT_FLAG_PINNED ) )
                                        {
-                                               VECSUB ( verts[i].tv, verts[i].tx, verts[i].txold );
+                                               sub_v3_v3v3 ( verts[i].tv, verts[i].tx, verts[i].txold );
                                        }
                                }
                        }
index cad354e451a46f01c4fcc213ff9462fe181e0835..e0125891e866e282c499fd186bded6c89259b88c 100644 (file)
@@ -3507,8 +3507,7 @@ static void shrinkwrap_get_tarmat (bConstraint *con, bConstraintOb *cob, bConstr
                                        if(scon->projAxis & MOD_SHRINKWRAP_PROJECT_OVER_Y_AXIS) no[1] = 1.0f;
                                        if(scon->projAxis & MOD_SHRINKWRAP_PROJECT_OVER_Z_AXIS) no[2] = 1.0f;
                                        
-                                       if(INPR(no,no) < FLT_EPSILON)
-                                       {
+                                       if (dot_v3v3(no, no) < FLT_EPSILON) {
                                                fail = TRUE;
                                                break;
                                        }
index cb2c077d14deda5909f25ea2f42d6c6c0f432d2b..a271513afc0d9ba46955347653fc9642d102b835 100644 (file)
@@ -210,7 +210,7 @@ DO_INLINE void init_lfvector(float (*fLongVector)[3], float vector[3], unsigned
        unsigned int i = 0;
        for(i = 0; i < verts; i++)
        {
-               VECCOPY(fLongVector[i], vector);
+               copy_v3_v3(fLongVector[i], vector);
        }
 }
 /* zero long vector with float[3] */
@@ -248,9 +248,8 @@ DO_INLINE float dot_lfvector(float (*fLongVectorA)[3], float (*fLongVectorB)[3],
 // different results each time you run it!
 // schedule(guided, 2)
 //#pragma omp parallel for reduction(+: temp) if(verts > CLOTH_OPENMP_LIMIT)
-       for(i = 0; i < (long)verts; i++)
-       {
-               temp += INPR(fLongVectorA[i], fLongVectorB[i]);
+       for(i = 0; i < (long)verts; i++) {
+               temp += dot_v3v3(fLongVectorA[i], fLongVectorB[i]);
        }
        return temp;
 }
@@ -303,7 +302,7 @@ DO_INLINE void sub_lfvector_lfvector(float (*to)[3], float (*fLongVectorA)[3], f
 
        for(i = 0; i < verts; i++)
        {
-               VECSUB(to[i], fLongVectorA[i], fLongVectorB[i]);
+               sub_v3_v3v3(to[i], fLongVectorA[i], fLongVectorB[i]);
        }
 
 }
@@ -324,9 +323,9 @@ static void print_fmatrix(float m3[3][3])
 DO_INLINE void cp_fmatrix(float to[3][3], float from[3][3])
 {
        // memcpy(to, from, sizeof (float) * 9);
-       VECCOPY(to[0], from[0]);
-       VECCOPY(to[1], from[1]);
-       VECCOPY(to[2], from[2]);
+       copy_v3_v3(to[0], from[0]);
+       copy_v3_v3(to[1], from[1]);
+       copy_v3_v3(to[2], from[2]);
 }
 
 /* copy 3x3 matrix */
@@ -397,11 +396,11 @@ DO_INLINE void mul_fvector_fmatrix(float *to, float *from, float matrix[3][3])
 
 /* 3x3 matrix multiplied by a vector */
 /* STATUS: verified */
-DO_INLINE void mul_fmatrix_fvector(float *to, float matrix[3][3], float *from)
+DO_INLINE void mul_fmatrix_fvector(float *to, float matrix[3][3], float from[3])
 {
-       to[0] = INPR(matrix[0],from);
-       to[1] = INPR(matrix[1],from);
-       to[2] = INPR(matrix[2],from);
+       to[0] = dot_v3v3(matrix[0],from);
+       to[1] = dot_v3v3(matrix[1],from);
+       to[2] = dot_v3v3(matrix[2],from);
 }
 /* 3x3 matrix multiplied by a 3x3 matrix */
 /* STATUS: verified */
@@ -449,9 +448,9 @@ DO_INLINE void subadd_fmatrixS_fmatrixS(float to[3][3], float matrixA[3][3], flo
 /* A = B - C (3x3 matrix subtraction with 3x3 matrix) */
 DO_INLINE void sub_fmatrix_fmatrix(float to[3][3], float matrixA[3][3], float matrixB[3][3])
 {
-       VECSUB(to[0], matrixA[0], matrixB[0]);
-       VECSUB(to[1], matrixA[1], matrixB[1]);
-       VECSUB(to[2], matrixA[2], matrixB[2]);
+       sub_v3_v3v3(to[0], matrixA[0], matrixB[0]);
+       sub_v3_v3v3(to[1], matrixA[1], matrixB[1]);
+       sub_v3_v3v3(to[2], matrixA[2], matrixB[2]);
 }
 /* A += B - C (3x3 matrix add-subtraction with 3x3 matrix) */
 DO_INLINE void addsub_fmatrix_fmatrix(float to[3][3], float matrixA[3][3], float matrixB[3][3])
@@ -495,16 +494,16 @@ DO_INLINE void mulsub_fmatrix_fmatrix(float to[3][3], float matrixA[3][3], float
 /* STATUS: verified */
 DO_INLINE void muladd_fmatrix_fvector(float to[3], float matrix[3][3], float from[3])
 {
-       to[0] += INPR(matrix[0],from);
-       to[1] += INPR(matrix[1],from);
-       to[2] += INPR(matrix[2],from);  
+       to[0] += dot_v3v3(matrix[0], from);
+       to[1] += dot_v3v3(matrix[1], from);
+       to[2] += dot_v3v3(matrix[2], from);
 }
 /* 3x3 matrix multiplied+sub'ed by a vector */
 DO_INLINE void mulsub_fmatrix_fvector(float to[3], float matrix[3][3], float from[3])
 {
-       to[0] -= INPR(matrix[0],from);
-       to[1] -= INPR(matrix[1],from);
-       to[2] -= INPR(matrix[2],from);
+       to[0] -= dot_v3v3(matrix[0], from);
+       to[1] -= dot_v3v3(matrix[1], from);
+       to[2] -= dot_v3v3(matrix[2], from);
 }
 /////////////////////////////////////////////////////////////////
 
@@ -813,7 +812,7 @@ int implicit_init (Object *UNUSED(ob), ClothModifierData *clmd)
 
        for(i = 0; i < cloth->numverts; i++)
        {               
-               VECCOPY(id->X[i], verts[i].x);
+               copy_v3_v3(id->X[i], verts[i].x);
        }
 
        return 1;
@@ -1218,7 +1217,7 @@ DO_INLINE void dfdx_damp(float to[3][3],  float dir[3],float length,const float
        //      return (I-outerprod(dir,dir)) * (-damping * -(dot(dir,vel)/Max(length,rest)));
        mul_fvectorT_fvector(to, dir, dir);
        sub_fmatrix_fmatrix(to, I, to);
-       mul_fmatrix_S(to,  (-damping * -(INPR(dir,vel)/MAX2(length,rest)))); 
+       mul_fmatrix_S(to,  (-damping * -(dot_v3v3(dir,vel)/MAX2(length,rest))));
 
 }
 
@@ -1244,14 +1243,14 @@ DO_INLINE void cloth_calc_spring_force(ClothModifierData *clmd, ClothSpring *s,
 
        int no_compress = clmd->sim_parms->flags & CLOTH_SIMSETTINGS_FLAG_NO_SPRING_COMPRESS;
        
-       VECCOPY(s->f, nullf);
+       copy_v3_v3(s->f, nullf);
        cp_fmatrix(s->dfdx, nulldfdx);
        cp_fmatrix(s->dfdv, nulldfdx);
 
        // calculate elonglation
-       VECSUB(extent, X[s->kl], X[s->ij]);
-       VECSUB(vel, V[s->kl], V[s->ij]);
-       dot = INPR(extent, extent);
+       sub_v3_v3v3(extent, X[s->kl], X[s->ij]);
+       sub_v3_v3v3(vel, V[s->kl], V[s->ij]);
+       dot = dot_v3v3(extent, extent);
        length = sqrt(dot);
        
        s->flags &= ~CLOTH_SPRING_FLAG_NEEDED;
@@ -1296,7 +1295,7 @@ DO_INLINE void cloth_calc_spring_force(ClothModifierData *clmd, ClothSpring *s,
 
                        // Ascher & Boxman, p.21: Damping only during elonglation
                        // something wrong with it...
-                       mul_fvector_S(damping_force, dir, clmd->sim_parms->Cdis * INPR(vel,dir));
+                       mul_fvector_S(damping_force, dir, clmd->sim_parms->Cdis * dot_v3v3(vel, dir));
                        VECADD(s->f, s->f, damping_force);
                        
                        /* VERIFIED */
@@ -1313,14 +1312,14 @@ DO_INLINE void cloth_calc_spring_force(ClothModifierData *clmd, ClothSpring *s,
                s->flags |= CLOTH_SPRING_FLAG_NEEDED;
                
                // current_position = xold + t * (newposition - xold)
-               VECSUB(tvect, verts[s->ij].xconst, verts[s->ij].xold);
+               sub_v3_v3v3(tvect, verts[s->ij].xconst, verts[s->ij].xold);
                mul_fvector_S(tvect, tvect, time);
                VECADD(tvect, tvect, verts[s->ij].xold);
 
-               VECSUB(extent, X[s->ij], tvect);
+               sub_v3_v3v3(extent, X[s->ij], tvect);
                
                // SEE MSG BELOW (these are UNUSED)
-               // dot = INPR(extent, extent);
+               // dot = dot_v3v3(extent, extent);
                // length = sqrt(dot);
                
                k = clmd->sim_parms->goalspring;
@@ -1331,7 +1330,7 @@ DO_INLINE void cloth_calc_spring_force(ClothModifierData *clmd, ClothSpring *s,
                
                VECADDS(s->f, s->f, extent, -k);
                
-               mul_fvector_S(damping_force, dir, clmd->sim_parms->goalfrict * 0.01 * INPR(vel,dir));
+               mul_fvector_S(damping_force, dir, clmd->sim_parms->goalfrict * 0.01 * dot_v3v3(vel, dir));
                VECADD(s->f, s->f, damping_force);
                
                // HERE IS THE PROBLEM!!!!
@@ -1371,7 +1370,7 @@ DO_INLINE void cloth_apply_spring_force(ClothModifierData *UNUSED(clmd), ClothSp
                VECADD(lF[s->ij], lF[s->ij], s->f);
                
                if(!(s->type & CLOTH_SPRING_TYPE_GOAL))
-                       VECSUB(lF[s->kl], lF[s->kl], s->f);
+                       sub_v3_v3v3(lF[s->kl], lF[s->kl], s->f);
                
                sub_fmatrix_fmatrix(dFdX[s->kl].m, dFdX[s->kl].m, s->dfdx);
                sub_fmatrix_fmatrix(dFdX[s->ij].m, dFdX[s->ij].m, s->dfdx);
@@ -1415,7 +1414,7 @@ static void CalcFloat4( float *v1, float *v2, float *v3, float *v4, float *n)
 
 static float calculateVertexWindForce(float wind[3], float vertexnormal[3])  
 {
-       return (INPR(wind, vertexnormal));
+       return dot_v3v3(wind, vertexnormal);
 }
 
 typedef struct HairGridVert {
@@ -1503,7 +1502,7 @@ static void hair_velocity_smoothing(ClothModifierData *clmd, lfVector *lF, lfVec
                                        k = HAIR_GRID_INDEX(loc1->co, gmin, gmax, 2);
 
                                        if(k>=0 && k<10) {
-                                               VECSUB(vel, loc1->co, loc0->co);
+                                               sub_v3_v3v3(vel, loc1->co, loc0->co);
 
                                                colg[i][j][k].velocity[0] += vel[0];
                                                colg[i][j][k].velocity[1] += vel[1];
@@ -1577,7 +1576,7 @@ static void cloth_calc_force(ClothModifierData *clmd, float UNUSED(frame), lfVec
        
        /* global acceleration (gravitation) */
        if(clmd->scene->physics_settings.flag & PHYS_GLOBAL_GRAVITY) {
-               VECCOPY(gravity, clmd->scene->physics_settings.gravity);
+               copy_v3_v3(gravity, clmd->scene->physics_settings.gravity);
                mul_fvector_S(gravity, gravity, 0.001f * clmd->sim_parms->effector_weights->global_gravity); /* scale gravity force */
        }
 
@@ -1597,7 +1596,7 @@ static void cloth_calc_force(ClothModifierData *clmd, float UNUSED(frame), lfVec
        for(i = 0; i < numverts; i++)
        {
                float temp[3];
-               VECCOPY(temp, lF[i]);
+               copy_v3_v3(temp, lF[i]);
                mul_fmatrix_fvector(lF[i], M[i].m, temp);
        }
 
@@ -1636,24 +1635,24 @@ static void cloth_calc_force(ClothModifierData *clmd, float UNUSED(frame), lfVec
                        normalize_v3_v3(trinormal, triunnormal);
                        
                        // add wind from v1
-                       VECCOPY(tmp, trinormal);
+                       copy_v3_v3(tmp, trinormal);
                        mul_v3_fl(tmp, calculateVertexWindForce(winvec[mfaces[i].v1], triunnormal));
                        VECADDS(lF[mfaces[i].v1], lF[mfaces[i].v1], tmp, factor);
                        
                        // add wind from v2
-                       VECCOPY(tmp, trinormal);
+                       copy_v3_v3(tmp, trinormal);
                        mul_v3_fl(tmp, calculateVertexWindForce(winvec[mfaces[i].v2], triunnormal));
                        VECADDS(lF[mfaces[i].v2], lF[mfaces[i].v2], tmp, factor);
                        
                        // add wind from v3
-                       VECCOPY(tmp, trinormal);
+                       copy_v3_v3(tmp, trinormal);
                        mul_v3_fl(tmp, calculateVertexWindForce(winvec[mfaces[i].v3], triunnormal));
                        VECADDS(lF[mfaces[i].v3], lF[mfaces[i].v3], tmp, factor);
                        
                        // add wind from v4
                        if(mfaces[i].v4)
                        {
-                               VECCOPY(tmp, trinormal);
+                               copy_v3_v3(tmp, trinormal);
                                mul_v3_fl(tmp, calculateVertexWindForce(winvec[mfaces[i].v4], triunnormal));
                                VECADDS(lF[mfaces[i].v4], lF[mfaces[i].v4], tmp, factor);
                        }
@@ -1672,15 +1671,15 @@ static void cloth_calc_force(ClothModifierData *clmd, float UNUSED(frame), lfVec
                                spring = search->link;
                                
                                if(spring->type == CLOTH_SPRING_TYPE_STRUCTURAL) {
-                                       VECSUB(edgevec, (float*)lX[spring->ij], (float*)lX[spring->kl]);
+                                       sub_v3_v3v3(edgevec, (float*)lX[spring->ij], (float*)lX[spring->kl]);
 
                                        project_v3_v3v3(tmp, winvec[spring->ij], edgevec);
-                                       VECSUB(edgeunnormal, winvec[spring->ij], tmp);
+                                       sub_v3_v3v3(edgeunnormal, winvec[spring->ij], tmp);
                                        /* hair doesn't stretch too much so we can use restlen pretty safely */
                                        VECADDS(lF[spring->ij], lF[spring->ij], edgeunnormal, spring->restlen * factor);
 
                                        project_v3_v3v3(tmp, winvec[spring->kl], edgevec);
-                                       VECSUB(edgeunnormal, winvec[spring->kl], tmp);
+                                       sub_v3_v3v3(edgeunnormal, winvec[spring->kl], tmp);
                                        VECADDS(lF[spring->kl], lF[spring->kl], edgeunnormal, spring->restlen * factor);
                                }
 
@@ -1843,7 +1842,7 @@ int implicit_solver (Object *ob, float frame, ClothModifierData *clmd, ListBase
                        // update velocities with constrained velocities from pinned verts
                        if(verts [i].flags & CLOTH_VERT_FLAG_PINNED)
                        {                       
-                               VECSUB(id->V[i], verts[i].xconst, verts[i].xold);
+                               sub_v3_v3v3(id->V[i], verts[i].xconst, verts[i].xold);
                                // mul_v3_fl(id->V[i], clmd->sim_parms->stepsPerFrame);
                        }
                }       
@@ -1871,14 +1870,14 @@ int implicit_solver (Object *ob, float frame, ClothModifierData *clmd, ListBase
                                if(verts [i].flags & CLOTH_VERT_FLAG_PINNED)
                                {                       
                                        float tvect[3] = {.0,.0,.0};
-                                       VECSUB(tvect, verts[i].xconst, verts[i].xold);
+                                       sub_v3_v3v3(tvect, verts[i].xconst, verts[i].xold);
                                        mul_fvector_S(tvect, tvect, step+dt);
                                        VECADD(tvect, tvect, verts[i].xold);
-                                       VECCOPY(id->Xnew[i], tvect);
+                                       copy_v3_v3(id->Xnew[i], tvect);
                                }       
                        }
                        
-                       VECCOPY(verts[i].txold, id->X[i]);
+                       copy_v3_v3(verts[i].txold, id->X[i]);
                }
 
                if(clmd->coll_parms->flags & CLOTH_COLLSETTINGS_FLAG_ENABLED && clmd->clothObject->bvhtree)
@@ -1889,10 +1888,10 @@ int implicit_solver (Object *ob, float frame, ClothModifierData *clmd, ListBase
                        // update verts to current positions
                        for(i = 0; i < numverts; i++)
                        {
-                               VECCOPY(verts[i].tx, id->Xnew[i]);
+                               copy_v3_v3(verts[i].tx, id->Xnew[i]);
 
-                               VECSUB(verts[i].tv, verts[i].tx, verts[i].txold);
-                               VECCOPY(verts[i].v, verts[i].tv);
+                               sub_v3_v3v3(verts[i].tv, verts[i].tx, verts[i].txold);
+                               copy_v3_v3(verts[i].v, verts[i].tv);
                        }
 
                        for (i=0, cv=cloth->verts; i<cloth->numverts; i++, cv++) {
@@ -1907,7 +1906,7 @@ int implicit_solver (Object *ob, float frame, ClothModifierData *clmd, ListBase
                        for(i = 0; i < numverts; i++)
                        {               
                                // correct velocity again, just to be sure we had to change it due to adaptive collisions
-                               VECSUB(verts[i].tv, verts[i].tx, id->X[i]);
+                               sub_v3_v3v3(verts[i].tv, verts[i].tx, id->X[i]);
                        }
 
                        //if (do_extra_solve)
@@ -1922,8 +1921,8 @@ int implicit_solver (Object *ob, float frame, ClothModifierData *clmd, ListBase
                                        if((clmd->sim_parms->flags & CLOTH_SIMSETTINGS_FLAG_GOAL) && (verts [i].flags & CLOTH_VERT_FLAG_PINNED))
                                                continue;
 
-                                       VECCOPY(id->Xnew[i], verts[i].tx);
-                                       VECCOPY(id->Vnew[i], verts[i].tv);
+                                       copy_v3_v3(id->Xnew[i], verts[i].tx);
+                                       copy_v3_v3(id->Vnew[i], verts[i].tv);
                                        mul_v3_fl(id->Vnew[i], spf);
                                }
                        }
@@ -1963,15 +1962,15 @@ int implicit_solver (Object *ob, float frame, ClothModifierData *clmd, ListBase
        {                               
                if((clmd->sim_parms->flags & CLOTH_SIMSETTINGS_FLAG_GOAL) && (verts [i].flags & CLOTH_VERT_FLAG_PINNED))
                {
-                       VECCOPY(verts[i].txold, verts[i].xconst); // TODO: test --> should be .x 
-                       VECCOPY(verts[i].x, verts[i].xconst);
-                       VECCOPY(verts[i].v, id->V[i]);
+                       copy_v3_v3(verts[i].txold, verts[i].xconst); // TODO: test --> should be .x
+                       copy_v3_v3(verts[i].x, verts[i].xconst);
+                       copy_v3_v3(verts[i].v, id->V[i]);
                }
                else
                {
-                       VECCOPY(verts[i].txold, id->X[i]);
-                       VECCOPY(verts[i].x, id->X[i]);
-                       VECCOPY(verts[i].v, id->V[i]);
+                       copy_v3_v3(verts[i].txold, id->X[i]);
+                       copy_v3_v3(verts[i].x, id->X[i]);
+                       copy_v3_v3(verts[i].v, id->V[i]);
                }
        }
        
@@ -1989,8 +1988,8 @@ void implicit_set_positions (ClothModifierData *clmd)
        
        for(i = 0; i < numverts; i++)
        {                               
-               VECCOPY(id->X[i], verts[i].x);
-               VECCOPY(id->V[i], verts[i].v);
+               copy_v3_v3(id->X[i], verts[i].x);
+               copy_v3_v3(id->V[i], verts[i].v);
        }
        if(G.rt > 0)
                printf("implicit_set_positions\n");     
index 9017d4b3808a0569ea039de46a380224b111ace8..446f15020206cbc26a2ea50f39db1518a159c7f7 100644 (file)
@@ -2622,9 +2622,9 @@ static void mesh_calc_ngon_normal(MPoly *mpoly, MLoop *loopstart,
                v2 = mvert + loopstart[(i+1)%mpoly->totloop].v;
                v3 = mvert + loopstart[(i+2)%mpoly->totloop].v;
                
-               VECCOPY(u, v1->co);
-               VECCOPY(v, v2->co);
-               VECCOPY(w, v3->co);
+               copy_v3db_v3fl(u, v1->co);
+               copy_v3db_v3fl(v, v2->co);
+               copy_v3db_v3fl(w, v3->co);
 
                /*this fixes some weird numerical error*/
                if (i==0) {
@@ -2712,9 +2712,9 @@ static void mesh_calc_ngon_normal_coords(MPoly *mpoly, MLoop *loopstart,
                v2 = (const float *)(vertex_coords + loopstart[(i+1)%mpoly->totloop].v);
                v3 = (const float *)(vertex_coords + loopstart[(i+2)%mpoly->totloop].v);
 
-               VECCOPY(u, v1);
-               VECCOPY(v, v2);
-               VECCOPY(w, v3);
+               copy_v3db_v3fl(u, v1);
+               copy_v3db_v3fl(v, v2);
+               copy_v3db_v3fl(w, v3);
 
                /*this fixes some weird numerical error*/
                if (i==0) {
index d86b3c7a9d351b22c21e1e5f248b0caabffcad9f..590c307f549561787e2294e97e64c069d43941c8 100644 (file)
@@ -2370,7 +2370,7 @@ void psys_find_parents(ParticleSimulationData *sim)
        BLI_kdtree_free(tree);
 }
 
-static void get_strand_normal(Material *ma, float *surfnor, float surfdist, float *nor)
+static void get_strand_normal(Material *ma, const float surfnor[3], float surfdist, float nor[3])
 {
        float cross[3], nstrand[3], vnor[3], blend;
 
@@ -2381,7 +2381,7 @@ static void get_strand_normal(Material *ma, float *surfnor, float surfdist, floa
                cross_v3_v3v3(cross, surfnor, nor);
                cross_v3_v3v3(nstrand, nor, cross);
 
-               blend= INPR(nstrand, surfnor);
+               blend = dot_v3v3(nstrand, surfnor);
                CLAMP(blend, 0.0f, 1.0f);
 
                interp_v3_v3v3(vnor, nstrand, surfnor, blend);
index 22968583d33dd7c51d69c863ded84f12c3880885..8d50d3d69cf660800d6b9d1a8a3473c587a8b20c 100644 (file)
@@ -2411,7 +2411,7 @@ static void sph_particle_courant(SPHData *sphdata, SPHRangeData *pfr)
                mul_v3_v3fl(sphdata->flow, flow, 1.0f / pfr->tot_neighbors);
        } else {
                sphdata->element_size = MAXFLOAT;
-               VECCOPY(sphdata->flow, flow);
+               copy_v3_v3(sphdata->flow, flow);
        }
 }
 static void sph_force_cb(void *sphdata_v, ParticleKey *state, float *force, float *UNUSED(impulse))
index b05188e71835aea10564ea4aa07068b198609cd6..90d530cb239dbe2307d82cc8c215b259d2a8ee8c 100644 (file)
@@ -258,8 +258,7 @@ void sk_straightenStroke(SK_Stroke *stk, int start, int end, float p_start[3], f
                float delta = (float)i / (float)total;
                float *p = stk->points[start + 1 + i].p;
 
-               VECCOPY(p, delta_p);
-               mul_v3_fl(p, delta);
+               mul_v3_v3fl(p, delta_p, delta);
                add_v3_v3(p, p_start);
        }
 }
@@ -333,7 +332,7 @@ void sk_flattenStroke(SK_Stroke *stk, int start, int end)
                sub_v3_v3v3(distance, p, stk->points[start].p);
                project_v3_v3v3(distance, distance, normal);
 
-               VECCOPY(offset, normal);
+               copy_v3_v3(offset, normal);
                mul_v3_fl(offset, d);
 
                sub_v3_v3(p, distance);
index 7a39fc8b8ce1f20c8df8e00be8a270eaf2a3ef12..1a24acfe1a5050fe759f601ada6b5c9b634c0980 100644 (file)
@@ -70,6 +70,14 @@ MINLINE void copy_v4_v4_short(short r[4], const short a[4]);
 MINLINE void copy_v2_v2_int(int r[2], const int a[2]);
 MINLINE void copy_v3_v3_int(int r[3], const int a[3]);
 MINLINE void copy_v4_v4_int(int r[4], const int a[4]);
+/* double -> float */
+MINLINE void copy_v2fl_v2db(float r[2], const double a[2]);
+MINLINE void copy_v3fl_v3db(float r[3], const double a[3]);
+MINLINE void copy_v4fl_v4db(float r[4], const double a[4]);
+/* float -> double */
+MINLINE void copy_v2db_v2fl(double r[2], const float a[2]);
+MINLINE void copy_v3db_v3fl(double r[3], const float a[3]);
+MINLINE void copy_v4db_v4fl(double r[4], const float a[4]);
 
 /********************************* Arithmetic ********************************/
 
index d42e228ca118581631178f08928499c438bd174b..26e8e8afeb710bda8fcb2975cc5cf66fa15ded29 100644 (file)
                *(v1)=   *(v2);                                                       \
                *(v1+1)= *(v2+1);                                                     \
        }
-#define QUATCOPY(v1, v2) {                                                    \
-               *(v1)=   *(v2);                                                       \
-               *(v1+1)= *(v2+1);                                                     \
-               *(v1+2)= *(v2+2);                                                     \
-               *(v1+3)= *(v2+3);                                                     \
-       }
 #define VECADD(v1,v2,v3) {                                                    \
                *(v1)=   *(v2)   + *(v3);                                             \
                *(v1+1)= *(v2+1) + *(v3+1);                                           \
                *(v1+1)= *(v2+1) - *(v3+1)*(fac);                                     \
                *(v1+2)= *(v2+2) - *(v3+2)*(fac);                                     \
        }
-#define QUATADDFAC(v1,v2,v3,fac) {                                            \
-               *(v1)=   *(v2)   + *(v3)*(fac);                                       \
-               *(v1+1)= *(v2+1) + *(v3+1)*(fac);                                     \
-               *(v1+2)= *(v2+2) + *(v3+2)*(fac);                                     \
-               *(v1+3)= *(v2+3) + *(v3+3)*(fac);                                     \
-       }
 
 #define INPR(v1, v2) ( (v1)[0]*(v2)[0] + (v1)[1]*(v2)[1] + (v1)[2]*(v2)[2] )
 
index 34e5cbc6a134ddb97ed2dcf2cc78fc7c46918679..6414245fb3eef63d8d16bc6ccbe0c06042ff1c76 100644 (file)
@@ -164,6 +164,51 @@ MINLINE void copy_v4_v4_int(int r[4], const int a[4])
        r[3]= a[3];
 }
 
+/* double -> float */
+MINLINE void copy_v2fl_v2db(float r[2], const double a[2])
+{
+       r[0] = (float)a[0];
+       r[1] = (float)a[1];
+}
+
+MINLINE void copy_v3fl_v3db(float r[3], const double a[3])
+{
+       r[0] = (float)a[0];
+       r[1] = (float)a[1];
+       r[2] = (float)a[2];
+}
+
+MINLINE void copy_v4fl_v4db(float r[4], const double a[4])
+{
+       r[0] = (float)a[0];
+       r[1] = (float)a[1];
+       r[2] = (float)a[2];
+       r[3] = (float)a[3];
+}
+
+/* float -> double */
+MINLINE void copy_v2db_v2fl(double r[2], const float a[2])
+{
+       r[0] = (double)a[0];
+       r[1] = (double)a[1];
+}
+
+MINLINE void copy_v3db_v3fl(double r[3], const float a[3])
+{
+       r[0] = (double)a[0];
+       r[1] = (double)a[1];
+       r[2] = (double)a[2];
+}
+
+MINLINE void copy_v4db_v4fl(double r[4], const float a[4])
+{
+       r[0] = (double)a[0];
+       r[1] = (double)a[1];
+       r[2] = (double)a[2];
+       r[3] = (double)a[3];
+}
+
+
 MINLINE void swap_v2_v2(float a[2], float b[2])
 {
        SWAP(float, a[0], b[0]);
index 7061a0fcf080caa27783a3418ac7851af405017b..6a20d8582145d740420322464ff7b80b90de71c7 100644 (file)
@@ -832,7 +832,7 @@ int BLI_edgefill(short mat_nr)
                        sub_v3_v3v3(vec1, eve->co, eve->next->next->co);
                        sub_v3_v3v3(vec2, eve->next->co, eve->next->next->next->co);
                        
-                       if (INPR(vec1, vec1) < INPR(vec2, vec2)) {
+                       if (dot_v3v3(vec1, vec1) < dot_v3v3(vec2, vec2)) {
                                addfillface(eve, eve->next, eve->next->next);
                                addfillface(eve->next->next, eve->next->next->next, eve);
                        } else{
index 7963b6cf294cfa50cfeb647c4b745e15bd1781c5..7074adc324f40c4955ca78ce182976993749bade 100644 (file)
@@ -283,7 +283,7 @@ static int quad_co(float *x, float *y, float v1[3], float v2[3], float v3[3], fl
 
        normal_quad_v3(n2, projverts[0], projverts[1], projverts[2], projverts[3]);
 
-       if (INPR(n, n2) < -FLT_EPSILON) {
+       if (dot_v3v3(n, n2) < -FLT_EPSILON) {
                return 0;
        }
 
index 3d02006770041b965ef3dee4b25be4f988cd40c2..37d095221c96b70c6830fb4d64dd5339675c64e0 100644 (file)
@@ -161,9 +161,8 @@ int nextFixedSubdivision(ToolSettings *toolsettings, BArcIterator *iter, int sta
 
                current_length += len_v3v3(v1, v2);
 
-               if (current_length >= length_threshold)
-               {
-                       VECCOPY(p, v2);
+               if (current_length >= length_threshold) {
+                       copy_v3_v3(p, v2);
                        return i;
                }
                
@@ -190,10 +189,9 @@ int nextAdaptativeSubdivision(ToolSettings *toolsettings, BArcIterator *iter, in
                IT_peek(iter, i);
                sub_v3_v3v3(n, iter->p, head);
 
-               if (calcArcCorrelation(iter, start, i, start_p, n) < correlation_threshold)
-               {
+               if (calcArcCorrelation(iter, start, i, start_p, n) < correlation_threshold) {
                        IT_peek(iter, i - 1);
-                       VECCOPY(p, iter->p);
+                       copy_v3_v3(p, iter->p);
                        return i - 1;
                }
        }
@@ -240,25 +238,22 @@ int nextLengthSubdivision(ToolSettings *toolsettings, BArcIterator *iter, int st
                                
                                //printf("a %f, b %f, c %f, f %f\n", a, b, c, f);
                                
-                               if (isnan(f) == 0 && f < 1.0f)
-                               {
-                                       VECCOPY(p, dv);
+                               if (isnan(f) == 0 && f < 1.0f) {
+                                       copy_v3_v3(p, dv);
                                        mul_v3_fl(p, f);
                                        add_v3_v3(p, vec0);
                                }
-                               else
-                               {
-                                       VECCOPY(p, vec1);
+                               else {
+                                       copy_v3_v3(p, vec1);
                                }
                        }
-                       else
-                       {
+                       else {
                                float dv[3];
                                
                                sub_v3_v3v3(dv, vec1, vec0);
                                normalize_v3(dv);
                                 
-                               VECCOPY(p, dv);
+                               copy_v3_v3(p, dv);
                                mul_v3_fl(p, lengthLimit);
                                add_v3_v3(p, head);
                        }
@@ -289,7 +284,7 @@ EditBone * subdivideArcBy(ToolSettings *toolsettings, bArmature *arm, ListBase *
        IT_head(iter);
        
        parent = ED_armature_edit_bone_add(arm, "Bone");
-       VECCOPY(parent->head, iter->p);
+       copy_v3_v3(parent->head, iter->p);
        
        if (iter->size > 0)
        {
@@ -304,7 +299,7 @@ EditBone * subdivideArcBy(ToolSettings *toolsettings, bArmature *arm, ListBase *
                IT_peek(iter, index);
 
                child = ED_armature_edit_bone_add(arm, "Bone");
-               VECCOPY(child->head, parent->tail);
+               copy_v3_v3(child->head, parent->tail);
                child->parent = parent;
                child->flag |= BONE_CONNECTED;
                
@@ -329,9 +324,8 @@ EditBone * subdivideArcBy(ToolSettings *toolsettings, bArmature *arm, ListBase *
        
        iter->tail(iter);
 
-       VECCOPY(parent->tail, iter->p);
-       if (iter->size > 0)
-       {
+       copy_v3_v3(parent->tail, iter->p);
+       if (iter->size > 0) {
                parent->rad_tail = iter->size * size_buffer;
        }
                
index 08f95ecb08ae3806dd33cfe5a9d1e51ad982157e..971131099814547f6aa0e12096a8b5a783115862 100644 (file)
@@ -247,7 +247,7 @@ static ReebNode * addNode(ReebGraph *rg, EditVert *eve)
        node->degree = 0;
        node->weight = weight;
        node->index = rg->totnodes;
-       VECCOPY(node->p, eve->co);      
+       copy_v3_v3(node->p, eve->co);
        
        BLI_addtail(&rg->nodes, node);
        rg->totnodes++;
@@ -487,11 +487,11 @@ void repositionNodes(ReebGraph *rg)
                {
                        float p[3];
                        
-                       VECCOPY(p, ((ReebArc*)arc)->buckets[0].p);
+                       copy_v3_v3(p, ((ReebArc*)arc)->buckets[0].p);
                        mul_v3_fl(p, 1.0f / arc->head->degree);
                        add_v3_v3(arc->head->p, p);
                        
-                       VECCOPY(p, ((ReebArc*)arc)->buckets[((ReebArc*)arc)->bcount - 1].p);
+                       copy_v3_v3(p, ((ReebArc*)arc)->buckets[((ReebArc*)arc)->bcount - 1].p);
                        mul_v3_fl(p, 1.0f / arc->tail->degree);
                        add_v3_v3(arc->tail->p, p);
                }
@@ -647,7 +647,7 @@ static void mergeBuckets(EmbedBucket *bDst, EmbedBucket *bSrc)
        else if (bSrc->nv > 0)
        {
                bDst->nv = bSrc->nv;
-               VECCOPY(bDst->p, bSrc->p);
+               copy_v3_v3(bDst->p, bSrc->p);
        }
 }
 
@@ -963,7 +963,7 @@ void REEB_RadialSymmetry(BNode* root_node, RadialArc* ring, int count)
        float axis[3];
        int i;
        
-       VECCOPY(axis, root_node->symmetry_axis);
+       copy_v3_v3(axis, root_node->symmetry_axis);
        
        /* first pass, merge incrementally */
        for (i = 0; i < count - 1; i++)
@@ -1046,7 +1046,7 @@ void REEB_RadialSymmetry(BNode* root_node, RadialArc* ring, int count)
                arc2 = (ReebArc*)ring[j].arc;
 
                /* copy first node than mirror */
-               VECCOPY(node2->p, node1->p);
+               copy_v3_v3(node2->p, node1->p);
                BLI_mirrorAlongAxis(node2->p, root_node->p, normal);
                
                /* Copy buckets
@@ -1081,7 +1081,7 @@ void REEB_RadialSymmetry(BNode* root_node, RadialArc* ring, int count)
                        {
                                /* copy and mirror back to bucket2 */                   
                                bucket2->nv = bucket1->nv;
-                               VECCOPY(bucket2->p, bucket1->p);
+                               copy_v3_v3(bucket2->p, bucket1->p);
                                BLI_mirrorAlongAxis(bucket2->p, node->p, normal);
                        }
                }
@@ -1096,10 +1096,10 @@ void REEB_AxialSymmetry(BNode* root_node, BNode* node1, BNode* node2, struct BAr
        arc1 = (ReebArc*)barc1;
        arc2 = (ReebArc*)barc2;
 
-       VECCOPY(nor, root_node->symmetry_axis);
+       copy_v3_v3(nor, root_node->symmetry_axis);
        
        /* mirror node2 along axis */
-       VECCOPY(p, node2->p);
+       copy_v3_v3(p, node2->p);
        BLI_mirrorAlongAxis(p, root_node->p, nor);
 
        /* average with node1 */
@@ -1107,7 +1107,7 @@ void REEB_AxialSymmetry(BNode* root_node, BNode* node1, BNode* node2, struct BAr
        mul_v3_fl(node1->p, 0.5f);
        
        /* mirror back on node2 */
-       VECCOPY(node2->p, node1->p);
+       copy_v3_v3(node2->p, node1->p);
        BLI_mirrorAlongAxis(node2->p, root_node->p, nor);
        
        /* Merge buckets
@@ -1149,7 +1149,7 @@ void REEB_AxialSymmetry(BNode* root_node, BNode* node1, BNode* node2, struct BAr
 
                        /* copy and mirror back to bucket2 */                   
                        bucket2->nv = bucket1->nv;
-                       VECCOPY(bucket2->p, bucket1->p);
+                       copy_v3_v3(bucket2->p, bucket1->p);
                        BLI_mirrorAlongAxis(bucket2->p, root_node->p, nor);
                }
        }
@@ -1798,7 +1798,7 @@ int filterSmartReebGraph(ReebGraph *UNUSED(rg), float UNUSED(threshold))
                                                vec0 = previous->p;
                                        }
                                        
-                                       VECCOPY(midpoint, vec1);
+                                       copy_v3_v3(midpoint, vec1);
                                        
                                        distance = len_v3v3(midpoint, efa->cent);
                                        
index f44af97d403f1aa6436a2cb8f7b0bba0c391ac89..44d923a009bb20f43e49acdca3965b7e6a68b4bd 100644 (file)
@@ -357,7 +357,7 @@ int join_mesh_exec(bContext *C, wmOperator *op)
                                                                /* copy this mesh's shapekey to the destination shapekey (need to transform first) */
                                                                fp2= ((float *)(okb->data));
                                                                for(a=0; a < me->totvert; a++, fp1+=3, fp2+=3) {
-                                                                       VECCOPY(fp1, fp2);
+                                                                       copy_v3_v3(fp1, fp2);
                                                                        mul_m4_v3(cmat, fp1);
                                                                }
                                                        }
@@ -365,7 +365,7 @@ int join_mesh_exec(bContext *C, wmOperator *op)
                                                                /* copy this mesh's vertex coordinates to the destination shapekey */
                                                                mv= mvert;
                                                                for(a=0; a < me->totvert; a++, fp1+=3, mv++) {
-                                                                       VECCOPY(fp1, mv->co);
+                                                                       copy_v3_v3(fp1, mv->co);
                                                                }
                                                        }
                                                }
@@ -387,14 +387,14 @@ int join_mesh_exec(bContext *C, wmOperator *op)
                                                                /* copy this mesh's shapekey to the destination shapekey */
                                                                fp2= ((float *)(okb->data));
                                                                for(a=0; a < me->totvert; a++, fp1+=3, fp2+=3) {
-                                                                       VECCOPY(fp1, fp2);
+                                                                       copy_v3_v3(fp1, fp2);
                                                                }
                                                        }
                                                        else {
                                                                /* copy base-coordinates to the destination shapekey */
                                                                mv= mvert;
                                                                for(a=0; a < me->totvert; a++, fp1+=3, mv++) {
-                                                                       VECCOPY(fp1, mv->co);
+                                                                       copy_v3_v3(fp1, mv->co);
                                                                }
                                                        }
                                                }
@@ -813,7 +813,7 @@ intptr_t mesh_octree_table(Object *ob, BMEditMesh *em, float *co, char mode)
                }
                
                /* for quick unit coordinate calculus */
-               VECCOPY(MeshOctree.offs, min);
+               copy_v3_v3(MeshOctree.offs, min);
                MeshOctree.offs[0]-= MOC_THRESH;                /* we offset it 1 threshold unit extra */
                MeshOctree.offs[1]-= MOC_THRESH;
                MeshOctree.offs[2]-= MOC_THRESH;
index 7bf5d29574a628294bcd06359b23bd619bebb675..3d5702521261b6b1369e4612acd698846c965e9c 100644 (file)
@@ -177,7 +177,7 @@ void ED_view3d_clipping_set(RegionView3D *rv3d)
        unsigned int a;
 
        for (a = 0; a < tot; a++) {
-               QUATCOPY(plane, rv3d->clip[a]);
+               copy_v4db_v4fl(plane, rv3d->clip[a]);
                glClipPlane(GL_CLIP_PLANE0 + a, plane);
                glEnable(GL_CLIP_PLANE0 + a);
        }
index 7a7a7e9920ea2e5b5c8fc6808e4c7f2ddd298792..88658b3066215ff4d56479979428065263f79fb0 100644 (file)
@@ -546,10 +546,10 @@ void ED_view3d_calc_clipping(BoundBox *bb, float planes[4][4], bglMats *mats, co
                ys= (val==0||val==1)?rect->ymin:rect->ymax;
 
                gluUnProject(xs, ys, 0.0, mats->modelview, mats->projection, mats->viewport, &p[0], &p[1], &p[2]);
-               VECCOPY(bb->vec[val], p);
+               copy_v3fl_v3db(bb->vec[val], p);
 
                gluUnProject(xs, ys, 1.0, mats->modelview, mats->projection, mats->viewport, &p[0], &p[1], &p[2]);
-               VECCOPY(bb->vec[4+val], p);
+               copy_v3fl_v3db(bb->vec[4 + val], p);
        }
 
        /* verify if we have negative scale. doing the transform before cross
@@ -762,8 +762,9 @@ void view3d_unproject(bglMats *mats, float out[3], const short x, const short y,
 {
        double ux, uy, uz;
 
-               gluUnProject(x,y,z, mats->modelview, mats->projection,
-                        (GLint *)mats->viewport, &ux, &uy, &uz );
+       gluUnProject(x,y,z, mats->modelview, mats->projection,
+                    (GLint *)mats->viewport, &ux, &uy, &uz);
+
        out[0] = ux;
        out[1] = uy;
        out[2] = uz;
index 146c8e5cc000ee1fdefba0bca605f1ffa81761e6..cce8e4cca56bebcb165cdb7efba5d5e5f7b1a7f0 100644 (file)
@@ -5481,8 +5481,8 @@ static void markerToTransDataInit(TransData *td, TransData2D *td2d,
 
        td->flag = 0;
        td->loc = td2d->loc;
-       VECCOPY(td->center, td->loc);
-       VECCOPY(td->iloc, td->loc);
+       copy_v3_v3(td->center, td->loc);
+       copy_v3_v3(td->iloc, td->loc);
 
        memset(td->axismtx, 0, sizeof(td->axismtx));
        td->axismtx[2][2] = 1.0f;
@@ -5627,8 +5627,8 @@ static void markerToTransCurveDataInit(TransData *td, TransData2D *td2d, TransDa
 
        td->flag = 0;
        td->loc = td2d->loc;
-       VECCOPY(td->center, td->loc);
-       VECCOPY(td->iloc, td->loc);
+       copy_v3_v3(td->center, td->loc);
+       copy_v3_v3(td->iloc, td->loc);
 
        memset(td->axismtx, 0, sizeof(td->axismtx));
        td->axismtx[2][2] = 1.0f;
index cdbf130377ad891ccb6e5acf11d7f160d6dd8db3..9188d048154401e5a059c433f733a7d42db882ed 100644 (file)
@@ -879,7 +879,7 @@ static void draw_manipulator_rotate(View3D *v3d, RegionView3D *rv3d, int moving,
 
        if(arcs) {
                /* clipplane makes nice handles, calc here because of multmatrix but with translate! */
-               VECCOPY(plane, rv3d->viewinv[2]); /* float -> double */
+               copy_v3db_v3fl(plane, rv3d->viewinv[2]);
                plane[3]= -0.02f*size; // clip just a bit more
                glClipPlane(GL_CLIP_PLANE0, plane);
        }
index fbbd58932ea68d0da5830e9ea5dc2ff4abd30290..638f67c4207effeef494d8e253ebe8ad6ec7ecd5 100644 (file)
@@ -51,7 +51,7 @@ static void do_normal(bNode *node, float *out, float *in)
        float *nor= ((bNodeSocketValueVector*)sock->default_value)->value;
        
        /* render normals point inside... the widget points outside */
-       out[0]= -INPR(nor, in);
+       out[0]= -dot_v3v3(nor, in);
 }
 
 /* generates normal, does dot product */
index 8515c99ba81baf48613641fb02bf4cd1dcaec45e..34213558317e858a8f99c35a28eb0c38ccfd241e 100644 (file)
@@ -68,7 +68,7 @@ static void node_shader_exec_normal(void *UNUSED(data), bNode *node, bNodeStack
        
        copy_v3_v3(out[0]->vec, ((bNodeSocketValueVector*)sock->default_value)->value);
        /* render normals point inside... the widget points outside */
-       out[1]->vec[0]= -INPR(out[0]->vec, vec);
+       out[1]->vec[0]= -dot_v3v3(out[0]->vec, vec);
 }
 
 static int gpu_shader_normal(GPUMaterial *mat, bNode *node, GPUNodeStack *in, GPUNodeStack *out)
index 115a913337f68e3c092d59d950666a2a3f9ab3dd..85b545269e56528890458a78e2f4f4d118c65768 100644 (file)
@@ -113,7 +113,7 @@ static void fogcolor(float *colf, float *rco, float *view)
                hor[2]= hor[2]*alpha;
                addAlphaOverFloat(colf, hor);
                
-               VECSUB(vec, vec, dview);
+               sub_v3_v3(vec, dview);
        }       
 }
 #endif
@@ -173,17 +173,17 @@ static void spothalo(struct LampRen *lar, ShadeInput *shi, float *intens)
                p1[1]= shi->co[1]-lar->co[1];
                p1[2]= -lar->co[2];
                mul_m3_v3(lar->imat, p1);
-               VECCOPY(npos, p1);      // npos is double!
+               copy_v3db_v3fl(npos, p1);       // npos is double!
                
                /* pre-scale */
                npos[2] *= (double)lar->sh_zfac;
        }
        else {
-               VECCOPY(npos, lar->sh_invcampos);       /* in initlamp calculated */
+               copy_v3db_v3fl(npos, lar->sh_invcampos);        /* in initlamp calculated */
        }
        
        /* rotate view */
-       VECCOPY(nray, shi->view);
+       copy_v3db_v3fl(nray, shi->view);
        mul_m3_v3_double(lar->imat, nray);
        
        if(R.wrld.mode & WO_MIST) {