diff --git a/source/blender/blenkernel/intern/bvhutils.c b/source/blender/blenkernel/intern/bvhutils.c index ee160a13fa2..93abad8858f 100644 --- a/source/blender/blenkernel/intern/bvhutils.c +++ b/source/blender/blenkernel/intern/bvhutils.c @@ -48,27 +48,27 @@ /* Math stuff for ray casting on mesh faces and for nearest surface */ -static float ray_tri_intersection(const BVHTreeRay *ray, const float UNUSED(m_dist), const float *v0, const float *v1, const float *v2) +static float ray_tri_intersection(const BVHTreeRay *ray, const float UNUSED(m_dist), const float v0[3], const float v1[3], const float v2[3]) { float dist; - if(isect_ray_tri_v3((float*)ray->origin, (float*)ray->direction, (float*)v0, (float*)v1, (float*)v2, &dist, NULL)) + if(isect_ray_tri_v3(ray->origin, ray->direction, v0, v1, v2, &dist, NULL)) return dist; return FLT_MAX; } -static float sphereray_tri_intersection(const BVHTreeRay *ray, float radius, const float m_dist, const float *v0, const float *v1, const float *v2) +static float sphereray_tri_intersection(const BVHTreeRay *ray, float radius, const float m_dist, const float v0[3], const float v1[3], const float v2[3]) { float idist; float p1[3]; float plane_normal[3], hit_point[3]; - normal_tri_v3( plane_normal,(float*)v0, (float*)v1, (float*)v2); + normal_tri_v3(plane_normal, v0, v1, v2); - VECADDFAC( p1, ray->origin, ray->direction, m_dist); - if(isect_sweeping_sphere_tri_v3((float*)ray->origin, p1, radius, (float*)v0, (float*)v1, (float*)v2, &idist, hit_point)) + madd_v3_v3v3fl(p1, ray->origin, ray->direction, m_dist); + if(isect_sweeping_sphere_tri_v3(ray->origin, p1, radius, v0, v1, v2, &idist, hit_point)) { return idist * m_dist; } @@ -81,7 +81,7 @@ static float sphereray_tri_intersection(const BVHTreeRay *ray, float radius, con * Function adapted from David Eberly's distance tools (LGPL) * http://www.geometrictools.com/LibFoundation/Distance/Distance.html */ -static float nearest_point_in_tri_surface(const float *v0,const float *v1,const float *v2,const float *p, int *v, int *e, float *nearest ) +static float nearest_point_in_tri_surface(const float v0[3], const float v1[3], const float v2[3], const float p[3], int *v, int *e, float nearest[3]) { float diff[3]; float e0[3]; @@ -98,16 +98,16 @@ static float nearest_point_in_tri_surface(const float *v0,const float *v1,const float sqrDist; int lv = -1, le = -1; - VECSUB(diff, v0, p); - VECSUB(e0, v1, v0); - VECSUB(e1, v2, v0); + sub_v3_v3v3(diff, v0, p); + sub_v3_v3v3(e0, v1, v0); + sub_v3_v3v3(e1, v2, v0); - A00 = INPR ( e0, e0 ); - A01 = INPR( e0, e1 ); - A11 = INPR ( e1, e1 ); - B0 = INPR( diff, e0 ); - B1 = INPR( diff, e1 ); - C = INPR( diff, diff ); + A00 = dot_v3v3(e0, e0); + A01 = dot_v3v3(e0, e1 ); + A11 = dot_v3v3(e1, e1 ); + B0 = dot_v3v3(diff, e0 ); + B1 = dot_v3v3(diff, e1 ); + C = dot_v3v3(diff, diff ); Det = fabs( A00 * A11 - A01 * A01 ); S = A01 * B1 - A11 * B0; T = A01 * B0 - A00 * B1; @@ -123,7 +123,7 @@ static float nearest_point_in_tri_surface(const float *v0,const float *v1,const T = 0.0f; if ( -B0 >= A00 ) { - S = (float)1.0; + S = 1.0f; sqrDist = A00 + 2.0f * B0 + C; lv = 1; } @@ -379,15 +379,15 @@ static float nearest_point_in_tri_surface(const float *v0,const float *v1,const { float w[3], x[3], y[3], z[3]; - VECCOPY(w, v0); - VECCOPY(x, e0); + copy_v3_v3(w, v0); + copy_v3_v3(x, e0); mul_v3_fl(x, S); - VECCOPY(y, e1); + copy_v3_v3(y, e1); mul_v3_fl(y, T); VECADD(z, w, x); VECADD(z, z, y); - //VECSUB(d, p, z); - VECCOPY(nearest, z); + //sub_v3_v3v3(d, p, z); + copy_v3_v3(nearest, z); // d = p - ( v0 + S * e0 + T * e1 ); } *v = lv; @@ -403,7 +403,7 @@ static float nearest_point_in_tri_surface(const float *v0,const float *v1,const // Callback to bvh tree nearest point. The tree must bust have been built using bvhtree_from_mesh_faces. // userdata must be a BVHMeshCallbackUserdata built from the same mesh as the tree. -static void mesh_faces_nearest_point(void *userdata, int index, const float *co, BVHTreeNearest *nearest) +static void mesh_faces_nearest_point(void *userdata, int index, const float co[3], BVHTreeNearest *nearest) { const BVHTreeFromMesh *data = (BVHTreeFromMesh*) userdata; MVert *vert = data->vert; @@ -426,7 +426,7 @@ static void mesh_faces_nearest_point(void *userdata, int index, const float *co, { nearest->index = index; nearest->dist = dist; - VECCOPY(nearest->co, nearest_tmp); + copy_v3_v3(nearest->co, nearest_tmp); normal_tri_v3( nearest->no,t0, t1, t2); } @@ -464,7 +464,7 @@ static void mesh_faces_spherecast(void *userdata, int index, const BVHTreeRay *r { hit->index = index; hit->dist = dist; - VECADDFAC(hit->co, ray->origin, ray->direction, dist); + madd_v3_v3v3fl(hit->co, ray->origin, ray->direction, dist); normal_tri_v3( hit->no,t0, t1, t2); } @@ -478,7 +478,7 @@ static void mesh_faces_spherecast(void *userdata, int index, const BVHTreeRay *r // Callback to bvh tree nearest point. The tree must bust have been built using bvhtree_from_mesh_edges. // userdata must be a BVHMeshCallbackUserdata built from the same mesh as the tree. -static void mesh_edges_nearest_point(void *userdata, int index, const float *co, BVHTreeNearest *nearest) +static void mesh_edges_nearest_point(void *userdata, int index, const float co[3], BVHTreeNearest *nearest) { const BVHTreeFromMesh *data = (BVHTreeFromMesh*) userdata; MVert *vert = data->vert; @@ -488,16 +488,15 @@ static void mesh_edges_nearest_point(void *userdata, int index, const float *co, float *t0, *t1; t0 = vert[ edge->v1 ].co; t1 = vert[ edge->v2 ].co; - - // NOTE: casts to "float*" here are due to co being "const float*" - closest_to_line_segment_v3(nearest_tmp, (float*)co, t0, t1); - dist = len_squared_v3v3(nearest_tmp, (float*)co); + + closest_to_line_segment_v3(nearest_tmp, co, t0, t1); + dist = len_squared_v3v3(nearest_tmp, co); if(dist < nearest->dist) { nearest->index = index; nearest->dist = dist; - VECCOPY(nearest->co, nearest_tmp); + copy_v3_v3(nearest->co, nearest_tmp); sub_v3_v3v3(nearest->no, t0, t1); normalize_v3(nearest->no); } @@ -590,11 +589,11 @@ BVHTree* bvhtree_from_mesh_faces(BVHTreeFromMesh *data, DerivedMesh *mesh, float for(i = 0; i < numFaces; i++, efa= efa->next) { if(!(efa->f & 1) && efa->h==0 && !((efa->v1->f&1)+(efa->v2->f&1)+(efa->v3->f&1)+(efa->v4?efa->v4->f&1:0))) { float co[4][3]; - VECCOPY(co[0], vert[ face[i].v1 ].co); - VECCOPY(co[1], vert[ face[i].v2 ].co); - VECCOPY(co[2], vert[ face[i].v3 ].co); + copy_v3_v3(co[0], vert[ face[i].v1 ].co); + copy_v3_v3(co[1], vert[ face[i].v2 ].co); + copy_v3_v3(co[2], vert[ face[i].v3 ].co); if(face[i].v4) - VECCOPY(co[3], vert[ face[i].v4 ].co); + copy_v3_v3(co[3], vert[ face[i].v4 ].co); BLI_bvhtree_insert(tree, i, co[0], face[i].v4 ? 4 : 3); } @@ -603,11 +602,11 @@ BVHTree* bvhtree_from_mesh_faces(BVHTreeFromMesh *data, DerivedMesh *mesh, float else { for(i = 0; i < numFaces; i++) { float co[4][3]; - VECCOPY(co[0], vert[ face[i].v1 ].co); - VECCOPY(co[1], vert[ face[i].v2 ].co); - VECCOPY(co[2], vert[ face[i].v3 ].co); + copy_v3_v3(co[0], vert[ face[i].v1 ].co); + copy_v3_v3(co[1], vert[ face[i].v2 ].co); + copy_v3_v3(co[2], vert[ face[i].v3 ].co); if(face[i].v4) - VECCOPY(co[3], vert[ face[i].v4 ].co); + copy_v3_v3(co[3], vert[ face[i].v4 ].co); BLI_bvhtree_insert(tree, i, co[0], face[i].v4 ? 4 : 3); } @@ -669,8 +668,8 @@ BVHTree* bvhtree_from_mesh_edges(BVHTreeFromMesh *data, DerivedMesh *mesh, float for(i = 0; i < numEdges; i++) { float co[4][3]; - VECCOPY(co[0], vert[ edge[i].v1 ].co); - VECCOPY(co[1], vert[ edge[i].v2 ].co); + copy_v3_v3(co[0], vert[ edge[i].v1 ].co); + copy_v3_v3(co[1], vert[ edge[i].v2 ].co); BLI_bvhtree_insert(tree, i, co[0], 2); } diff --git a/source/blender/blenkernel/intern/colortools.c b/source/blender/blenkernel/intern/colortools.c index 98a434a7d8b..2f568aa01eb 100644 --- a/source/blender/blenkernel/intern/colortools.c +++ b/source/blender/blenkernel/intern/colortools.c @@ -501,7 +501,7 @@ static void curvemap_make_table(CurveMap *cuma, rctf *clipr) hlen= len_v3v3(bezt[0].vec[1], bezt[0].vec[2]); /* original handle length */ /* clip handle point */ - VECCOPY(vec, bezt[1].vec[0]); + copy_v3_v3(vec, bezt[1].vec[0]); if(vec[0] < bezt[0].vec[1][0]) vec[0]= bezt[0].vec[1][0]; @@ -518,7 +518,7 @@ static void curvemap_make_table(CurveMap *cuma, rctf *clipr) hlen= len_v3v3(bezt[a].vec[1], bezt[a].vec[0]); /* original handle length */ /* clip handle point */ - VECCOPY(vec, bezt[a-1].vec[2]); + copy_v3_v3(vec, bezt[a-1].vec[2]); if(vec[0] > bezt[a].vec[1][0]) vec[0]= bezt[a].vec[1][0]; diff --git a/source/blender/blenkernel/intern/displist.c b/source/blender/blenkernel/intern/displist.c index 6ae556874bb..a5be056bc16 100644 --- a/source/blender/blenkernel/intern/displist.c +++ b/source/blender/blenkernel/intern/displist.c @@ -346,7 +346,7 @@ static void curve_to_displist(Curve *cu, ListBase *nubase, ListBase *dispbase, i if(a==0 && dl->type== DL_POLY) bezt= nu->bezt; if(prevbezt->h2==HD_VECT && bezt->h1==HD_VECT) { - VECCOPY(data, prevbezt->vec[1]); + copy_v3_v3(data, prevbezt->vec[1]); data+= 3; } else { @@ -363,7 +363,7 @@ static void curve_to_displist(Curve *cu, ListBase *nubase, ListBase *dispbase, i } if(a==0 && dl->type==DL_SEGM) { - VECCOPY(data, bezt->vec[1]); + copy_v3_v3(data, bezt->vec[1]); } prevbezt= bezt; @@ -404,7 +404,7 @@ static void curve_to_displist(Curve *cu, ListBase *nubase, ListBase *dispbase, i a= len; bp= nu->bp; while(a--) { - VECCOPY(data, bp->vec); + copy_v3_v3(data, bp->vec); bp++; data+= 3; } @@ -486,7 +486,7 @@ void filldisplist(ListBase *dispbase, ListBase *to, int flipnormal) totvert= 0; eve= fillvertbase.first; while(eve) { - VECCOPY(f1, eve->co); + copy_v3_v3(f1, eve->co); f1+= 3; /* index number */ @@ -559,7 +559,7 @@ static void bevels_to_filledpoly(Curve *cu, ListBase *dispbase) a= dl->parts; while(a--) { - VECCOPY(fp1, fp); + copy_v3_v3(fp1, fp); fp1+= 3; fp+= dpoly; } @@ -579,7 +579,7 @@ static void bevels_to_filledpoly(Curve *cu, ListBase *dispbase) a= dl->parts; while(a--) { - VECCOPY(fp1, fp); + copy_v3_v3(fp1, fp); fp1+= 3; fp+= dpoly; } diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index a493120e320..ae4e6ea81b8 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -2120,7 +2120,7 @@ void object_set_dimensions(Object *ob, const float *value) } } -void minmax_object(Object *ob, float *min, float *max) +void minmax_object(Object *ob, float min[3], float max[3]) { BoundBox bb; float vec[3]; diff --git a/source/blender/blenkernel/intern/shrinkwrap.c b/source/blender/blenkernel/intern/shrinkwrap.c index e47dcd68ce1..3d788b40a17 100644 --- a/source/blender/blenkernel/intern/shrinkwrap.c +++ b/source/blender/blenkernel/intern/shrinkwrap.c @@ -469,7 +469,7 @@ static void shrinkwrap_calc_nearest_surface_point(ShrinkwrapCalcData *calc) if(calc->smd->shrinkOpts & MOD_SHRINKWRAP_KEEP_ABOVE_SURFACE) { //Make the vertex stay on the front side of the face - VECADDFAC(tmp_co, nearest.co, nearest.no, calc->keepDist); + madd_v3_v3v3fl(tmp_co, nearest.co, nearest.no, calc->keepDist); } else { diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c index 4a12206d404..0556291c197 100644 --- a/source/blender/editors/curve/editcurve.c +++ b/source/blender/editors/curve/editcurve.c @@ -816,7 +816,7 @@ static void calc_shapeKeys(Object *obedit) if (oldbezt) { int j; for (j= 0; j < 3; ++j) { - VECSUB(ofs[i], bezt->vec[j], oldbezt->vec[j]); + sub_v3_v3v3(ofs[i], bezt->vec[j], oldbezt->vec[j]); i++; } ofs[i++][0]= bezt->alfa - oldbezt->alfa; @@ -832,7 +832,7 @@ static void calc_shapeKeys(Object *obedit) while(a--) { oldbp= getKeyIndexOrig_bp(editnurb, bp); if (oldbp) { - VECSUB(ofs[i], bp->vec, oldbp->vec); + sub_v3_v3v3(ofs[i], bp->vec, oldbp->vec); ofs[i+1][0]= bp->alfa - oldbp->alfa; } i += 2; @@ -866,10 +866,10 @@ static void calc_shapeKeys(Object *obedit) oldbezt= getKeyIndexOrig_bezt(editnurb, bezt); for (j= 0; j < 3; ++j, ++i) { - VECCOPY(fp, bezt->vec[j]); + copy_v3_v3(fp, bezt->vec[j]); if (restore && oldbezt) { - VECCOPY(bezt->vec[j], oldbezt->vec[j]); + copy_v3_v3(bezt->vec[j], oldbezt->vec[j]); } fp+= 3; @@ -890,12 +890,12 @@ static void calc_shapeKeys(Object *obedit) while(a--) { oldbp= getKeyIndexOrig_bp(editnurb, bp); - VECCOPY(fp, bp->vec); + copy_v3_v3(fp, bp->vec); fp[3]= bp->alfa; if(restore && oldbp) { - VECCOPY(bp->vec, oldbp->vec); + copy_v3_v3(bp->vec, oldbp->vec); bp->alfa= oldbp->alfa; } @@ -921,10 +921,10 @@ static void calc_shapeKeys(Object *obedit) curofp= ofp + index; for (j= 0; j < 3; ++j, ++i) { - VECCOPY(fp, curofp); + copy_v3_v3(fp, curofp); if(apply_offset) { - VECADD(fp, fp, ofs[i]); + add_v3_v3(fp, ofs[i]); } fp+= 3; curofp+= 3; @@ -933,7 +933,7 @@ static void calc_shapeKeys(Object *obedit) if(apply_offset) { /* apply alfa offsets */ - VECADD(fp, fp, ofs[i]); + add_v3_v3(fp, ofs[i]); ++i; } @@ -941,7 +941,7 @@ static void calc_shapeKeys(Object *obedit) } else { int j; for (j= 0; j < 3; ++j, ++i) { - VECCOPY(fp, bezt->vec[j]); + copy_v3_v3(fp, bezt->vec[j]); fp+= 3; } fp[0]= bezt->alfa; @@ -959,15 +959,15 @@ static void calc_shapeKeys(Object *obedit) if (index >= 0) { curofp= ofp + index; - VECCOPY(fp, curofp); + copy_v3_v3(fp, curofp); fp[3]= curofp[3]; if(apply_offset) { - VECADD(fp, fp, ofs[i]); + add_v3_v3(fp, ofs[i]); fp[3]+=ofs[i+1][0]; } } else { - VECCOPY(fp, bp->vec); + copy_v3_v3(fp, bp->vec); fp[3]= bp->alfa; } @@ -2890,14 +2890,14 @@ static void subdividenurb(Object *obedit, int number_cuts) interp_v3_v3v3(vec+12, vec+3, vec+6, factor); /* change handle of prev beztn */ - VECCOPY((beztn-1)->vec[2], vec); + copy_v3_v3((beztn-1)->vec[2], vec); /* new point */ - VECCOPY(beztn->vec[0], vec+9); + copy_v3_v3(beztn->vec[0], vec+9); interp_v3_v3v3(beztn->vec[1], vec+9, vec+12, factor); - VECCOPY(beztn->vec[2], vec+12); + copy_v3_v3(beztn->vec[2], vec+12); /* handle of next bezt */ - if(a==0 && i == number_cuts - 1 && (nu->flagu & CU_NURB_CYCLIC)) {VECCOPY(beztnew->vec[0], vec+6);} - else {VECCOPY(bezt->vec[0], vec+6);} + if(a==0 && i == number_cuts - 1 && (nu->flagu & CU_NURB_CYCLIC)) {copy_v3_v3(beztnew->vec[0], vec+6);} + else {copy_v3_v3(bezt->vec[0], vec+6);} beztn->radius = (prevbezt->radius + bezt->radius)/2; beztn->weight = (prevbezt->weight + bezt->weight)/2; @@ -3381,7 +3381,7 @@ static int convertspline(short type, Nurb *nu) a= nr; bp= nu->bp; while(a--) { - VECCOPY(bezt->vec[1], bp->vec); + copy_v3_v3(bezt->vec[1], bp->vec); bezt->f1=bezt->f2=bezt->f3= bp->f1; bezt->h1= bezt->h2= HD_VECT; bezt->weight= bp->weight; @@ -3418,7 +3418,7 @@ static int convertspline(short type, Nurb *nu) while(a--) { if(type==CU_POLY && bezt->h1==HD_VECT && bezt->h2==HD_VECT) { /* vector handle becomes 1 poly vertice */ - VECCOPY(bp->vec, bezt->vec[1]); + copy_v3_v3(bp->vec, bezt->vec[1]); bp->vec[3]= 1.0; bp->f1= bezt->f2; nr-= 2; @@ -3428,7 +3428,7 @@ static int convertspline(short type, Nurb *nu) } else { for(c=0;c<3;c++) { - VECCOPY(bp->vec, bezt->vec[c]); + copy_v3_v3(bp->vec, bezt->vec[c]); bp->vec[3]= 1.0; if(c==0) bp->f1= bezt->f1; else if(c==1) bp->f1= bezt->f2; @@ -3475,13 +3475,13 @@ static int convertspline(short type, Nurb *nu) a= nr; bp= nu->bp; while(a--) { - VECCOPY(bezt->vec[0], bp->vec); + copy_v3_v3(bezt->vec[0], bp->vec); bezt->f1= bp->f1; bp++; - VECCOPY(bezt->vec[1], bp->vec); + copy_v3_v3(bezt->vec[1], bp->vec); bezt->f2= bp->f1; bp++; - VECCOPY(bezt->vec[2], bp->vec); + copy_v3_v3(bezt->vec[2], bp->vec); bezt->f3= bp->f1; bezt->radius= bp->radius; bezt->weight= bp->weight; @@ -4472,7 +4472,7 @@ static int addvert_Nurb(bContext *C, short mode, float location[3]) (BezTriple*)MEM_callocN((nu->pntsu+1) * sizeof(BezTriple), "addvert_Nurb"); ED_curve_beztcpy(editnurb, newbezt, nu->bezt, nu->pntsu); *(newbezt+nu->pntsu)= *bezt; - VECCOPY(temp, bezt->vec[1]); + copy_v3_v3(temp, bezt->vec[1]); MEM_freeN(nu->bezt); nu->bezt= newbezt; newbezt+= nu->pntsu; @@ -4491,7 +4491,7 @@ static int addvert_Nurb(bContext *C, short mode, float location[3]) BEZ_SEL(newbezt); cu->lastsel= newbezt; newbezt->h2= newbezt->h1; - VECCOPY(temp, bezt->vec[1]); + copy_v3_v3(temp, bezt->vec[1]); MEM_freeN(nu->bezt); nu->bezt= newbezt; bezt= newbezt+1; @@ -4503,7 +4503,7 @@ static int addvert_Nurb(bContext *C, short mode, float location[3]) *newbezt= *bezt; BEZ_SEL(newbezt); newbezt->h2= newbezt->h1; - VECCOPY(temp, bezt->vec[1]); + copy_v3_v3(temp, bezt->vec[1]); newnu= (Nurb*)MEM_mallocN(sizeof(Nurb), "addvert_Nurb newnu"); memcpy(newnu, nu, sizeof(Nurb)); @@ -6189,7 +6189,7 @@ Nurb *add_nurbs_primitive(bContext *C, float mat[4][4], int type, int newob) if(rv3d) { copy_m4_m4(viewmat, rv3d->viewmat); - VECCOPY(zvec, rv3d->viewinv[2]); + copy_v3_v3(zvec, rv3d->viewinv[2]); } setflagsNurb(editnurb, 0); diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index c26a4d52a9e..754ccd1fd5e 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -2297,8 +2297,9 @@ void sculpt_vertcos_to_key(Object *ob, KeyBlock *kb, float (*vertCos)[3]) ofs= key_to_vertcos(ob, kb); /* calculate key coord offsets (from previous location) */ - for (a= 0; a < me->totvert; a++) - VECSUB(ofs[a], vertCos[a], ofs[a]); + for (a= 0; a < me->totvert; a++) { + sub_v3_v3v3(ofs[a], vertCos[a], ofs[a]); + } /* apply offsets on other keys */ currkey = me->key->block.first; diff --git a/source/blender/editors/space_view3d/drawvolume.c b/source/blender/editors/space_view3d/drawvolume.c index 7c89ce0f689..6605d488d36 100644 --- a/source/blender/editors/space_view3d/drawvolume.c +++ b/source/blender/editors/space_view3d/drawvolume.c @@ -242,7 +242,7 @@ void draw_volume(ARegion *ar, GPUTexture *tex, float *min, float *max, int res[3 tstart(); - VECSUB(size, max, min); + sub_v3_v3v3(size, max, min); // maxx, maxy, maxz cv[0][0] = max[0]; diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index c3a77dc67a5..5d3e05dcaab 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -3882,7 +3882,7 @@ int Bevel(TransInfo *t, const int UNUSED(mval[2])) else { d = distance; } - VECADDFAC(td->loc,td->center,td->axismtx[0],(*td->val)*d); + madd_v3_v3v3fl(td->loc, td->center, td->axismtx[0], (*td->val) * d); } recalcData(t); diff --git a/source/blender/editors/uvedit/uvedit_draw.c b/source/blender/editors/uvedit/uvedit_draw.c index 8a50ec28bd6..0f21aa3759c 100644 --- a/source/blender/editors/uvedit/uvedit_draw.c +++ b/source/blender/editors/uvedit/uvedit_draw.c @@ -267,10 +267,10 @@ static void draw_uvs_stretch(SpaceImage *sima, Scene *scene, EditMesh *em, MTFac #endif /* uv angles */ - VECSUB2D(av1, tf_uv[3], tf_uv[0]); normalize_v2(av1); - VECSUB2D(av2, tf_uv[0], tf_uv[1]); normalize_v2(av2); - VECSUB2D(av3, tf_uv[1], tf_uv[2]); normalize_v2(av3); - VECSUB2D(av4, tf_uv[2], tf_uv[3]); normalize_v2(av4); + sub_v2_v2v2(av1, tf_uv[3], tf_uv[0]); normalize_v2(av1); + sub_v2_v2v2(av2, tf_uv[0], tf_uv[1]); normalize_v2(av2); + sub_v2_v2v2(av3, tf_uv[1], tf_uv[2]); normalize_v2(av3); + sub_v2_v2v2(av4, tf_uv[2], tf_uv[3]); normalize_v2(av4); /* This is the correct angle however we are only comparing angles * uvang1 = 90-((angle_normalized_v2v2(av1, av2) * RAD2DEGF(1.0f))-90);*/ @@ -280,10 +280,10 @@ static void draw_uvs_stretch(SpaceImage *sima, Scene *scene, EditMesh *em, MTFac uvang4 = angle_normalized_v2v2(av4, av1); /* 3d angles */ - VECSUB(av1, efa->v4->co, efa->v1->co); normalize_v3(av1); - VECSUB(av2, efa->v1->co, efa->v2->co); normalize_v3(av2); - VECSUB(av3, efa->v2->co, efa->v3->co); normalize_v3(av3); - VECSUB(av4, efa->v3->co, efa->v4->co); normalize_v3(av4); + sub_v3_v3v3(av1, efa->v4->co, efa->v1->co); normalize_v3(av1); + sub_v3_v3v3(av2, efa->v1->co, efa->v2->co); normalize_v3(av2); + sub_v3_v3v3(av3, efa->v2->co, efa->v3->co); normalize_v3(av3); + sub_v3_v3v3(av4, efa->v3->co, efa->v4->co); normalize_v3(av4); /* This is the correct angle however we are only comparing angles * ang1 = 90-((angle_normalized_v3v3(av1, av2) * RAD2DEGF(1.0f))-90);*/ @@ -328,9 +328,9 @@ static void draw_uvs_stretch(SpaceImage *sima, Scene *scene, EditMesh *em, MTFac #endif /* uv angles */ - VECSUB2D(av1, tf_uv[2], tf_uv[0]); normalize_v2(av1); - VECSUB2D(av2, tf_uv[0], tf_uv[1]); normalize_v2(av2); - VECSUB2D(av3, tf_uv[1], tf_uv[2]); normalize_v2(av3); + sub_v2_v2v2(av1, tf_uv[2], tf_uv[0]); normalize_v2(av1); + sub_v2_v2v2(av2, tf_uv[0], tf_uv[1]); normalize_v2(av2); + sub_v2_v2v2(av3, tf_uv[1], tf_uv[2]); normalize_v2(av3); /* This is the correct angle however we are only comparing angles * uvang1 = 90-((angle_normalized_v2v2(av1, av2) * 180.0/M_PI)-90); */ @@ -339,9 +339,9 @@ static void draw_uvs_stretch(SpaceImage *sima, Scene *scene, EditMesh *em, MTFac uvang3 = angle_normalized_v2v2(av3, av1); /* 3d angles */ - VECSUB(av1, efa->v3->co, efa->v1->co); normalize_v3(av1); - VECSUB(av2, efa->v1->co, efa->v2->co); normalize_v3(av2); - VECSUB(av3, efa->v2->co, efa->v3->co); normalize_v3(av3); + sub_v3_v3v3(av1, efa->v3->co, efa->v1->co); normalize_v3(av1); + sub_v3_v3v3(av2, efa->v1->co, efa->v2->co); normalize_v3(av2); + sub_v3_v3v3(av3, efa->v2->co, efa->v3->co); normalize_v3(av3); /* This is the correct angle however we are only comparing angles * ang1 = 90-((angle_normalized_v3v3(av1, av2) * 180.0/M_PI)-90); */ ang1 = angle_normalized_v3v3(av1, av2); diff --git a/source/blender/nodes/composite/nodes/node_composite_normal.c b/source/blender/nodes/composite/nodes/node_composite_normal.c index a19b339e674..499f8ce300f 100644 --- a/source/blender/nodes/composite/nodes/node_composite_normal.c +++ b/source/blender/nodes/composite/nodes/node_composite_normal.c @@ -66,7 +66,7 @@ static void node_composit_exec_normal(void *UNUSED(data), bNode *node, bNodeStac if(in[0]->data==NULL) { VECCOPY(out[0]->vec, nor); /* render normals point inside... the widget points outside */ - out[1]->vec[0]= -INPR(out[0]->vec, in[0]->vec); + out[1]->vec[0]= -dot_v3v3(out[0]->vec, in[0]->vec); } else if(out[1]->hasoutput) { /* make output size of input image */ diff --git a/source/gameengine/Converter/BL_ActionActuator.cpp b/source/gameengine/Converter/BL_ActionActuator.cpp index a6d02db8cea..abc45293542 100644 --- a/source/gameengine/Converter/BL_ActionActuator.cpp +++ b/source/gameengine/Converter/BL_ActionActuator.cpp @@ -445,9 +445,9 @@ KX_PYMETHODDEF_DOC(BL_ActionActuator, setChannel, pchan= get_pose_channel(m_userpose, string); // adds the channel if its not there. if(pchan) { - VECCOPY (pchan->loc, matrix[3]); - mat4_to_size( pchan->size,matrix); - mat4_to_quat( pchan->quat,matrix); + copy_v3_v3(pchan->loc, matrix[3]); + mat4_to_size(pchan->size, matrix); + mat4_to_quat(pchan->quat, matrix); } } else {