diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-09-11 12:28:16 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-09-11 12:28:16 +0400 |
commit | 0383fb53414366d4ede19622fbe5bb5e6f782a0f (patch) | |
tree | f9137000aeb86b710773e41743671e70f44b4463 /source/blender/editors/space_view3d/drawvolume.c | |
parent | 75b393612809252349bf4062bc45df14c1a5dfe5 (diff) | |
parent | ff04beb3e4681e6849030595c80ed692c3bd9be1 (diff) |
svn merge -r40104:40117 https://svn.blender.org/svnroot/bf-blender/trunk/blender
Diffstat (limited to 'source/blender/editors/space_view3d/drawvolume.c')
-rw-r--r-- | source/blender/editors/space_view3d/drawvolume.c | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/source/blender/editors/space_view3d/drawvolume.c b/source/blender/editors/space_view3d/drawvolume.c index 805887e3805..1509cafa05f 100644 --- a/source/blender/editors/space_view3d/drawvolume.c +++ b/source/blender/editors/space_view3d/drawvolume.c @@ -155,10 +155,10 @@ static int convex(float *p0, float *up, float *a, float *b) { // Vec3 va = a-p0, vb = b-p0; float va[3], vb[3], tmp[3]; - VECSUB(va, a, p0); - VECSUB(vb, b, p0); + sub_v3_v3v3(va, a, p0); + sub_v3_v3v3(vb, b, p0); cross_v3_v3v3(tmp, va, vb); - return INPR(up, tmp) >= 0; + return dot_v3v3(up, tmp) >= 0; } // copied from gpu_extension.c @@ -281,20 +281,20 @@ void draw_volume(ARegion *ar, GPUTexture *tex, float *min, float *max, int res[3 cv[7][1] = min[1]; cv[7][2] = min[2]; - VECCOPY(edges[0][0], cv[4]); // maxx, maxy, minz - VECCOPY(edges[1][0], cv[5]); // minx, maxy, minz - VECCOPY(edges[2][0], cv[6]); // minx, miny, minz - VECCOPY(edges[3][0], cv[7]); // maxx, miny, minz + copy_v3_v3(edges[0][0], cv[4]); // maxx, maxy, minz + copy_v3_v3(edges[1][0], cv[5]); // minx, maxy, minz + copy_v3_v3(edges[2][0], cv[6]); // minx, miny, minz + copy_v3_v3(edges[3][0], cv[7]); // maxx, miny, minz - VECCOPY(edges[4][0], cv[3]); // maxx, miny, maxz - VECCOPY(edges[5][0], cv[2]); // minx, miny, maxz - VECCOPY(edges[6][0], cv[6]); // minx, miny, minz - VECCOPY(edges[7][0], cv[7]); // maxx, miny, minz + copy_v3_v3(edges[4][0], cv[3]); // maxx, miny, maxz + copy_v3_v3(edges[5][0], cv[2]); // minx, miny, maxz + copy_v3_v3(edges[6][0], cv[6]); // minx, miny, minz + copy_v3_v3(edges[7][0], cv[7]); // maxx, miny, minz - VECCOPY(edges[8][0], cv[1]); // minx, maxy, maxz - VECCOPY(edges[9][0], cv[2]); // minx, miny, maxz - VECCOPY(edges[10][0], cv[6]); // minx, miny, minz - VECCOPY(edges[11][0], cv[5]); // minx, maxy, minz + copy_v3_v3(edges[8][0], cv[1]); // minx, maxy, maxz + copy_v3_v3(edges[9][0], cv[2]); // minx, miny, maxz + copy_v3_v3(edges[10][0], cv[6]); // minx, miny, minz + copy_v3_v3(edges[11][0], cv[5]); // minx, maxy, minz // printf("size x: %f, y: %f, z: %f\n", size[0], size[1], size[2]); // printf("min[2]: %f, max[2]: %f\n", min[2], max[2]); @@ -333,7 +333,7 @@ void draw_volume(ARegion *ar, GPUTexture *tex, float *min, float *max, int res[3 */ // get view vector - VECCOPY(viewnormal, rv3d->viewinv[2]); + copy_v3_v3(viewnormal, rv3d->viewinv[2]); normalize_v3(viewnormal); // find cube vertex that is closest to the viewer @@ -408,10 +408,10 @@ void draw_volume(ARegion *ar, GPUTexture *tex, float *min, float *max, int res[3 if(dd*(float)n > ds) break; - VECCOPY(tmp_point, viewnormal); + copy_v3_v3(tmp_point, viewnormal); mul_v3_fl(tmp_point, -dd*((ds/dd)-(float)n)); - VECADD(tmp_point2, cv[good_index], tmp_point); - d = INPR(tmp_point2, viewnormal); + add_v3_v3v3(tmp_point2, cv[good_index], tmp_point); + d = dot_v3v3(tmp_point2, viewnormal); // printf("my d: %f\n", d); @@ -422,7 +422,7 @@ void draw_volume(ARegion *ar, GPUTexture *tex, float *min, float *max, int res[3 // printf("points: %d\n", numpoints); if (numpoints > 2) { - VECCOPY(p0, points); + copy_v3_v3(p0, points); // sort points to get a convex polygon for(i = 1; i < numpoints - 1; i++) @@ -432,9 +432,9 @@ void draw_volume(ARegion *ar, GPUTexture *tex, float *min, float *max, int res[3 if(!convex(p0, viewnormal, &points[j * 3], &points[i * 3])) { float tmp2[3]; - VECCOPY(tmp2, &points[j * 3]); - VECCOPY(&points[j * 3], &points[i * 3]); - VECCOPY(&points[i * 3], tmp2); + copy_v3_v3(tmp2, &points[j * 3]); + copy_v3_v3(&points[j * 3], &points[i * 3]); + copy_v3_v3(&points[i * 3], tmp2); } } } |