Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2011-11-06 20:38:21 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-11-06 20:38:21 +0400
commit85540d5aa7abb487e546b5483fffeef2e6075af5 (patch)
tree61e47f78a9cbf29683434fa20c8a5f5d73da979e /source/blender/blenkernel/intern
parent7c88bc5952c7e9f8a7f48d00d94b335bd0169c2e (diff)
more macro --> BLI math lib, mainly replace VECCOPY in render and blenkernel.
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r--source/blender/blenkernel/intern/bvhutils.c4
-rw-r--r--source/blender/blenkernel/intern/cloth.c62
-rw-r--r--source/blender/blenkernel/intern/particle.c4
-rw-r--r--source/blender/blenkernel/intern/particle_system.c42
-rw-r--r--source/blender/blenkernel/intern/softbody.c270
-rw-r--r--source/blender/blenkernel/intern/subsurf_ccg.c2
-rw-r--r--source/blender/blenkernel/intern/texture.c2
7 files changed, 190 insertions, 196 deletions
diff --git a/source/blender/blenkernel/intern/bvhutils.c b/source/blender/blenkernel/intern/bvhutils.c
index 93abad8858f..1a27a640797 100644
--- a/source/blender/blenkernel/intern/bvhutils.c
+++ b/source/blender/blenkernel/intern/bvhutils.c
@@ -384,8 +384,8 @@ static float nearest_point_in_tri_surface(const float v0[3], const float v1[3],
mul_v3_fl(x, S);
copy_v3_v3(y, e1);
mul_v3_fl(y, T);
- VECADD(z, w, x);
- VECADD(z, z, y);
+ add_v3_v3v3(z, w, x);
+ add_v3_v3v3(z, z, y);
//sub_v3_v3v3(d, p, z);
copy_v3_v3(nearest, z);
// d = p - ( v0 + S * e0 + T * e1 );
diff --git a/source/blender/blenkernel/intern/cloth.c b/source/blender/blenkernel/intern/cloth.c
index f917a0fe68c..ae6a6ec012a 100644
--- a/source/blender/blenkernel/intern/cloth.c
+++ b/source/blender/blenkernel/intern/cloth.c
@@ -231,12 +231,12 @@ static BVHTree *bvhtree_build_from_cloth (ClothModifierData *clmd, float epsilon
// fill tree
for(i = 0; i < cloth->numfaces; i++, mfaces++)
{
- VECCOPY(&co[0*3], verts[mfaces->v1].xold);
- VECCOPY(&co[1*3], verts[mfaces->v2].xold);
- VECCOPY(&co[2*3], verts[mfaces->v3].xold);
+ copy_v3_v3(&co[0*3], verts[mfaces->v1].xold);
+ copy_v3_v3(&co[1*3], verts[mfaces->v2].xold);
+ copy_v3_v3(&co[2*3], verts[mfaces->v3].xold);
if(mfaces->v4)
- VECCOPY(&co[3*3], verts[mfaces->v4].xold);
+ copy_v3_v3(&co[3*3], verts[mfaces->v4].xold);
BLI_bvhtree_insert(bvhtree, i, co, (mfaces->v4 ? 4 : 3));
}
@@ -267,23 +267,23 @@ void bvhtree_update_from_cloth(ClothModifierData *clmd, int moving)
{
for(i = 0; i < cloth->numfaces; i++, mfaces++)
{
- VECCOPY(&co[0*3], verts[mfaces->v1].txold);
- VECCOPY(&co[1*3], verts[mfaces->v2].txold);
- VECCOPY(&co[2*3], verts[mfaces->v3].txold);
+ copy_v3_v3(&co[0*3], verts[mfaces->v1].txold);
+ copy_v3_v3(&co[1*3], verts[mfaces->v2].txold);
+ copy_v3_v3(&co[2*3], verts[mfaces->v3].txold);
if(mfaces->v4)
- VECCOPY(&co[3*3], verts[mfaces->v4].txold);
+ copy_v3_v3(&co[3*3], verts[mfaces->v4].txold);
// copy new locations into array
if(moving)
{
// update moving positions
- VECCOPY(&co_moving[0*3], verts[mfaces->v1].tx);
- VECCOPY(&co_moving[1*3], verts[mfaces->v2].tx);
- VECCOPY(&co_moving[2*3], verts[mfaces->v3].tx);
+ copy_v3_v3(&co_moving[0*3], verts[mfaces->v1].tx);
+ copy_v3_v3(&co_moving[1*3], verts[mfaces->v2].tx);
+ copy_v3_v3(&co_moving[2*3], verts[mfaces->v3].tx);
if(mfaces->v4)
- VECCOPY(&co_moving[3*3], verts[mfaces->v4].tx);
+ copy_v3_v3(&co_moving[3*3], verts[mfaces->v4].tx);
ret = BLI_bvhtree_update_node(bvhtree, i, co, co_moving, (mfaces->v4 ? 4 : 3));
}
@@ -321,13 +321,13 @@ void bvhselftree_update_from_cloth(ClothModifierData *clmd, int moving)
{
for(i = 0; i < cloth->numverts; i++, verts++)
{
- VECCOPY(&co[0*3], verts->txold);
+ copy_v3_v3(&co[0*3], verts->txold);
// copy new locations into array
if(moving)
{
// update moving positions
- VECCOPY(&co_moving[0*3], verts->tx);
+ copy_v3_v3(&co_moving[0*3], verts->tx);
ret = BLI_bvhtree_update_node(bvhtree, i, co, co_moving, 1);
}
@@ -399,11 +399,11 @@ static int do_step_cloth(Object *ob, ClothModifierData *clmd, DerivedMesh *resul
/* force any pinned verts to their constrained location. */
for(i = 0; i < clmd->clothObject->numverts; i++, verts++) {
/* save the previous position. */
- VECCOPY(verts->xold, verts->xconst);
- VECCOPY(verts->txold, verts->x);
+ copy_v3_v3(verts->xold, verts->xconst);
+ copy_v3_v3(verts->txold, verts->x);
/* Get the current position. */
- VECCOPY(verts->xconst, mvert[i].co);
+ copy_v3_v3(verts->xconst, mvert[i].co);
mul_m4_v3(ob->obmat, verts->xconst);
}
@@ -712,7 +712,7 @@ static void cloth_to_object (Object *ob, ClothModifierData *clmd, DerivedMesh *
for (i = 0; i < numverts; i++)
{
- VECCOPY (mvert[i].co, cloth->verts[i].x);
+ copy_v3_v3 (mvert[i].co, cloth->verts[i].x);
mul_m4_v3(ob->imat, mvert[i].co); /* cloth is in global coords */
}
}
@@ -880,14 +880,14 @@ static int cloth_from_object(Object *ob, ClothModifierData *clmd, DerivedMesh *d
verts->goal= 0.0f;
verts->flags = 0;
- VECCOPY ( verts->xold, verts->x );
- VECCOPY ( verts->xconst, verts->x );
- VECCOPY ( verts->txold, verts->x );
- VECCOPY ( verts->tx, verts->x );
+ copy_v3_v3 ( verts->xold, verts->x );
+ copy_v3_v3 ( verts->xconst, verts->x );
+ copy_v3_v3 ( verts->txold, verts->x );
+ copy_v3_v3 ( verts->tx, verts->x );
mul_v3_fl( verts->v, 0.0f );
verts->impulse_count = 0;
- VECCOPY ( verts->impulse, tnull );
+ copy_v3_v3 ( verts->impulse, tnull );
}
// apply / set vertex groups
@@ -1053,7 +1053,6 @@ static int cloth_build_springs ( ClothModifierData *clmd, DerivedMesh *dm )
LinkNode **edgelist = NULL;
EdgeHash *edgehash = NULL;
LinkNode *search = NULL, *search2 = NULL;
- float temp[3];
// error handling
if ( numedges==0 )
@@ -1086,8 +1085,7 @@ static int cloth_build_springs ( ClothModifierData *clmd, DerivedMesh *dm )
{
spring->ij = MIN2(medge[i].v1, medge[i].v2);
spring->kl = MAX2(medge[i].v2, medge[i].v1);
- VECSUB ( temp, cloth->verts[spring->kl].xrest, cloth->verts[spring->ij].xrest );
- spring->restlen = sqrt ( INPR ( temp, temp ) );
+ spring->restlen = len_v3v3(cloth->verts[spring->kl].xrest, cloth->verts[spring->ij].xrest);
clmd->sim_parms->avg_spring_len += spring->restlen;
cloth->verts[spring->ij].avg_spring_len += spring->restlen;
cloth->verts[spring->kl].avg_spring_len += spring->restlen;
@@ -1132,8 +1130,7 @@ static int cloth_build_springs ( ClothModifierData *clmd, DerivedMesh *dm )
spring->ij = MIN2(mface[i].v1, mface[i].v3);
spring->kl = MAX2(mface[i].v3, mface[i].v1);
- VECSUB ( temp, cloth->verts[spring->kl].xrest, cloth->verts[spring->ij].xrest );
- spring->restlen = sqrt ( INPR ( temp, temp ) );
+ spring->restlen = len_v3v3(cloth->verts[spring->kl].xrest, cloth->verts[spring->ij].xrest);
spring->type = CLOTH_SPRING_TYPE_SHEAR;
spring->stiffness = (cloth->verts[spring->kl].shear_stiff + cloth->verts[spring->ij].shear_stiff) / 2.0;
@@ -1155,8 +1152,7 @@ static int cloth_build_springs ( ClothModifierData *clmd, DerivedMesh *dm )
spring->ij = MIN2(mface[i].v2, mface[i].v4);
spring->kl = MAX2(mface[i].v4, mface[i].v2);
- VECSUB ( temp, cloth->verts[spring->kl].xrest, cloth->verts[spring->ij].xrest );
- spring->restlen = sqrt ( INPR ( temp, temp ) );
+ spring->restlen = len_v3v3(cloth->verts[spring->kl].xrest, cloth->verts[spring->ij].xrest);
spring->type = CLOTH_SPRING_TYPE_SHEAR;
spring->stiffness = (cloth->verts[spring->kl].shear_stiff + cloth->verts[spring->ij].shear_stiff) / 2.0;
@@ -1197,8 +1193,7 @@ static int cloth_build_springs ( ClothModifierData *clmd, DerivedMesh *dm )
spring->ij = MIN2(tspring2->ij, index2);
spring->kl = MAX2(tspring2->ij, index2);
- VECSUB ( temp, cloth->verts[spring->kl].xrest, cloth->verts[spring->ij].xrest );
- spring->restlen = sqrt ( INPR ( temp, temp ) );
+ spring->restlen = len_v3v3(cloth->verts[spring->kl].xrest, cloth->verts[spring->ij].xrest);
spring->type = CLOTH_SPRING_TYPE_BENDING;
spring->stiffness = (cloth->verts[spring->kl].bend_stiff + cloth->verts[spring->ij].bend_stiff) / 2.0;
BLI_edgehash_insert ( edgehash, spring->ij, spring->kl, NULL );
@@ -1237,8 +1232,7 @@ static int cloth_build_springs ( ClothModifierData *clmd, DerivedMesh *dm )
spring->ij = tspring2->ij;
spring->kl = tspring->kl;
- VECSUB ( temp, cloth->verts[spring->kl].xrest, cloth->verts[spring->ij].xrest );
- spring->restlen = sqrt ( INPR ( temp, temp ) );
+ spring->restlen = len_v3v3(cloth->verts[spring->kl].xrest, cloth->verts[spring->ij].xrest);
spring->type = CLOTH_SPRING_TYPE_BENDING;
spring->stiffness = (cloth->verts[spring->kl].bend_stiff + cloth->verts[spring->ij].bend_stiff) / 2.0;
bend_springs++;
diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c
index 3b6fc09ad4f..56e4c91ba5e 100644
--- a/source/blender/blenkernel/intern/particle.c
+++ b/source/blender/blenkernel/intern/particle.c
@@ -1663,7 +1663,7 @@ static int psys_map_index_on_dm(DerivedMesh *dm, int from, int index, int index_
return 0;
*mapindex = index;
- QUATCOPY(mapfw, fw);
+ copy_v4_v4(mapfw, fw);
}
} else {
/* for other meshes that have been modified, we try to map the particle
@@ -2835,7 +2835,7 @@ static void cache_key_incremental_rotation(ParticleCacheKey *key0, ParticleCache
* angle, since floating point accuracy makes it give
* different results across platforms */
if(cosangle > 0.999999f) {
- QUATCOPY(key1->rot, key2->rot);
+ copy_v4_v4(key1->rot, key2->rot);
}
else {
angle= saacos(cosangle);
diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c
index f92fb4444cc..3e88fb7d65e 100644
--- a/source/blender/blenkernel/intern/particle_system.c
+++ b/source/blender/blenkernel/intern/particle_system.c
@@ -815,7 +815,7 @@ static void distribute_threads_exec(ParticleThread *thread, ParticleData *pa, Ch
normalize_v3(nor);
mul_v3_fl(nor,-100.0);
- VECADD(co2,co1,nor);
+ add_v3_v3v3(co2,co1,nor);
min_d=2.0;
intersect=0;
@@ -1099,11 +1099,11 @@ static int distribute_threads_init_data(ParticleThread *threads, Scene *scene, D
for(p=0; p<totvert; p++) {
if(orcodata) {
- VECCOPY(co,orcodata[p])
+ copy_v3_v3(co,orcodata[p]);
transform_mesh_orco_verts((Mesh*)ob->data, &co, 1, 1);
}
else
- VECCOPY(co,mv[p].co)
+ copy_v3_v3(co,mv[p].co);
BLI_kdtree_insert(tree,p,co,NULL);
}
@@ -1141,14 +1141,14 @@ static int distribute_threads_init_data(ParticleThread *threads, Scene *scene, D
MFace *mf=dm->getFaceData(dm,i,CD_MFACE);
if(orcodata) {
- VECCOPY(co1, orcodata[mf->v1]);
- VECCOPY(co2, orcodata[mf->v2]);
- VECCOPY(co3, orcodata[mf->v3]);
+ copy_v3_v3(co1, orcodata[mf->v1]);
+ copy_v3_v3(co2, orcodata[mf->v2]);
+ copy_v3_v3(co3, orcodata[mf->v3]);
transform_mesh_orco_verts((Mesh*)ob->data, &co1, 1, 1);
transform_mesh_orco_verts((Mesh*)ob->data, &co2, 1, 1);
transform_mesh_orco_verts((Mesh*)ob->data, &co3, 1, 1);
if(mf->v4) {
- VECCOPY(co4, orcodata[mf->v4]);
+ copy_v3_v3(co4, orcodata[mf->v4]);
transform_mesh_orco_verts((Mesh*)ob->data, &co4, 1, 1);
}
}
@@ -1156,12 +1156,12 @@ static int distribute_threads_init_data(ParticleThread *threads, Scene *scene, D
v1= (MVert*)dm->getVertData(dm,mf->v1,CD_MVERT);
v2= (MVert*)dm->getVertData(dm,mf->v2,CD_MVERT);
v3= (MVert*)dm->getVertData(dm,mf->v3,CD_MVERT);
- VECCOPY(co1, v1->co);
- VECCOPY(co2, v2->co);
- VECCOPY(co3, v3->co);
+ copy_v3_v3(co1, v1->co);
+ copy_v3_v3(co2, v2->co);
+ copy_v3_v3(co3, v3->co);
if(mf->v4) {
v4= (MVert*)dm->getVertData(dm,mf->v4,CD_MVERT);
- VECCOPY(co4, v4->co);
+ copy_v3_v3(co4, v4->co);
}
}
@@ -1648,7 +1648,7 @@ void psys_get_birth_coordinates(ParticleSimulationData *sim, ParticleData *pa, P
normalize_v3(state->ave);
}
else {
- VECCOPY(state->ave, nor);
+ copy_v3_v3(state->ave, nor);
}
/* calculate rotation matrix */
@@ -2423,7 +2423,7 @@ static void sph_force_cb(void *sphdata_v, ParticleKey *state, float *force, floa
pfr.element_size = MAXFLOAT;
}
sphdata->element_size = pfr.element_size;
- VECCOPY(sphdata->flow, pfr.flow);
+ copy_v3_v3(sphdata->flow, pfr.flow);
pressure = stiffness * (pfr.density - rest_density);
near_pressure = stiffness_near_fac * pfr.near_density;
@@ -2520,7 +2520,7 @@ static void sph_integrate(ParticleSimulationData *sim, ParticleData *pa, float d
integrate_particle(part, pa, dtime, effector_acceleration, sph_force_cb, &sphdata);
*element_size = sphdata.element_size;
- VECCOPY(flow, sphdata.flow);
+ copy_v3_v3(flow, sphdata.flow);
}
/************************************************/
@@ -2592,19 +2592,19 @@ static void basic_integrate(ParticleSimulationData *sim, int p, float dfra, floa
if(part->dampfac != 0.f)
mul_v3_fl(pa->state.vel, 1.f - part->dampfac * efdata.ptex.damp * 25.f * dtime);
- //VECCOPY(pa->state.ave, states->ave);
+ //copy_v3_v3(pa->state.ave, states->ave);
/* finally we do guides */
time=(cfra-pa->time)/pa->lifetime;
CLAMP(time, 0.0f, 1.0f);
- VECCOPY(tkey.co,pa->state.co);
- VECCOPY(tkey.vel,pa->state.vel);
+ copy_v3_v3(tkey.co,pa->state.co);
+ copy_v3_v3(tkey.vel,pa->state.vel);
tkey.time=pa->state.time;
if(part->type != PART_HAIR) {
if(do_guides(sim->psys->effectors, &tkey, p, time)) {
- VECCOPY(pa->state.co,tkey.co);
+ copy_v3_v3(pa->state.co,tkey.co);
/* guides don't produce valid velocity */
sub_v3_v3v3(pa->state.vel, tkey.co, pa->prev_state.co);
mul_v3_fl(pa->state.vel,1.0f/dtime);
@@ -3472,8 +3472,8 @@ static void do_hair_dynamics(ParticleSimulationData *sim)
if(k==0) {
float temp[3];
sub_v3_v3v3(temp, key->co, (key+1)->co);
- VECCOPY(mvert->co, key->co);
- VECADD(mvert->co, mvert->co, temp);
+ copy_v3_v3(mvert->co, key->co);
+ add_v3_v3v3(mvert->co, mvert->co, temp);
mul_m4_v3(hairmat, mvert->co);
mvert++;
@@ -3492,7 +3492,7 @@ static void do_hair_dynamics(ParticleSimulationData *sim)
}
}
- VECCOPY(mvert->co, key->co);
+ copy_v3_v3(mvert->co, key->co);
mul_m4_v3(hairmat, mvert->co);
mvert++;
diff --git a/source/blender/blenkernel/intern/softbody.c b/source/blender/blenkernel/intern/softbody.c
index accf3e442e8..5b02731050e 100644
--- a/source/blender/blenkernel/intern/softbody.c
+++ b/source/blender/blenkernel/intern/softbody.c
@@ -321,7 +321,7 @@ static ccd_Mesh *ccd_mesh_make(Object *ob)
/* determine the ortho BB */
for(i=0; i < pccd_M->totvert; i++){
/* evaluate limits */
- VECCOPY(v,pccd_M->mvert[i].co);
+ copy_v3_v3(v,pccd_M->mvert[i].co);
pccd_M->bbmin[0] = MIN2(pccd_M->bbmin[0],v[0]-hull);
pccd_M->bbmin[1] = MIN2(pccd_M->bbmin[1],v[1]-hull);
pccd_M->bbmin[2] = MIN2(pccd_M->bbmin[2],v[2]-hull);
@@ -345,7 +345,7 @@ static ccd_Mesh *ccd_mesh_make(Object *ob)
mima->minx=mima->miny=mima->minz=1e30f;
mima->maxx=mima->maxy=mima->maxz=-1e30f;
- VECCOPY(v,pccd_M->mvert[mface->v1].co);
+ copy_v3_v3(v,pccd_M->mvert[mface->v1].co);
mima->minx = MIN2(mima->minx,v[0]-hull);
mima->miny = MIN2(mima->miny,v[1]-hull);
mima->minz = MIN2(mima->minz,v[2]-hull);
@@ -353,7 +353,7 @@ static ccd_Mesh *ccd_mesh_make(Object *ob)
mima->maxy = MAX2(mima->maxy,v[1]+hull);
mima->maxz = MAX2(mima->maxz,v[2]+hull);
- VECCOPY(v,pccd_M->mvert[mface->v2].co);
+ copy_v3_v3(v,pccd_M->mvert[mface->v2].co);
mima->minx = MIN2(mima->minx,v[0]-hull);
mima->miny = MIN2(mima->miny,v[1]-hull);
mima->minz = MIN2(mima->minz,v[2]-hull);
@@ -361,7 +361,7 @@ static ccd_Mesh *ccd_mesh_make(Object *ob)
mima->maxy = MAX2(mima->maxy,v[1]+hull);
mima->maxz = MAX2(mima->maxz,v[2]+hull);
- VECCOPY(v,pccd_M->mvert[mface->v3].co);
+ copy_v3_v3(v,pccd_M->mvert[mface->v3].co);
mima->minx = MIN2(mima->minx,v[0]-hull);
mima->miny = MIN2(mima->miny,v[1]-hull);
mima->minz = MIN2(mima->minz,v[2]-hull);
@@ -370,7 +370,7 @@ static ccd_Mesh *ccd_mesh_make(Object *ob)
mima->maxz = MAX2(mima->maxz,v[2]+hull);
if(mface->v4){
- VECCOPY(v,pccd_M->mvert[mface->v4].co);
+ copy_v3_v3(v,pccd_M->mvert[mface->v4].co);
mima->minx = MIN2(mima->minx,v[0]-hull);
mima->miny = MIN2(mima->miny,v[1]-hull);
mima->minz = MIN2(mima->minz,v[2]-hull);
@@ -419,7 +419,7 @@ static void ccd_mesh_update(Object *ob,ccd_Mesh *pccd_M)
/* determine the ortho BB */
for(i=0; i < pccd_M->totvert; i++){
/* evaluate limits */
- VECCOPY(v,pccd_M->mvert[i].co);
+ copy_v3_v3(v,pccd_M->mvert[i].co);
pccd_M->bbmin[0] = MIN2(pccd_M->bbmin[0],v[0]-hull);
pccd_M->bbmin[1] = MIN2(pccd_M->bbmin[1],v[1]-hull);
pccd_M->bbmin[2] = MIN2(pccd_M->bbmin[2],v[2]-hull);
@@ -429,7 +429,7 @@ static void ccd_mesh_update(Object *ob,ccd_Mesh *pccd_M)
pccd_M->bbmax[2] = MAX2(pccd_M->bbmax[2],v[2]+hull);
/* evaluate limits */
- VECCOPY(v,pccd_M->mprevvert[i].co);
+ copy_v3_v3(v,pccd_M->mprevvert[i].co);
pccd_M->bbmin[0] = MIN2(pccd_M->bbmin[0],v[0]-hull);
pccd_M->bbmin[1] = MIN2(pccd_M->bbmin[1],v[1]-hull);
pccd_M->bbmin[2] = MIN2(pccd_M->bbmin[2],v[2]-hull);
@@ -449,7 +449,7 @@ static void ccd_mesh_update(Object *ob,ccd_Mesh *pccd_M)
mima->minx=mima->miny=mima->minz=1e30f;
mima->maxx=mima->maxy=mima->maxz=-1e30f;
- VECCOPY(v,pccd_M->mvert[mface->v1].co);
+ copy_v3_v3(v,pccd_M->mvert[mface->v1].co);
mima->minx = MIN2(mima->minx,v[0]-hull);
mima->miny = MIN2(mima->miny,v[1]-hull);
mima->minz = MIN2(mima->minz,v[2]-hull);
@@ -457,7 +457,7 @@ static void ccd_mesh_update(Object *ob,ccd_Mesh *pccd_M)
mima->maxy = MAX2(mima->maxy,v[1]+hull);
mima->maxz = MAX2(mima->maxz,v[2]+hull);
- VECCOPY(v,pccd_M->mvert[mface->v2].co);
+ copy_v3_v3(v,pccd_M->mvert[mface->v2].co);
mima->minx = MIN2(mima->minx,v[0]-hull);
mima->miny = MIN2(mima->miny,v[1]-hull);
mima->minz = MIN2(mima->minz,v[2]-hull);
@@ -465,7 +465,7 @@ static void ccd_mesh_update(Object *ob,ccd_Mesh *pccd_M)
mima->maxy = MAX2(mima->maxy,v[1]+hull);
mima->maxz = MAX2(mima->maxz,v[2]+hull);
- VECCOPY(v,pccd_M->mvert[mface->v3].co);
+ copy_v3_v3(v,pccd_M->mvert[mface->v3].co);
mima->minx = MIN2(mima->minx,v[0]-hull);
mima->miny = MIN2(mima->miny,v[1]-hull);
mima->minz = MIN2(mima->minz,v[2]-hull);
@@ -474,7 +474,7 @@ static void ccd_mesh_update(Object *ob,ccd_Mesh *pccd_M)
mima->maxz = MAX2(mima->maxz,v[2]+hull);
if(mface->v4){
- VECCOPY(v,pccd_M->mvert[mface->v4].co);
+ copy_v3_v3(v,pccd_M->mvert[mface->v4].co);
mima->minx = MIN2(mima->minx,v[0]-hull);
mima->miny = MIN2(mima->miny,v[1]-hull);
mima->minz = MIN2(mima->minz,v[2]-hull);
@@ -484,7 +484,7 @@ static void ccd_mesh_update(Object *ob,ccd_Mesh *pccd_M)
}
- VECCOPY(v,pccd_M->mprevvert[mface->v1].co);
+ copy_v3_v3(v,pccd_M->mprevvert[mface->v1].co);
mima->minx = MIN2(mima->minx,v[0]-hull);
mima->miny = MIN2(mima->miny,v[1]-hull);
mima->minz = MIN2(mima->minz,v[2]-hull);
@@ -492,7 +492,7 @@ static void ccd_mesh_update(Object *ob,ccd_Mesh *pccd_M)
mima->maxy = MAX2(mima->maxy,v[1]+hull);
mima->maxz = MAX2(mima->maxz,v[2]+hull);
- VECCOPY(v,pccd_M->mprevvert[mface->v2].co);
+ copy_v3_v3(v,pccd_M->mprevvert[mface->v2].co);
mima->minx = MIN2(mima->minx,v[0]-hull);
mima->miny = MIN2(mima->miny,v[1]-hull);
mima->minz = MIN2(mima->minz,v[2]-hull);
@@ -500,7 +500,7 @@ static void ccd_mesh_update(Object *ob,ccd_Mesh *pccd_M)
mima->maxy = MAX2(mima->maxy,v[1]+hull);
mima->maxz = MAX2(mima->maxz,v[2]+hull);
- VECCOPY(v,pccd_M->mprevvert[mface->v3].co);
+ copy_v3_v3(v,pccd_M->mprevvert[mface->v3].co);
mima->minx = MIN2(mima->minx,v[0]-hull);
mima->miny = MIN2(mima->miny,v[1]-hull);
mima->minz = MIN2(mima->minz,v[2]-hull);
@@ -509,7 +509,7 @@ static void ccd_mesh_update(Object *ob,ccd_Mesh *pccd_M)
mima->maxz = MAX2(mima->maxz,v[2]+hull);
if(mface->v4){
- VECCOPY(v,pccd_M->mprevvert[mface->v4].co);
+ copy_v3_v3(v,pccd_M->mprevvert[mface->v4].co);
mima->minx = MIN2(mima->minx,v[0]-hull);
mima->miny = MIN2(mima->miny,v[1]-hull);
mima->minz = MIN2(mima->minz,v[2]-hull);
@@ -1024,8 +1024,8 @@ static int sb_detect_aabb_collisionCached( float UNUSED(force[3]), unsigned int
#endif
if ((sb == NULL) || (sb->scratch ==NULL)) return 0;
- VECCOPY(aabbmin,sb->scratch->aabbmin);
- VECCOPY(aabbmax,sb->scratch->aabbmax);
+ copy_v3_v3(aabbmin,sb->scratch->aabbmin);
+ copy_v3_v3(aabbmax,sb->scratch->aabbmax);
hash = vertexowner->soft->scratch->colliderhash;
ihash = BLI_ghashIterator_new(hash);
@@ -1099,8 +1099,8 @@ static int sb_detect_face_pointCached(float face_v1[3],float face_v2[3],float fa
aabbmax[2] = MAX3(face_v1[2],face_v2[2],face_v3[2]);
/* calculate face normal once again SIGH */
- VECSUB(edge1, face_v1, face_v2);
- VECSUB(edge2, face_v3, face_v2);
+ sub_v3_v3v3(edge1, face_v1, face_v2);
+ sub_v3_v3v3(edge2, face_v3, face_v2);
cross_v3_v3v3(d_nvect, edge2, edge1);
normalize_v3(d_nvect);
@@ -1143,13 +1143,13 @@ static int sb_detect_face_pointCached(float face_v1[3],float face_v2[3],float fa
/* use mesh*/
if (mvert) {
while(a){
- VECCOPY(nv1,mvert[a-1].co);
+ copy_v3_v3(nv1,mvert[a-1].co);
if(mprevvert){
mul_v3_fl(nv1,time);
Vec3PlusStVec(nv1,(1.0f-time),mprevvert[a-1].co);
}
/* origin to face_v2*/
- VECSUB(nv1, nv1, face_v2);
+ sub_v3_v3(nv1, face_v2);
facedist = dot_v3v3(nv1,d_nvect);
if (ABS(facedist)<outerfacethickness){
if (isect_point_tri_prism_v3(nv1, face_v1,face_v2,face_v3) ){
@@ -1253,11 +1253,11 @@ static int sb_detect_face_collisionCached(float face_v1[3],float face_v2[3],floa
if (mvert){
- VECCOPY(nv1,mvert[mface->v1].co);
- VECCOPY(nv2,mvert[mface->v2].co);
- VECCOPY(nv3,mvert[mface->v3].co);
+ copy_v3_v3(nv1,mvert[mface->v1].co);
+ copy_v3_v3(nv2,mvert[mface->v2].co);
+ copy_v3_v3(nv3,mvert[mface->v3].co);
if (mface->v4){
- VECCOPY(nv4,mvert[mface->v4].co);
+ copy_v3_v3(nv4,mvert[mface->v4].co);
}
if (mprevvert){
mul_v3_fl(nv1,time);
@@ -1277,8 +1277,8 @@ static int sb_detect_face_collisionCached(float face_v1[3],float face_v2[3],floa
}
/* switch origin to be nv2*/
- VECSUB(edge1, nv1, nv2);
- VECSUB(edge2, nv3, nv2);
+ sub_v3_v3v3(edge1, nv1, nv2);
+ sub_v3_v3v3(edge2, nv3, nv2);
cross_v3_v3v3(d_nvect, edge2, edge1);
normalize_v3(d_nvect);
if (
@@ -1291,8 +1291,8 @@ static int sb_detect_face_collisionCached(float face_v1[3],float face_v2[3],floa
}
if (mface->v4){ /* quad */
/* switch origin to be nv4 */
- VECSUB(edge1, nv3, nv4);
- VECSUB(edge2, nv1, nv4);
+ sub_v3_v3v3(edge1, nv3, nv4);
+ sub_v3_v3v3(edge2, nv1, nv4);
cross_v3_v3v3(d_nvect, edge2, edge1);
normalize_v3(d_nvect);
if (
@@ -1481,11 +1481,11 @@ static int sb_detect_edge_collisionCached(float edge_v1[3],float edge_v2[3],floa
if (mvert){
- VECCOPY(nv1,mvert[mface->v1].co);
- VECCOPY(nv2,mvert[mface->v2].co);
- VECCOPY(nv3,mvert[mface->v3].co);
+ copy_v3_v3(nv1,mvert[mface->v1].co);
+ copy_v3_v3(nv2,mvert[mface->v2].co);
+ copy_v3_v3(nv3,mvert[mface->v3].co);
if (mface->v4){
- VECCOPY(nv4,mvert[mface->v4].co);
+ copy_v3_v3(nv4,mvert[mface->v4].co);
}
if (mprevvert){
mul_v3_fl(nv1,time);
@@ -1505,16 +1505,16 @@ static int sb_detect_edge_collisionCached(float edge_v1[3],float edge_v2[3],floa
}
/* switch origin to be nv2*/
- VECSUB(edge1, nv1, nv2);
- VECSUB(edge2, nv3, nv2);
+ sub_v3_v3v3(edge1, nv1, nv2);
+ sub_v3_v3v3(edge2, nv3, nv2);
cross_v3_v3v3(d_nvect, edge2, edge1);
normalize_v3(d_nvect);
if ( isect_line_tri_v3(edge_v1, edge_v2, nv1, nv2, nv3, &t, NULL)){
float v1[3],v2[3];
float intrusiondepth,i1,i2;
- VECSUB(v1, edge_v1, nv2);
- VECSUB(v2, edge_v2, nv2);
+ sub_v3_v3v3(v1, edge_v1, nv2);
+ sub_v3_v3v3(v2, edge_v2, nv2);
i1 = dot_v3v3(v1,d_nvect);
i2 = dot_v3v3(v2,d_nvect);
intrusiondepth = -MIN2(i1,i2)/el;
@@ -1524,16 +1524,16 @@ static int sb_detect_edge_collisionCached(float edge_v1[3],float edge_v2[3],floa
}
if (mface->v4){ /* quad */
/* switch origin to be nv4 */
- VECSUB(edge1, nv3, nv4);
- VECSUB(edge2, nv1, nv4);
+ sub_v3_v3v3(edge1, nv3, nv4);
+ sub_v3_v3v3(edge2, nv1, nv4);
cross_v3_v3v3(d_nvect, edge2, edge1);
normalize_v3(d_nvect);
if (isect_line_tri_v3( edge_v1, edge_v2,nv1, nv3, nv4, &t, NULL)){
float v1[3],v2[3];
float intrusiondepth,i1,i2;
- VECSUB(v1, edge_v1, nv4);
- VECSUB(v2, edge_v2, nv4);
+ sub_v3_v3v3(v1, edge_v1, nv4);
+ sub_v3_v3v3(v2, edge_v2, nv4);
i1 = dot_v3v3(v1,d_nvect);
i2 = dot_v3v3(v2,d_nvect);
intrusiondepth = -MIN2(i1,i2)/el;
@@ -1602,16 +1602,16 @@ static void _scan_for_ext_spring_forces(Scene *scene, Object *ob, float timenow,
}
/* media in rest */
else{
- VECADD(vel, sb->bpoint[bs->v1].vec , sb->bpoint[bs->v2].vec);
+ add_v3_v3v3(vel, sb->bpoint[bs->v1].vec , sb->bpoint[bs->v2].vec);
}
f = normalize_v3(vel);
f = -0.0001f*f*f*sb->aeroedge;
/* (todo) add a nice angle dependant function done for now BUT */
/* still there could be some nice drag/lift function, but who needs it */
- VECSUB(sp, sb->bpoint[bs->v1].pos , sb->bpoint[bs->v2].pos);
+ sub_v3_v3v3(sp, sb->bpoint[bs->v1].pos , sb->bpoint[bs->v2].pos);
project_v3_v3v3(pr,vel,sp);
- VECSUB(vel,vel,pr);
+ sub_v3_v3(vel, pr);
normalize_v3(vel);
if (ob->softflag & OB_SB_AERO_ANGLE){
normalize_v3(sp);
@@ -1725,9 +1725,9 @@ static int choose_winner(float*w, float* pos,float*a,float*b,float*c,float*ca,fl
winner =3;
}
switch (winner){
- case 1: VECCOPY(w,ca); break;
- case 2: VECCOPY(w,cb); break;
- case 3: VECCOPY(w,cc);
+ case 1: copy_v3_v3(w,ca); break;
+ case 2: copy_v3_v3(w,cb); break;
+ case 3: copy_v3_v3(w,cc);
}
return(winner);
}
@@ -1824,11 +1824,11 @@ static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3],
if (mvert){
- VECCOPY(nv1,mvert[mface->v1].co);
- VECCOPY(nv2,mvert[mface->v2].co);
- VECCOPY(nv3,mvert[mface->v3].co);
+ copy_v3_v3(nv1,mvert[mface->v1].co);
+ copy_v3_v3(nv2,mvert[mface->v2].co);
+ copy_v3_v3(nv3,mvert[mface->v3].co);
if (mface->v4){
- VECCOPY(nv4,mvert[mface->v4].co);
+ copy_v3_v3(nv4,mvert[mface->v4].co);
}
if (mprevvert){
@@ -1838,11 +1838,11 @@ static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3],
since the AABB reduced propabitlty to get here drasticallly
it might be a nice tradeof CPU <--> memory
*/
- VECSUB(vv1,nv1,mprevvert[mface->v1].co);
- VECSUB(vv2,nv2,mprevvert[mface->v2].co);
- VECSUB(vv3,nv3,mprevvert[mface->v3].co);
+ sub_v3_v3v3(vv1,nv1,mprevvert[mface->v1].co);
+ sub_v3_v3v3(vv2,nv2,mprevvert[mface->v2].co);
+ sub_v3_v3v3(vv3,nv3,mprevvert[mface->v3].co);
if (mface->v4){
- VECSUB(vv4,nv4,mprevvert[mface->v4].co);
+ sub_v3_v3v3(vv4,nv4,mprevvert[mface->v4].co);
}
mul_v3_fl(nv1,time);
@@ -1862,9 +1862,9 @@ static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3],
}
/* switch origin to be nv2*/
- VECSUB(edge1, nv1, nv2);
- VECSUB(edge2, nv3, nv2);
- VECSUB(dv1,opco,nv2); /* abuse dv1 to have vertex in question at *origin* of triangle */
+ sub_v3_v3v3(edge1, nv1, nv2);
+ sub_v3_v3v3(edge2, nv3, nv2);
+ sub_v3_v3v3(dv1,opco,nv2); /* abuse dv1 to have vertex in question at *origin* of triangle */
cross_v3_v3v3(d_nvect, edge2, edge1);
/* n_mag = */ /* UNUSED */ normalize_v3(d_nvect);
@@ -1890,7 +1890,7 @@ static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3],
}
if ((mprevvert) && (*damp > 0.0f)){
choose_winner(ve,opco,nv1,nv2,nv3,vv1,vv2,vv3);
- VECADD(avel,avel,ve);
+ add_v3_v3(avel, ve);
cavel ++;
}
*intrusion += facedist;
@@ -1899,9 +1899,9 @@ static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3],
}
if (mface->v4){ /* quad */
/* switch origin to be nv4 */
- VECSUB(edge1, nv3, nv4);
- VECSUB(edge2, nv1, nv4);
- VECSUB(dv1,opco,nv4); /* abuse dv1 to have vertex in question at *origin* of triangle */
+ sub_v3_v3v3(edge1, nv3, nv4);
+ sub_v3_v3v3(edge2, nv1, nv4);
+ sub_v3_v3v3(dv1,opco,nv4); /* abuse dv1 to have vertex in question at *origin* of triangle */
cross_v3_v3v3(d_nvect, edge2, edge1);
/* n_mag = */ /* UNUSED */ normalize_v3(d_nvect);
@@ -1926,7 +1926,7 @@ static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3],
if ((mprevvert) && (*damp > 0.0f)){
choose_winner(ve,opco,nv1,nv3,nv4,vv1,vv3,vv4);
- VECADD(avel,avel,ve);
+ add_v3_v3(avel, ve);
cavel ++;
}
*intrusion += facedist;
@@ -1939,46 +1939,46 @@ static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3],
float dist;
closest_to_line_segment_v3(ve, opco, nv1, nv2);
- VECSUB(ve,opco,ve);
+ sub_v3_v3v3(ve,opco,ve);
dist = normalize_v3(ve);
if ((dist < outerfacethickness)&&(dist < mindistedge )){
- VECCOPY(coledge,ve);
+ copy_v3_v3(coledge,ve);
mindistedge = dist,
deflected=1;
}
closest_to_line_segment_v3(ve, opco, nv2, nv3);
- VECSUB(ve,opco,ve);
+ sub_v3_v3v3(ve,opco,ve);
dist = normalize_v3(ve);
if ((dist < outerfacethickness)&&(dist < mindistedge )){
- VECCOPY(coledge,ve);
+ copy_v3_v3(coledge,ve);
mindistedge = dist,
deflected=1;
}
closest_to_line_segment_v3(ve, opco, nv3, nv1);
- VECSUB(ve,opco,ve);
+ sub_v3_v3v3(ve,opco,ve);
dist = normalize_v3(ve);
if ((dist < outerfacethickness)&&(dist < mindistedge )){
- VECCOPY(coledge,ve);
+ copy_v3_v3(coledge,ve);
mindistedge = dist,
deflected=1;
}
if (mface->v4){ /* quad */
closest_to_line_segment_v3(ve, opco, nv3, nv4);
- VECSUB(ve,opco,ve);
+ sub_v3_v3v3(ve,opco,ve);
dist = normalize_v3(ve);
if ((dist < outerfacethickness)&&(dist < mindistedge )){
- VECCOPY(coledge,ve);
+ copy_v3_v3(coledge,ve);
mindistedge = dist,
deflected=1;
}
closest_to_line_segment_v3(ve, opco, nv1, nv4);
- VECSUB(ve,opco,ve);
+ sub_v3_v3v3(ve,opco,ve);
dist = normalize_v3(ve);
if ((dist < outerfacethickness)&&(dist < mindistedge )){
- VECCOPY(coledge,ve);
+ copy_v3_v3(coledge,ve);
mindistedge = dist,
deflected=1;
}
@@ -2007,15 +2007,15 @@ static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3],
}
if (deflected == 2){ // face inner detected
- VECADD(force,force,innerforceaccu);
+ add_v3_v3(force, innerforceaccu);
}
if (deflected == 3){ // face outer detected
- VECADD(force,force,outerforceaccu);
+ add_v3_v3(force, outerforceaccu);
}
BLI_ghashIterator_free(ihash);
if (cavel) mul_v3_fl(avel,1.0f/(float)cavel);
- VECCOPY(vel,avel);
+ copy_v3_v3(vel,avel);
if (ci) *intrusion /= ci;
if (deflected){
normalize_v3_v3(facenormal, force);
@@ -2029,7 +2029,7 @@ static int sb_deflect_face(Object *ob,float *actpos,float *facenormal,float *for
{
float s_actpos[3];
int deflected;
- VECCOPY(s_actpos,actpos);
+ copy_v3_v3(s_actpos,actpos);
deflected= sb_detect_vertex_collisionCached(s_actpos, facenormal, cf, force , ob->lay, ob,time,vel,intrusion);
//deflected= sb_detect_vertex_collisionCachedEx(s_actpos, facenormal, cf, force , ob->lay, ob,time,vel,intrusion);
return(deflected);
@@ -2286,7 +2286,7 @@ static int _softbody_calc_forces_slice_in_a_thread(Scene *scene, Object *ob, flo
/* gravitation */
if (sb && scene->physics_settings.flag & PHYS_GLOBAL_GRAVITY){
float gravity[3];
- VECCOPY(gravity, scene->physics_settings.gravity);
+ copy_v3_v3(gravity, scene->physics_settings.gravity);
mul_v3_fl(gravity, sb_grav_force_scale(ob)*_final_mass(ob,bp)*sb->effector_weights->global_gravity); /* individual mass of node here */
add_v3_v3(bp->force, gravity);
}
@@ -2303,7 +2303,7 @@ static int _softbody_calc_forces_slice_in_a_thread(Scene *scene, Object *ob, flo
/* apply forcefield*/
mul_v3_fl(force,fieldfactor* eval_sb_fric_force_scale);
- VECADD(bp->force, bp->force, force);
+ add_v3_v3(bp->force, force);
/* BP friction in moving media */
kd= sb->mediafrict* eval_sb_fric_force_scale;
@@ -2337,7 +2337,7 @@ static int _softbody_calc_forces_slice_in_a_thread(Scene *scene, Object *ob, flo
bp->choke = sb->choke*0.01f;
}
- VECSUB(cfforce,bp->vec,vel);
+ sub_v3_v3v3(cfforce,bp->vec,vel);
Vec3PlusStVec(bp->force,-cf*50.0f,cfforce);
Vec3PlusStVec(bp->force,kd,defforce);
@@ -2524,7 +2524,7 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa
if (scene->physics_settings.flag & PHYS_GLOBAL_GRAVITY){
- VECCOPY(gravity, scene->physics_settings.gravity);
+ copy_v3_v3(gravity, scene->physics_settings.gravity);
mul_v3_fl(gravity, sb_grav_force_scale(ob)*sb->effector_weights->global_gravity);
}
@@ -2711,7 +2711,7 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa
/* apply forcefield*/
mul_v3_fl(force,fieldfactor* eval_sb_fric_force_scale);
- VECADD(bp->force, bp->force, force);
+ add_v3_v3(bp->force, force);
/* BP friction in moving media */
kd= sb->mediafrict* eval_sb_fric_force_scale;
@@ -2764,7 +2764,7 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa
}
else{
- VECSUB(cfforce,bp->vec,vel);
+ sub_v3_v3v3(cfforce,bp->vec,vel);
Vec3PlusStVec(bp->force,-cf*50.0f,cfforce);
}
@@ -2774,7 +2774,7 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa
bp->choke = sb->choke*0.01f;
}
else{
- VECSUB(cfforce,bp->vec,vel);
+ sub_v3_v3v3(cfforce,bp->vec,vel);
Vec3PlusStVec(bp->force,-cf*50.0f,cfforce);
}
Vec3PlusStVec(bp->force,kd,defforce);
@@ -2876,7 +2876,7 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa
else{
printf("Matrix inversion failed \n");
for(a=sb->totpoint, bp= sb->bpoint; a>0; a--, bp++) {
- VECCOPY(bp->impdv,bp->force);
+ copy_v3_v3(bp->impdv,bp->force);
}
}
@@ -2923,7 +2923,7 @@ static void softbody_apply_forces(Object *ob, float forcetime, int mode, float *
if(_final_goal(ob,bp) < SOFTGOALSNAP){
/* this makes t~ = t */
- if(mid_flags & MID_PRESERVE) VECCOPY(dx,bp->vec);
+ if(mid_flags & MID_PRESERVE) copy_v3_v3(dx,bp->vec);
/* so here is (v)' = a(cceleration) = sum(F_springs)/m + gravitation + some friction forces + more forces*/
/* the ( ... )' operator denotes derivate respective time */
@@ -2931,11 +2931,11 @@ static void softbody_apply_forces(Object *ob, float forcetime, int mode, float *
/* v(t + dt) = v(t) + a(t) * dt */
mul_v3_fl(bp->force,timeovermass);/* individual mass of node here */
/* some nasty if's to have heun in here too */
- VECCOPY(dv,bp->force);
+ copy_v3_v3(dv,bp->force);
if (mode == 1){
- VECCOPY(bp->prevvec, bp->vec);
- VECCOPY(bp->prevdv, dv);
+ copy_v3_v3(bp->prevvec, bp->vec);
+ copy_v3_v3(bp->prevdv, dv);
}
if (mode ==2){
@@ -2948,10 +2948,10 @@ static void softbody_apply_forces(Object *ob, float forcetime, int mode, float *
maxerrvel = MAX2(maxerrvel,ABS(dv[1] - bp->prevdv[1]));
maxerrvel = MAX2(maxerrvel,ABS(dv[2] - bp->prevdv[2]));
}
- else {VECADD(bp->vec, bp->vec, bp->force);}
+ else { add_v3_v3(bp->vec, bp->force); }
/* this makes t~ = t+dt */
- if(!(mid_flags & MID_PRESERVE)) VECCOPY(dx,bp->vec);
+ if(!(mid_flags & MID_PRESERVE)) copy_v3_v3(dx,bp->vec);
/* so here is (x)'= v(elocity) */
/* the euler step for location then becomes */
@@ -2970,8 +2970,8 @@ static void softbody_apply_forces(Object *ob, float forcetime, int mode, float *
*/
/* again some nasty if's to have heun in here too */
if (mode ==1){
- VECCOPY(bp->prevpos,bp->pos);
- VECCOPY(bp->prevdx ,dx);
+ copy_v3_v3(bp->prevpos,bp->pos);
+ copy_v3_v3(bp->prevdx ,dx);
}
if (mode ==2){
@@ -2994,7 +2994,7 @@ static void softbody_apply_forces(Object *ob, float forcetime, int mode, float *
}
}
- else { VECADD(bp->pos, bp->pos, dx);}
+ else { add_v3_v3(bp->pos, dx);}
}/*snap*/
/* so while we are looping BPs anyway do statistics on the fly */
aabbmin[0] = MIN2(aabbmin[0],bp->pos[0]);
@@ -3008,8 +3008,8 @@ static void softbody_apply_forces(Object *ob, float forcetime, int mode, float *
if (sb->totpoint) mul_v3_fl(cm,1.0f/sb->totpoint);
if (sb->scratch){
- VECCOPY(sb->scratch->aabbmin,aabbmin);
- VECCOPY(sb->scratch->aabbmax,aabbmax);
+ copy_v3_v3(sb->scratch->aabbmin,aabbmin);
+ copy_v3_v3(sb->scratch->aabbmax,aabbmax);
}
if (err){ /* so step size will be controlled by biggest difference in slope */
@@ -3032,8 +3032,8 @@ static void softbody_restore_prev_step(Object *ob)
int a;
for(a=sb->totpoint, bp= sb->bpoint; a>0; a--, bp++) {
- VECCOPY(bp->vec, bp->prevvec);
- VECCOPY(bp->pos, bp->prevpos);
+ copy_v3_v3(bp->vec, bp->prevvec);
+ copy_v3_v3(bp->pos, bp->prevpos);
}
}
@@ -3045,8 +3045,8 @@ static void softbody_store_step(Object *ob)
int a;
for(a=sb->totpoint, bp= sb->bpoint; a>0; a--, bp++) {
- VECCOPY(bp->prevvec,bp->vec);
- VECCOPY(bp->prevpos,bp->pos);
+ copy_v3_v3(bp->prevvec,bp->vec);
+ copy_v3_v3(bp->prevpos,bp->pos);
}
}
@@ -3061,10 +3061,10 @@ static void softbody_store_state(Object *ob,float *ppos,float *pvel)
for(a=sb->totpoint, bp= sb->bpoint; a>0; a--, bp++) {
- VECCOPY(pv, bp->vec);
+ copy_v3_v3(pv, bp->vec);
pv+=3;
- VECCOPY(pp, bp->pos);
+ copy_v3_v3(pp, bp->pos);
pp+=3;
}
}
@@ -3079,10 +3079,10 @@ static void softbody_retrieve_state(Object *ob,float *ppos,float *pvel)
for(a=sb->totpoint, bp= sb->bpoint; a>0; a--, bp++) {
- VECCOPY(bp->vec,pv);
+ copy_v3_v3(bp->vec,pv);
pv+=3;
- VECCOPY(bp->pos,pp);
+ copy_v3_v3(bp->pos,pp);
pp+=3;
}
}
@@ -3098,14 +3098,14 @@ static void softbody_swap_state(Object *ob,float *ppos,float *pvel)
for(a=sb->totpoint, bp= sb->bpoint; a>0; a--, bp++) {
- VECCOPY(temp, bp->vec);
- VECCOPY(bp->vec,pv);
- VECCOPY(pv,temp);
+ copy_v3_v3(temp, bp->vec);
+ copy_v3_v3(bp->vec,pv);
+ copy_v3_v3(pv,temp);
pv+=3;
- VECCOPY(temp, bp->pos);
- VECCOPY(bp->pos,pp);
- VECCOPY(pp,temp);
+ copy_v3_v3(temp, bp->pos);
+ copy_v3_v3(bp->pos,pp);
+ copy_v3_v3(pp,temp);
pp+=3;
}
}
@@ -3126,8 +3126,8 @@ static void softbody_apply_goalsnap(Object *ob)
for(a=sb->totpoint, bp= sb->bpoint; a>0; a--, bp++) {
if (_final_goal(ob,bp) >= SOFTGOALSNAP){
- VECCOPY(bp->prevpos,bp->pos);
- VECCOPY(bp->pos,bp->origT);
+ copy_v3_v3(bp->prevpos,bp->pos);
+ copy_v3_v3(bp->pos,bp->origT);
}
}
}
@@ -3238,7 +3238,7 @@ static void springs_from_mesh(Object *ob)
if(me->totvert) {
bp= ob->soft->bpoint;
for(a=0; a<me->totvert; a++, bp++) {
- VECCOPY(bp->origS, me->mvert[a].co);
+ copy_v3_v3(bp->origS, me->mvert[a].co);
mul_m4_v3(ob->obmat, bp->origS);
}
@@ -3399,12 +3399,12 @@ static void reference_to_scratch(Object *ob)
bp= ob->soft->bpoint;
rp= sb->scratch->Ref.ivert;
for(a=0; a<sb->totpoint; a++, rp++, bp++) {
- VECCOPY(rp->pos,bp->pos);
- VECADD(accu_pos,accu_pos,bp->pos);
+ copy_v3_v3(rp->pos,bp->pos);
+ add_v3_v3(accu_pos, bp->pos);
accu_mass += _final_mass(ob,bp);
}
mul_v3_fl(accu_pos,1.0f/accu_mass);
- VECCOPY(sb->scratch->Ref.com,accu_pos);
+ copy_v3_v3(sb->scratch->Ref.com,accu_pos);
/* printf("reference_to_scratch \n"); */
}
@@ -3415,9 +3415,9 @@ when object is rescaled
static float globallen(float *v1,float *v2,Object *ob)
{
float p1[3],p2[3];
- VECCOPY(p1,v1);
+ copy_v3_v3(p1,v1);
mul_m4_v3(ob->obmat, p1);
- VECCOPY(p2,v2);
+ copy_v3_v3(p2,v2);
mul_m4_v3(ob->obmat, p2);
return len_v3v3(p1,p2);
}
@@ -3656,7 +3656,7 @@ static void softbody_to_object(Object *ob, float (*vertexCos)[3], int numVerts,
invert_m4_m4(ob->imat, ob->obmat);
for(a=0; a<numVerts; a++, bp++) {
- VECCOPY(vertexCos[a], bp->pos);
+ copy_v3_v3(vertexCos[a], bp->pos);
if(local==0)
mul_m4_v3(ob->imat, vertexCos[a]); /* softbody is in global coords, baked optionally not */
}
@@ -3784,14 +3784,14 @@ static void softbody_update_positions(Object *ob, SoftBody *sb, float (*vertexCo
for(a=0,bp=sb->bpoint; a<numVerts; a++, bp++) {
/* store where goals are now */
- VECCOPY(bp->origS, bp->origE);
+ copy_v3_v3(bp->origS, bp->origE);
/* copy the position of the goals at desired end time */
- VECCOPY(bp->origE, vertexCos[a]);
+ copy_v3_v3(bp->origE, vertexCos[a]);
/* vertexCos came from local world, go global */
mul_m4_v3(ob->obmat, bp->origE);
/* just to be save give bp->origT a defined value
will be calulated in interpolate_exciter()*/
- VECCOPY(bp->origT, bp->origE);
+ copy_v3_v3(bp->origT, bp->origE);
}
}
@@ -3828,14 +3828,14 @@ void SB_estimate_transform(Object *ob,float lloc[3],float lrot[3][3],float lscal
rpos= MEM_callocN( (sb->totpoint)*3*sizeof(float), "SB_RPOS");
/* might filter vertex selection with a vertex group */
for(a=0, bp=sb->bpoint, rp=sb->scratch->Ref.ivert; a<sb->totpoint; a++, bp++, rp++) {
- VECCOPY(rpos[a],rp->pos);
- VECCOPY(opos[a],bp->pos);
+ copy_v3_v3(rpos[a],rp->pos);
+ copy_v3_v3(opos[a],bp->pos);
}
vcloud_estimate_transform(sb->totpoint, opos, NULL, rpos, NULL, com, rcom,lrot,lscale);
- //VECSUB(com,com,rcom);
- if (lloc) VECCOPY(lloc,com);
- VECCOPY(sb->lcom,com);
+ //sub_v3_v3(com,rcom);
+ if (lloc) copy_v3_v3(lloc,com);
+ copy_v3_v3(sb->lcom,com);
if (lscale) copy_m3_m3(sb->lscale,lscale);
if (lrot) copy_m3_m3(sb->lrot,lrot);
@@ -3850,11 +3850,11 @@ static void softbody_reset(Object *ob, SoftBody *sb, float (*vertexCos)[3], int
int a;
for(a=0,bp=sb->bpoint; a<numVerts; a++, bp++) {
- VECCOPY(bp->pos, vertexCos[a]);
+ copy_v3_v3(bp->pos, vertexCos[a]);
mul_m4_v3(ob->obmat, bp->pos); /* yep, sofbody is global coords*/
- VECCOPY(bp->origS, bp->pos);
- VECCOPY(bp->origE, bp->pos);
- VECCOPY(bp->origT, bp->pos);
+ copy_v3_v3(bp->origS, bp->pos);
+ copy_v3_v3(bp->origE, bp->pos);
+ copy_v3_v3(bp->origT, bp->pos);
bp->vec[0]= bp->vec[1]= bp->vec[2]= 0.0f;
/* the bp->prev*'s are for rolling back from a canceled try to propagate in time
@@ -3869,10 +3869,10 @@ static void softbody_reset(Object *ob, SoftBody *sb, float (*vertexCos)[3], int
4.b yup we're done
*/
- VECCOPY(bp->prevpos, bp->pos);
- VECCOPY(bp->prevvec, bp->vec);
- VECCOPY(bp->prevdx, bp->vec);
- VECCOPY(bp->prevdv, bp->vec);
+ copy_v3_v3(bp->prevpos, bp->pos);
+ copy_v3_v3(bp->prevvec, bp->vec);
+ copy_v3_v3(bp->prevdx, bp->vec);
+ copy_v3_v3(bp->prevdv, bp->vec);
}
/* make a nice clean scratch struc */
diff --git a/source/blender/blenkernel/intern/subsurf_ccg.c b/source/blender/blenkernel/intern/subsurf_ccg.c
index 986e0e2b552..9848b27d32e 100644
--- a/source/blender/blenkernel/intern/subsurf_ccg.c
+++ b/source/blender/blenkernel/intern/subsurf_ccg.c
@@ -668,7 +668,7 @@ static void ccgDM_getFinalVertCo(DerivedMesh *dm, int vertNum, float co_r[3])
MVert mvert;
ccgDM_getFinalVert(dm, vertNum, &mvert);
- VECCOPY(co_r, mvert.co);
+ copy_v3_v3(co_r, mvert.co);
}
static void ccgDM_getFinalVertNo(DerivedMesh *dm, int vertNum, float no_r[3])
diff --git a/source/blender/blenkernel/intern/texture.c b/source/blender/blenkernel/intern/texture.c
index d3bd7d7b766..3aa289d0ef8 100644
--- a/source/blender/blenkernel/intern/texture.c
+++ b/source/blender/blenkernel/intern/texture.c
@@ -227,7 +227,7 @@ void init_mapping(TexMapping *texmap)
mul_m3_m3m3(mat, rmat, smat);
copy_m4_m3(texmap->mat, mat);
- VECCOPY(texmap->mat[3], texmap->loc);
+ copy_v3_v3(texmap->mat[3], texmap->loc);
}