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-09-12 08:14:12 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-09-12 08:14:12 +0400
commit4bd0a2ba2dadee66d52f9a1101ee918f1327eec4 (patch)
treeb567b077039e78467e21548c5e03fa8b94fc2b6c /source/blender/blenkernel
parent471a86bf9ccae23b63cb1a05c9525ef99987581d (diff)
replace VECCOPY -> copy_v3_v3, added copy_v*_v*_short too for typesafe copying, some parts of the code are copying float -> short normals without scaling. fix coming next.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r--source/blender/blenkernel/intern/boids.c8
-rw-r--r--source/blender/blenkernel/intern/cdderivedmesh.c2
-rw-r--r--source/blender/blenkernel/intern/collision.c28
-rw-r--r--source/blender/blenkernel/intern/effect.c24
-rw-r--r--source/blender/blenkernel/intern/particle.c4
-rw-r--r--source/blender/blenkernel/intern/sketch.c10
6 files changed, 38 insertions, 38 deletions
diff --git a/source/blender/blenkernel/intern/boids.c b/source/blender/blenkernel/intern/boids.c
index a0f38e675f9..3966caa1fa9 100644
--- a/source/blender/blenkernel/intern/boids.c
+++ b/source/blender/blenkernel/intern/boids.c
@@ -156,8 +156,8 @@ static int rule_goal_avoid(BoidRule *rule, BoidBrainData *bbd, BoidValues *val,
if(rule->type == eBoidRuleType_Goal && boids->options & BOID_ALLOW_CLIMB && surface!=0.0f) {
if(!bbd->goal_ob || bbd->goal_priority < priority) {
bbd->goal_ob = eob;
- VECCOPY(bbd->goal_co, efd.loc);
- VECCOPY(bbd->goal_nor, efd.nor);
+ copy_v3_v3(bbd->goal_co, efd.loc);
+ copy_v3_v3(bbd->goal_nor, efd.nor);
}
}
else if(rule->type == eBoidRuleType_Avoid && bpa->data.mode == eBoidMode_Climbing &&
@@ -869,7 +869,7 @@ static void boid_climb(BoidSettings *boids, ParticleData *pa, float *surface_co,
{
BoidParticle *bpa = pa->boid;
float nor[3], vel[3];
- VECCOPY(nor, surface_nor);
+ copy_v3_v3(nor, surface_nor);
/* gather apparent gravity */
VECADDFAC(bpa->gravity, bpa->gravity, surface_nor, -1.0f);
@@ -1345,7 +1345,7 @@ void boid_body(BoidBrainData *bbd, ParticleData *pa)
{
boid_climb(boids, pa, ground_co, ground_nor);
//float nor[3];
- //VECCOPY(nor, ground_nor);
+ //copy_v3_v3(nor, ground_nor);
///* gather apparent gravity to r_ve */
//VECADDFAC(pa->r_ve, pa->r_ve, ground_nor, -1.0);
diff --git a/source/blender/blenkernel/intern/cdderivedmesh.c b/source/blender/blenkernel/intern/cdderivedmesh.c
index 5eb97630e83..d86c0a39d26 100644
--- a/source/blender/blenkernel/intern/cdderivedmesh.c
+++ b/source/blender/blenkernel/intern/cdderivedmesh.c
@@ -1853,7 +1853,7 @@ void CDDM_apply_vert_normals(DerivedMesh *dm, short (*vertNormals)[3])
cddm->mvert = vert;
for(i = 0; i < dm->numVertData; ++i, ++vert)
- VECCOPY(vert->no, vertNormals[i]);
+ copy_v3_v3_short(vert->no, vertNormals[i]);
}
void CDDM_calc_normals(DerivedMesh *dm)
diff --git a/source/blender/blenkernel/intern/collision.c b/source/blender/blenkernel/intern/collision.c
index ed073f03270..e0b7ebe1f44 100644
--- a/source/blender/blenkernel/intern/collision.c
+++ b/source/blender/blenkernel/intern/collision.c
@@ -104,11 +104,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 +133,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 +550,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 );
@@ -2346,7 +2346,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++;
diff --git a/source/blender/blenkernel/intern/effect.c b/source/blender/blenkernel/intern/effect.c
index 4b95c44f55f..468f39bf731 100644
--- a/source/blender/blenkernel/intern/effect.c
+++ b/source/blender/blenkernel/intern/effect.c
@@ -590,16 +590,16 @@ int closest_point_on_surface(SurfaceModifierData *surmd, float *co, float *surfa
BLI_bvhtree_find_nearest(surmd->bvhtree->tree, co, &nearest, surmd->bvhtree->nearest_callback, surmd->bvhtree);
if(nearest.index != -1) {
- VECCOPY(surface_co, nearest.co);
+ copy_v3_v3(surface_co, nearest.co);
if(surface_nor) {
- VECCOPY(surface_nor, nearest.no);
+ copy_v3_v3(surface_nor, nearest.no);
}
if(surface_vel) {
MFace *mface = CDDM_get_face(surmd->dm, nearest.index);
- VECCOPY(surface_vel, surmd->v[mface->v1].co);
+ copy_v3_v3(surface_vel, surmd->v[mface->v1].co);
add_v3_v3(surface_vel, surmd->v[mface->v2].co);
add_v3_v3(surface_vel, surmd->v[mface->v3].co);
if(mface->v4)
@@ -705,7 +705,7 @@ int get_effector_data(EffectorCache *eff, EffectorData *efd, EffectedPoint *poin
sub_v3_v3v3(efd->loc, point->loc, translate);
}
else {
- VECCOPY(efd->loc, ob->obmat[3]);
+ copy_v3_v3(efd->loc, ob->obmat[3]);
}
if(real_velocity)
@@ -727,8 +727,8 @@ int get_effector_data(EffectorCache *eff, EffectorData *efd, EffectedPoint *poin
mul_v3_fl(efd->vec_to_point, (efd->distance-eff->pd->f_size)/efd->distance);
if(eff->flag & PE_USE_NORMAL_DATA) {
- VECCOPY(efd->vec_to_point2, efd->vec_to_point);
- VECCOPY(efd->nor2, efd->nor);
+ copy_v3_v3(efd->vec_to_point2, efd->vec_to_point);
+ copy_v3_v3(efd->nor2, efd->nor);
}
else {
/* for some effectors we need the object center every time */
@@ -800,7 +800,7 @@ static void do_texture_effector(EffectorCache *eff, EffectorData *efd, EffectedP
strength= eff->pd->f_strength * efd->falloff;
- VECCOPY(tex_co,point->loc);
+ copy_v3_v3(tex_co,point->loc);
if(eff->pd->flag & PFIELD_TEX_2D) {
float fac=-dot_v3v3(tex_co, efd->nor);
@@ -878,11 +878,11 @@ static void do_physical_effector(EffectorCache *eff, EffectorData *efd, Effected
damp += wind_func(rng, noise_factor);
}
- VECCOPY(force, efd->vec_to_point);
+ copy_v3_v3(force, efd->vec_to_point);
switch(pd->forcefield){
case PFIELD_WIND:
- VECCOPY(force, efd->nor);
+ copy_v3_v3(force, efd->nor);
mul_v3_fl(force, strength * efd->falloff);
break;
case PFIELD_FORCE:
@@ -944,7 +944,7 @@ static void do_physical_effector(EffectorCache *eff, EffectorData *efd, Effected
return;
case PFIELD_TURBULENCE:
if(pd->flag & PFIELD_GLOBAL_CO) {
- VECCOPY(temp, point->loc);
+ copy_v3_v3(temp, point->loc);
}
else {
VECADD(temp, efd->vec_to_point2, efd->nor2);
@@ -955,7 +955,7 @@ static void do_physical_effector(EffectorCache *eff, EffectorData *efd, Effected
mul_v3_fl(force, strength * efd->falloff);
break;
case PFIELD_DRAG:
- VECCOPY(force, point->vel);
+ copy_v3_v3(force, point->vel);
fac = normalize_v3(force) * point->vel_to_sec;
strength = MIN2(strength, 2.0f);
@@ -1039,7 +1039,7 @@ void pdDoEffectors(ListBase *effectors, ListBase *colliders, EffectorWeights *we
do_texture_effector(eff, &efd, point, force);
else {
float temp1[3]={0,0,0}, temp2[3];
- VECCOPY(temp1, force);
+ copy_v3_v3(temp1, force);
do_physical_effector(eff, &efd, point, force);
diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c
index 86c646fa257..60432631492 100644
--- a/source/blender/blenkernel/intern/particle.c
+++ b/source/blender/blenkernel/intern/particle.c
@@ -2090,10 +2090,10 @@ void precalc_guides(ParticleSimulationData *sim, ListBase *effectors)
data = eff->guide_data + p;
VECSUB(efd.vec_to_point, state.co, eff->guide_loc);
- VECCOPY(efd.nor, eff->guide_dir);
+ copy_v3_v3(efd.nor, eff->guide_dir);
efd.distance = len_v3(efd.vec_to_point);
- VECCOPY(data->vec_to_point, efd.vec_to_point);
+ copy_v3_v3(data->vec_to_point, efd.vec_to_point);
data->strength = effector_falloff(eff, &efd, &point, weights);
}
}
diff --git a/source/blender/blenkernel/intern/sketch.c b/source/blender/blenkernel/intern/sketch.c
index 4cc5a880625..432dc9ec609 100644
--- a/source/blender/blenkernel/intern/sketch.c
+++ b/source/blender/blenkernel/intern/sketch.c
@@ -245,13 +245,13 @@ void sk_straightenStroke(SK_Stroke *stk, int start, int end, float p_start[3], f
prev = stk->points + start;
next = stk->points + end;
- VECCOPY(pt1.p, p_start);
- VECCOPY(pt1.no, prev->no);
+ copy_v3_v3(pt1.p, p_start);
+ copy_v3_v3(pt1.no, prev->no);
pt1.mode = prev->mode;
pt1.type = prev->type;
- VECCOPY(pt2.p, p_end);
- VECCOPY(pt2.no, next->no);
+ copy_v3_v3(pt2.p, p_end);
+ copy_v3_v3(pt2.no, next->no);
pt2.mode = next->mode;
pt2.type = next->type;
@@ -323,7 +323,7 @@ void sk_flattenStroke(SK_Stroke *stk, int start, int end)
total = end - start + 1;
- VECCOPY(normal, stk->points[start].no);
+ copy_v3_v3(normal, stk->points[start].no);
sub_v3_v3v3(distance, stk->points[end].p, stk->points[start].p);
project_v3_v3v3(normal, distance, normal);