svn merge -r40166:40279 ^/trunk/blender
[blender.git] / source / blender / blenkernel / intern / collision.c
index ed073f032709545e317f8ef29c96c54591fd665d..700c6693a248928a7b893b0b20c0370e262f8f46 100644 (file)
@@ -44,6 +44,7 @@
 #include "DNA_scene_types.h"
 #include "DNA_meshdata_types.h"
 
+#include "BLI_utildefines.h"
 #include "BLI_blenlib.h"
 #include "BLI_math.h"
 #include "BLI_edgehash.h"
@@ -104,11 +105,11 @@ BVHTree *bvhtree_build_from_mvert ( MFace *mfaces, unsigned int numfaces, MVert
        // fill tree
        for ( i = 0; i < numfaces; i++, tface++ )
        {
-               VECCOPY ( &co[0*3], x[tface->v1].co );
-               VECCOPY ( &co[1*3], x[tface->v2].co );
-               VECCOPY ( &co[2*3], x[tface->v3].co );
+               copy_v3_v3 ( &co[0*3], x[tface->v1].co );
+               copy_v3_v3 ( &co[1*3], x[tface->v2].co );
+               copy_v3_v3 ( &co[2*3], x[tface->v3].co );
                if ( tface->v4 )
-                       VECCOPY ( &co[3*3], x[tface->v4].co );
+                       copy_v3_v3 ( &co[3*3], x[tface->v4].co );
 
                BLI_bvhtree_insert ( tree, i, co, ( mfaces->v4 ? 4 : 3 ) );
        }
@@ -133,21 +134,21 @@ void bvhtree_update_from_mvert ( BVHTree * bvhtree, MFace *faces, int numfaces,
        {
                for ( i = 0; i < numfaces; i++, mfaces++ )
                {
-                       VECCOPY ( &co[0*3], x[mfaces->v1].co );
-                       VECCOPY ( &co[1*3], x[mfaces->v2].co );
-                       VECCOPY ( &co[2*3], x[mfaces->v3].co );
+                       copy_v3_v3 ( &co[0*3], x[mfaces->v1].co );
+                       copy_v3_v3 ( &co[1*3], x[mfaces->v2].co );
+                       copy_v3_v3 ( &co[2*3], x[mfaces->v3].co );
                        if ( mfaces->v4 )
-                               VECCOPY ( &co[3*3], x[mfaces->v4].co );
+                               copy_v3_v3 ( &co[3*3], x[mfaces->v4].co );
 
                        // copy new locations into array
                        if ( moving && xnew )
                        {
                                // update moving positions
-                               VECCOPY ( &co_moving[0*3], xnew[mfaces->v1].co );
-                               VECCOPY ( &co_moving[1*3], xnew[mfaces->v2].co );
-                               VECCOPY ( &co_moving[2*3], xnew[mfaces->v3].co );
+                               copy_v3_v3 ( &co_moving[0*3], xnew[mfaces->v1].co );
+                               copy_v3_v3 ( &co_moving[1*3], xnew[mfaces->v2].co );
+                               copy_v3_v3 ( &co_moving[2*3], xnew[mfaces->v3].co );
                                if ( mfaces->v4 )
-                                       VECCOPY ( &co_moving[3*3], xnew[mfaces->v4].co );
+                                       copy_v3_v3 ( &co_moving[3*3], xnew[mfaces->v4].co );
 
                                ret = BLI_bvhtree_update_node ( bvhtree, i, co, co_moving, ( mfaces->v4 ? 4 : 3 ) );
                        }
@@ -550,7 +551,7 @@ static int cloth_collision_response_static ( 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 );
 
@@ -2021,7 +2022,7 @@ static int cloth_collision_moving_edges ( ClothModifierData *clmd, CollisionModi
                        {
                                if(edgecollpair.p21==6 || edgecollpair.p22 == 6)
                                {
-                                       printf("dist: %f, sol[k]: %lf, sol2[k]: %lf\n", distance, solution[k], solution2[k]);
+                                       printf("dist: %f, sol[k]: %f, sol2[k]: %f\n", distance, solution[k], solution2[k]);
                                        printf("a1: %f, a2: %f, b1: %f, b2: %f\n", x1[0], x2[0], x3[0], v1[0]);
                                        printf("b21: %d, b22: %d\n", edgecollpair.p21, edgecollpair.p22);
                                }
@@ -2346,7 +2347,7 @@ static int cloth_bvh_objcollisions_resolve ( ClothModifierData * clmd, Collision
                                        if ( verts[i].impulse_count )
                                        {
                                                VECADDMUL ( verts[i].tv, verts[i].impulse, 1.0f / verts[i].impulse_count );
-                                               VECCOPY ( verts[i].impulse, tnull );
+                                               copy_v3_v3 ( verts[i].impulse, tnull );
                                                verts[i].impulse_count = 0;
 
                                                ret++;