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.
This commit is contained in:
@@ -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);
|
||||
|
@@ -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)
|
||||
|
@@ -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++;
|
||||
|
@@ -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);
|
||||
|
||||
|
@@ -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);
|
||||
}
|
||||
}
|
||||
|
@@ -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);
|
||||
|
@@ -56,6 +56,12 @@ MINLINE void swap_v2_v2(float a[2], float b[2]);
|
||||
MINLINE void swap_v3_v3(float a[3], float b[3]);
|
||||
MINLINE void swap_v4_v4(float a[4], float b[4]);
|
||||
|
||||
/* short */
|
||||
MINLINE void copy_v2_v2_short(short r[2], const short a[2]);
|
||||
MINLINE void copy_v3_v3_short(short r[3], const short a[3]);
|
||||
MINLINE void copy_v4_v4_short(short r[4], const short a[4]);
|
||||
|
||||
|
||||
/********************************* Arithmetic ********************************/
|
||||
|
||||
MINLINE void add_v3_fl(float r[3], float f);
|
||||
|
@@ -591,7 +591,7 @@ static void testRadialSymmetry(BGraph *graph, BNode* root_node, RadialArc* ring,
|
||||
node1 = BLI_otherNode(ring[i].arc, root_node);
|
||||
node2 = BLI_otherNode(ring[j].arc, root_node);
|
||||
|
||||
VECCOPY(p, node2->p);
|
||||
copy_v3_v3(p, node2->p);
|
||||
BLI_mirrorAlongAxis(p, root_node->p, normal);
|
||||
|
||||
/* check if it's within limit before continuing */
|
||||
@@ -605,7 +605,7 @@ static void testRadialSymmetry(BGraph *graph, BNode* root_node, RadialArc* ring,
|
||||
if (symmetric)
|
||||
{
|
||||
/* mark node as symmetric physically */
|
||||
VECCOPY(root_node->symmetry_axis, axis);
|
||||
copy_v3_v3(root_node->symmetry_axis, axis);
|
||||
root_node->symmetry_flag |= SYM_PHYSICAL;
|
||||
root_node->symmetry_flag |= SYM_RADIAL;
|
||||
|
||||
|
@@ -79,6 +79,28 @@ MINLINE void copy_v4_v4(float r[4], const float a[4])
|
||||
r[3]= a[3];
|
||||
}
|
||||
|
||||
/* short */
|
||||
MINLINE void copy_v2_v2_short(short r[2], const short a[2])
|
||||
{
|
||||
r[0]= a[0];
|
||||
r[1]= a[1];
|
||||
}
|
||||
|
||||
MINLINE void copy_v3_v3_short(short r[3], const short a[3])
|
||||
{
|
||||
r[0]= a[0];
|
||||
r[1]= a[1];
|
||||
r[2]= a[2];
|
||||
}
|
||||
|
||||
MINLINE void copy_v4_v4_short(short r[4], const short a[4])
|
||||
{
|
||||
r[0]= a[0];
|
||||
r[1]= a[1];
|
||||
r[2]= a[2];
|
||||
r[3]= a[3];
|
||||
}
|
||||
|
||||
MINLINE void swap_v2_v2(float a[2], float b[2])
|
||||
{
|
||||
SWAP(float, a[0], b[0]);
|
||||
|
@@ -409,10 +409,10 @@ static ReebNode *sk_pointToNode(SK_Point *pt, float imat[][4], float tmat[][3])
|
||||
ReebNode *node;
|
||||
|
||||
node = MEM_callocN(sizeof(ReebNode), "reeb node");
|
||||
VECCOPY(node->p, pt->p);
|
||||
copy_v3_v3(node->p, pt->p);
|
||||
mul_m4_v3(imat, node->p);
|
||||
|
||||
VECCOPY(node->no, pt->no);
|
||||
copy_v3_v3(node->no, pt->no);
|
||||
mul_m3_v3(tmat, node->no);
|
||||
|
||||
return node;
|
||||
@@ -432,10 +432,10 @@ static ReebArc *sk_strokeToArc(SK_Stroke *stk, float imat[][4], float tmat[][3])
|
||||
|
||||
for (i = 0; i < arc->bcount; i++)
|
||||
{
|
||||
VECCOPY(arc->buckets[i].p, stk->points[i + 1].p);
|
||||
copy_v3_v3(arc->buckets[i].p, stk->points[i + 1].p);
|
||||
mul_m4_v3(imat, arc->buckets[i].p);
|
||||
|
||||
VECCOPY(arc->buckets[i].no, stk->points[i + 1].no);
|
||||
copy_v3_v3(arc->buckets[i].no, stk->points[i + 1].no);
|
||||
mul_m3_v3(tmat, arc->buckets[i].no);
|
||||
}
|
||||
|
||||
@@ -1802,8 +1802,8 @@ void sk_applyCutGesture(bContext *UNUSED(C), SK_Gesture *gest, SK_Sketch *UNUSED
|
||||
|
||||
pt.type = PT_EXACT;
|
||||
pt.mode = PT_PROJECT; /* take mode from neighbouring points */
|
||||
VECCOPY(pt.p, isect->p);
|
||||
VECCOPY(pt.no, isect->stroke->points[isect->before].no);
|
||||
copy_v3_v3(pt.p, isect->p);
|
||||
copy_v3_v3(pt.no, isect->stroke->points[isect->before].no);
|
||||
|
||||
sk_insertStrokePoint(isect->stroke, &pt, isect->after);
|
||||
}
|
||||
@@ -1844,8 +1844,8 @@ void sk_applyTrimGesture(bContext *UNUSED(C), SK_Gesture *gest, SK_Sketch *UNUSE
|
||||
|
||||
pt.type = PT_EXACT;
|
||||
pt.mode = PT_PROJECT; /* take mode from neighbouring points */
|
||||
VECCOPY(pt.p, isect->p);
|
||||
VECCOPY(pt.no, isect->stroke->points[isect->before].no);
|
||||
copy_v3_v3(pt.p, isect->p);
|
||||
copy_v3_v3(pt.no, isect->stroke->points[isect->before].no);
|
||||
|
||||
sub_v3_v3v3(stroke_dir, isect->stroke->points[isect->after].p, isect->stroke->points[isect->before].p);
|
||||
|
||||
|
@@ -1659,8 +1659,8 @@ static void *editMesh_to_undoMesh(void *emv)
|
||||
/* now copy vertices */
|
||||
a = 0;
|
||||
for(eve=em->verts.first; eve; eve= eve->next, evec++, a++) {
|
||||
VECCOPY(evec->co, eve->co);
|
||||
VECCOPY(evec->no, eve->no);
|
||||
copy_v3_v3(evec->co, eve->co);
|
||||
copy_v3_v3(evec->no, eve->no);
|
||||
|
||||
evec->f= eve->f;
|
||||
evec->h= eve->h;
|
||||
@@ -1761,7 +1761,7 @@ static void undoMesh_to_editMesh(void *umv, void *emv)
|
||||
eve= addvertlist(em, evec->co, NULL);
|
||||
evar[a]= eve;
|
||||
|
||||
VECCOPY(eve->no, evec->no);
|
||||
copy_v3_v3(eve->no, evec->no);
|
||||
eve->f= evec->f;
|
||||
eve->h= evec->h;
|
||||
eve->keyindex= evec->keyindex;
|
||||
|
@@ -1096,13 +1096,13 @@ short extrudeflag_face_indiv(EditMesh *em, short UNUSED(flag), float *UNUSED(nor
|
||||
v3= addvertlist(em, efa->v3->co, efa->v3);
|
||||
|
||||
v1->f1= v2->f1= v3->f1= 1;
|
||||
VECCOPY(v1->no, efa->n);
|
||||
VECCOPY(v2->no, efa->n);
|
||||
VECCOPY(v3->no, efa->n);
|
||||
copy_v3_v3(v1->no, efa->n);
|
||||
copy_v3_v3(v2->no, efa->n);
|
||||
copy_v3_v3(v3->no, efa->n);
|
||||
if(efa->v4) {
|
||||
v4= addvertlist(em, efa->v4->co, efa->v4);
|
||||
v4->f1= 1;
|
||||
VECCOPY(v4->no, efa->n);
|
||||
copy_v3_v3(v4->no, efa->n);
|
||||
}
|
||||
else v4= NULL;
|
||||
|
||||
@@ -1648,8 +1648,8 @@ short extrudeflag_vert(Object *obedit, EditMesh *em, short flag, float *nor, int
|
||||
sel= 1;
|
||||
v1= addvertlist(em, 0, NULL);
|
||||
|
||||
VECCOPY(v1->co, eve->co);
|
||||
VECCOPY(v1->no, eve->no);
|
||||
copy_v3_v3(v1->co, eve->co);
|
||||
copy_v3_v3(v1->no, eve->no);
|
||||
v1->f= eve->f;
|
||||
eve->f &= ~flag;
|
||||
eve->tmp.v = v1;
|
||||
@@ -2482,7 +2482,7 @@ void EM_make_hq_normals(EditMesh *em)
|
||||
/* only one face attached to that edge */
|
||||
/* an edge without another attached- the weight on this is
|
||||
* undefined, M_PI/2 is 90d in radians and that seems good enough */
|
||||
VECCOPY(edge_normal, EM_get_face_for_index(edge_ref->f1)->n)
|
||||
copy_v3_v3(edge_normal, EM_get_face_for_index(edge_ref->f1)->n);
|
||||
mul_v3_fl(edge_normal, M_PI/2);
|
||||
}
|
||||
add_v3_v3(EM_get_vert_for_index(ed_v1)->no, edge_normal );
|
||||
@@ -2499,7 +2499,7 @@ void EM_make_hq_normals(EditMesh *em)
|
||||
if(normalize_v3(eve->no) == 0.0f && eve->tmp.l < 0) {
|
||||
/* exceptional case, totally flat */
|
||||
efa= EM_get_face_for_index(-(eve->tmp.l) - 1);
|
||||
VECCOPY(eve->no, efa->n);
|
||||
copy_v3_v3(eve->no, efa->n);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -1466,8 +1466,8 @@ static void alter_co(float *co, EditEdge *edge, float smooth, float fractal, int
|
||||
sub_v3_v3v3(nor, edge->v1->co, edge->v2->co);
|
||||
len= 0.5f*normalize_v3(nor);
|
||||
|
||||
VECCOPY(nor1, edge->v1->no);
|
||||
VECCOPY(nor2, edge->v2->no);
|
||||
copy_v3_v3(nor1, edge->v1->no);
|
||||
copy_v3_v3(nor2, edge->v2->no);
|
||||
|
||||
/* cosine angle */
|
||||
fac= nor[0]*nor1[0] + nor[1]*nor1[1] + nor[2]*nor1[2] ;
|
||||
|
@@ -3330,7 +3330,7 @@ static void sculpt_restore_mesh(Sculpt *sd, SculptSession *ss)
|
||||
|
||||
BLI_pbvh_vertex_iter_begin(ss->pbvh, nodes[n], vd, PBVH_ITER_UNIQUE) {
|
||||
copy_v3_v3(vd.co, unode->co[vd.i]);
|
||||
if(vd.no) VECCOPY(vd.no, unode->no[vd.i])
|
||||
if(vd.no) copy_v3_v3_short(vd.no, unode->no[vd.i]);
|
||||
else normal_short_to_float_v3(vd.fno, unode->no[vd.i]);
|
||||
|
||||
if(vd.mvert) vd.mvert->flag |= ME_VERT_PBVH_UPDATE;
|
||||
|
@@ -300,7 +300,7 @@ SculptUndoNode *sculpt_undo_push_node(Object *ob, PBVHNode *node)
|
||||
|
||||
BLI_pbvh_vertex_iter_begin(ss->pbvh, node, vd, PBVH_ITER_ALL) {
|
||||
copy_v3_v3(unode->co[vd.i], vd.co);
|
||||
if(vd.no) VECCOPY(unode->no[vd.i], vd.no)
|
||||
if(vd.no) copy_v3_v3_short(unode->no[vd.i], vd.no);
|
||||
else normal_float_to_short_v3(unode->no[vd.i], vd.fno);
|
||||
if(vd.vert_indices) unode->index[vd.i]= vd.vert_indices[vd.i];
|
||||
|
||||
|
@@ -1091,7 +1091,7 @@ int calculateTransformCenter(bContext *C, int centerMode, float *vec)
|
||||
calculateCenter(t);
|
||||
|
||||
// Copy center from constraint center. Transform center can be local
|
||||
VECCOPY(vec, t->con.center);
|
||||
copy_v3_v3(vec, t->con.center);
|
||||
}
|
||||
|
||||
|
||||
@@ -1210,7 +1210,7 @@ static void drawHelpline(bContext *UNUSED(C), int x, int y, void *customdata)
|
||||
mval[0]= x;
|
||||
mval[1]= y;
|
||||
|
||||
VECCOPY(vecrot, t->center);
|
||||
copy_v3_v3(vecrot, t->center);
|
||||
if(t->flag & T_EDIT) {
|
||||
Object *ob= t->obedit;
|
||||
if(ob) mul_m4_v3(ob->obmat, vecrot);
|
||||
@@ -1963,7 +1963,7 @@ static void constraintTransLim(TransInfo *t, TransData *td)
|
||||
* - current space should be local
|
||||
*/
|
||||
unit_m4(cob.matrix);
|
||||
VECCOPY(cob.matrix[3], td->loc);
|
||||
copy_v3_v3(cob.matrix[3], td->loc);
|
||||
|
||||
/* Evaluate valid constraints */
|
||||
for (con= td->con; con; con= con->next) {
|
||||
@@ -2022,7 +2022,7 @@ static void constraintTransLim(TransInfo *t, TransData *td)
|
||||
}
|
||||
|
||||
/* copy results from cob->matrix */
|
||||
VECCOPY(td->loc, cob.matrix[3]);
|
||||
copy_v3_v3(td->loc, cob.matrix[3]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2292,8 +2292,8 @@ int Warp(TransInfo *t, const int UNUSED(mval[2]))
|
||||
* It needs to be in view space, but we need to take object's offset
|
||||
* into account if in Edit mode.
|
||||
*/
|
||||
VECCOPY(cursor, curs);
|
||||
VECCOPY(gcursor, cursor);
|
||||
copy_v3_v3(cursor, curs);
|
||||
copy_v3_v3(gcursor, cursor);
|
||||
if (t->flag & T_EDIT) {
|
||||
sub_v3_v3(cursor, t->obedit->obmat[3]);
|
||||
sub_v3_v3(gcursor, t->obedit->obmat[3]);
|
||||
@@ -2336,7 +2336,7 @@ int Warp(TransInfo *t, const int UNUSED(mval[2]))
|
||||
continue;
|
||||
|
||||
/* translate point to center, rotate in such a way that outline==distance */
|
||||
VECCOPY(vec, td->iloc);
|
||||
copy_v3_v3(vec, td->iloc);
|
||||
mul_m3_v3(td->mtx, vec);
|
||||
mul_m4_v3(t->viewmat, vec);
|
||||
sub_v3_v3(vec, t->viewmat[3]);
|
||||
@@ -2603,23 +2603,23 @@ static void ElementResize(TransInfo *t, TransData *td, float mat[3][3]) {
|
||||
/* local constraint shouldn't alter center */
|
||||
if (t->around == V3D_LOCAL) {
|
||||
if (t->flag & T_OBJECT) {
|
||||
VECCOPY(center, td->center);
|
||||
copy_v3_v3(center, td->center);
|
||||
}
|
||||
else if (t->flag & T_EDIT) {
|
||||
|
||||
if(t->around==V3D_LOCAL && (t->settings->selectmode & SCE_SELECT_FACE)) {
|
||||
VECCOPY(center, td->center);
|
||||
copy_v3_v3(center, td->center);
|
||||
}
|
||||
else {
|
||||
VECCOPY(center, t->center);
|
||||
copy_v3_v3(center, t->center);
|
||||
}
|
||||
}
|
||||
else {
|
||||
VECCOPY(center, t->center);
|
||||
copy_v3_v3(center, t->center);
|
||||
}
|
||||
}
|
||||
else {
|
||||
VECCOPY(center, t->center);
|
||||
copy_v3_v3(center, t->center);
|
||||
}
|
||||
|
||||
if (td->ext) {
|
||||
@@ -2719,10 +2719,10 @@ int Resize(TransInfo *t, const int mval[2])
|
||||
|
||||
if (t->flag & T_AUTOVALUES)
|
||||
{
|
||||
VECCOPY(size, t->auto_values);
|
||||
copy_v3_v3(size, t->auto_values);
|
||||
}
|
||||
|
||||
VECCOPY(t->values, size);
|
||||
copy_v3_v3(t->values, size);
|
||||
|
||||
size_to_mat3( mat,size);
|
||||
|
||||
@@ -3020,7 +3020,7 @@ static void ElementRotation(TransInfo *t, TransData *td, float mat[3][3], short
|
||||
mul_m3_m3m3(smat, td->smtx, totmat);
|
||||
|
||||
/* calculate the total rotatation in eulers */
|
||||
VECCOPY(eul, td->ext->irot);
|
||||
copy_v3_v3(eul, td->ext->irot);
|
||||
eulO_to_mat3( eulmat,eul, td->ext->rotOrder);
|
||||
|
||||
/* mat = transform, obmat = bone rotation */
|
||||
@@ -3030,7 +3030,7 @@ static void ElementRotation(TransInfo *t, TransData *td, float mat[3][3], short
|
||||
|
||||
/* and apply (to end result only) */
|
||||
protectedRotateBits(td->protectflag, eul, td->ext->irot);
|
||||
VECCOPY(td->ext->rot, eul);
|
||||
copy_v3_v3(td->ext->rot, eul);
|
||||
}
|
||||
|
||||
constraintRotLim(t, td);
|
||||
@@ -3100,7 +3100,7 @@ static void ElementRotation(TransInfo *t, TransData *td, float mat[3][3], short
|
||||
|
||||
/* and apply */
|
||||
protectedRotateBits(td->protectflag, eul, td->ext->irot);
|
||||
VECCOPY(td->ext->rot, eul);
|
||||
copy_v3_v3(td->ext->rot, eul);
|
||||
}
|
||||
|
||||
constraintRotLim(t, td);
|
||||
@@ -3244,8 +3244,8 @@ int Trackball(TransInfo *t, const int UNUSED(mval[2]))
|
||||
float mat[3][3], totmat[3][3], smat[3][3];
|
||||
float phi[2];
|
||||
|
||||
VECCOPY(axis1, t->persinv[0]);
|
||||
VECCOPY(axis2, t->persinv[1]);
|
||||
copy_v3_v3(axis1, t->persinv[0]);
|
||||
copy_v3_v3(axis2, t->persinv[1]);
|
||||
normalize_v3(axis1);
|
||||
normalize_v3(axis2);
|
||||
|
||||
@@ -3341,7 +3341,7 @@ static void headerTranslation(TransInfo *t, float vec[3], char *str) {
|
||||
else {
|
||||
float dvec[3];
|
||||
|
||||
VECCOPY(dvec, vec);
|
||||
copy_v3_v3(dvec, vec);
|
||||
applyAspectRatio(t, dvec);
|
||||
|
||||
dist = len_v3(vec);
|
||||
@@ -3448,7 +3448,7 @@ static void applyTranslation(TransInfo *t, float vec[3]) {
|
||||
t->con.applyVec(t, td, vec, tvec, pvec);
|
||||
}
|
||||
else {
|
||||
VECCOPY(tvec, vec);
|
||||
copy_v3_v3(tvec, vec);
|
||||
}
|
||||
|
||||
mul_m3_v3(td->smtx, tvec);
|
||||
@@ -3475,7 +3475,7 @@ int Translation(TransInfo *t, const int UNUSED(mval[2]))
|
||||
}
|
||||
applySnapping(t, t->values);
|
||||
t->con.applyVec(t, NULL, t->values, tvec, pvec);
|
||||
VECCOPY(t->values, tvec);
|
||||
copy_v3_v3(t->values, tvec);
|
||||
headerTranslation(t, pvec, str);
|
||||
}
|
||||
else {
|
||||
@@ -3564,7 +3564,7 @@ int ShrinkFatten(TransInfo *t, const int UNUSED(mval[2]))
|
||||
if (td->flag & TD_SKIP)
|
||||
continue;
|
||||
|
||||
VECCOPY(vec, td->axismtx[2]);
|
||||
copy_v3_v3(vec, td->axismtx[2]);
|
||||
mul_v3_fl(vec, distance);
|
||||
mul_v3_fl(vec, td->factor);
|
||||
|
||||
@@ -4608,7 +4608,7 @@ static int createSlideVerts(TransInfo *t)
|
||||
|
||||
add_v3_v3(start, end);
|
||||
mul_v3_fl(start, 0.5f*(1.0f/totvec));
|
||||
VECCOPY(vec, start);
|
||||
copy_v3_v3(vec, start);
|
||||
start[0] = t->mval[0];
|
||||
start[1] = t->mval[1];
|
||||
add_v3_v3v3(end, start, vec);
|
||||
@@ -5215,7 +5215,7 @@ int Align(TransInfo *t, const int UNUSED(mval[2]))
|
||||
int i;
|
||||
|
||||
/* saving original center */
|
||||
VECCOPY(center, t->center);
|
||||
copy_v3_v3(center, t->center);
|
||||
|
||||
for(i = 0 ; i < t->total; i++, td++)
|
||||
{
|
||||
@@ -5229,11 +5229,11 @@ int Align(TransInfo *t, const int UNUSED(mval[2]))
|
||||
|
||||
/* around local centers */
|
||||
if (t->flag & (T_OBJECT|T_POSE)) {
|
||||
VECCOPY(t->center, td->center);
|
||||
copy_v3_v3(t->center, td->center);
|
||||
}
|
||||
else {
|
||||
if(t->settings->selectmode & SCE_SELECT_FACE) {
|
||||
VECCOPY(t->center, td->center);
|
||||
copy_v3_v3(t->center, td->center);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5245,7 +5245,7 @@ int Align(TransInfo *t, const int UNUSED(mval[2]))
|
||||
}
|
||||
|
||||
/* restoring original center */
|
||||
VECCOPY(t->center, center);
|
||||
copy_v3_v3(t->center, center);
|
||||
|
||||
recalcData(t);
|
||||
|
||||
@@ -5317,7 +5317,7 @@ int SeqSlide(TransInfo *t, const int UNUSED(mval[2]))
|
||||
float pvec[3] = {0.0f, 0.0f, 0.0f};
|
||||
float tvec[3];
|
||||
t->con.applyVec(t, NULL, t->values, tvec, pvec);
|
||||
VECCOPY(t->values, tvec);
|
||||
copy_v3_v3(t->values, tvec);
|
||||
}
|
||||
else {
|
||||
snapGrid(t, t->values);
|
||||
|
@@ -239,7 +239,7 @@ static void axisProjection(TransInfo *t, float axis[3], float in[3], float out[3
|
||||
if(factor<0.0f) factor*= -factor;
|
||||
else factor*= factor;
|
||||
|
||||
VECCOPY(out, axis);
|
||||
copy_v3_v3(out, axis);
|
||||
normalize_v3(out);
|
||||
mul_v3_fl(out, -factor); /* -factor makes move down going backwards */
|
||||
}
|
||||
@@ -261,7 +261,7 @@ static void axisProjection(TransInfo *t, float axis[3], float in[3], float out[3
|
||||
/* give arbitrary large value if projection is impossible */
|
||||
factor = dot_v3v3(axis, norm);
|
||||
if (1.0f - fabsf(factor) < 0.0002f) {
|
||||
VECCOPY(out, axis);
|
||||
copy_v3_v3(out, axis);
|
||||
if (factor > 0) {
|
||||
mul_v3_fl(out, 1000000000.0f);
|
||||
} else {
|
||||
@@ -300,7 +300,7 @@ static void planeProjection(TransInfo *t, float in[3], float out[3]) {
|
||||
}
|
||||
factor = dot_v3v3(vec, vec) / factor;
|
||||
|
||||
VECCOPY(vec, norm);
|
||||
copy_v3_v3(vec, norm);
|
||||
mul_v3_fl(vec, factor);
|
||||
|
||||
add_v3_v3v3(out, in, vec);
|
||||
@@ -317,7 +317,7 @@ static void planeProjection(TransInfo *t, float in[3], float out[3]) {
|
||||
|
||||
static void applyAxisConstraintVec(TransInfo *t, TransData *td, float in[3], float out[3], float pvec[3])
|
||||
{
|
||||
VECCOPY(out, in);
|
||||
copy_v3_v3(out, in);
|
||||
if (!td && t->con.mode & CON_APPLY) {
|
||||
mul_m3_v3(t->con.pmtx, out);
|
||||
|
||||
@@ -332,13 +332,13 @@ static void applyAxisConstraintVec(TransInfo *t, TransData *td, float in[3], flo
|
||||
float c[3];
|
||||
|
||||
if (t->con.mode & CON_AXIS0) {
|
||||
VECCOPY(c, t->con.mtx[0]);
|
||||
copy_v3_v3(c, t->con.mtx[0]);
|
||||
}
|
||||
else if (t->con.mode & CON_AXIS1) {
|
||||
VECCOPY(c, t->con.mtx[1]);
|
||||
copy_v3_v3(c, t->con.mtx[1]);
|
||||
}
|
||||
else if (t->con.mode & CON_AXIS2) {
|
||||
VECCOPY(c, t->con.mtx[2]);
|
||||
copy_v3_v3(c, t->con.mtx[2]);
|
||||
}
|
||||
axisProjection(t, c, in, out);
|
||||
}
|
||||
@@ -360,7 +360,7 @@ static void applyAxisConstraintVec(TransInfo *t, TransData *td, float in[3], flo
|
||||
|
||||
static void applyObjectConstraintVec(TransInfo *t, TransData *td, float in[3], float out[3], float pvec[3])
|
||||
{
|
||||
VECCOPY(out, in);
|
||||
copy_v3_v3(out, in);
|
||||
if (t->con.mode & CON_APPLY) {
|
||||
if (!td) {
|
||||
mul_m3_v3(t->con.pmtx, out);
|
||||
@@ -373,18 +373,18 @@ static void applyObjectConstraintVec(TransInfo *t, TransData *td, float in[3], f
|
||||
float c[3];
|
||||
|
||||
if (t->con.mode & CON_AXIS0) {
|
||||
VECCOPY(c, t->con.mtx[0]);
|
||||
copy_v3_v3(c, t->con.mtx[0]);
|
||||
}
|
||||
else if (t->con.mode & CON_AXIS1) {
|
||||
VECCOPY(c, t->con.mtx[1]);
|
||||
copy_v3_v3(c, t->con.mtx[1]);
|
||||
}
|
||||
else if (t->con.mode & CON_AXIS2) {
|
||||
VECCOPY(c, t->con.mtx[2]);
|
||||
copy_v3_v3(c, t->con.mtx[2]);
|
||||
}
|
||||
axisProjection(t, c, in, out);
|
||||
}
|
||||
postConstraintChecks(t, out, pvec);
|
||||
VECCOPY(out, pvec);
|
||||
copy_v3_v3(out, pvec);
|
||||
}
|
||||
else {
|
||||
int i=0;
|
||||
@@ -481,15 +481,15 @@ static void applyAxisConstraintRot(TransInfo *t, TransData *td, float vec[3], fl
|
||||
switch(mode) {
|
||||
case CON_AXIS0:
|
||||
case (CON_AXIS1|CON_AXIS2):
|
||||
VECCOPY(vec, t->con.mtx[0]);
|
||||
copy_v3_v3(vec, t->con.mtx[0]);
|
||||
break;
|
||||
case CON_AXIS1:
|
||||
case (CON_AXIS0|CON_AXIS2):
|
||||
VECCOPY(vec, t->con.mtx[1]);
|
||||
copy_v3_v3(vec, t->con.mtx[1]);
|
||||
break;
|
||||
case CON_AXIS2:
|
||||
case (CON_AXIS0|CON_AXIS1):
|
||||
VECCOPY(vec, t->con.mtx[2]);
|
||||
copy_v3_v3(vec, t->con.mtx[2]);
|
||||
break;
|
||||
}
|
||||
/* don't flip axis if asked to or if num input */
|
||||
@@ -528,15 +528,15 @@ static void applyObjectConstraintRot(TransInfo *t, TransData *td, float vec[3],
|
||||
switch(mode) {
|
||||
case CON_AXIS0:
|
||||
case (CON_AXIS1|CON_AXIS2):
|
||||
VECCOPY(vec, td->axismtx[0]);
|
||||
copy_v3_v3(vec, td->axismtx[0]);
|
||||
break;
|
||||
case CON_AXIS1:
|
||||
case (CON_AXIS0|CON_AXIS2):
|
||||
VECCOPY(vec, td->axismtx[1]);
|
||||
copy_v3_v3(vec, td->axismtx[1]);
|
||||
break;
|
||||
case CON_AXIS2:
|
||||
case (CON_AXIS0|CON_AXIS1):
|
||||
VECCOPY(vec, td->axismtx[2]);
|
||||
copy_v3_v3(vec, td->axismtx[2]);
|
||||
break;
|
||||
}
|
||||
if (angle && (mode & CON_NOFLIP) == 0 && hasNumInput(&t->num) == 0) {
|
||||
@@ -724,7 +724,7 @@ void drawPropCircle(const struct bContext *C, TransInfo *t)
|
||||
|
||||
glPushMatrix();
|
||||
|
||||
VECCOPY(center, t->center);
|
||||
copy_v3_v3(center, t->center);
|
||||
|
||||
if((t->spacetype == SPACE_VIEW3D) && t->obedit)
|
||||
{
|
||||
@@ -897,7 +897,7 @@ static void setNearestAxis3d(TransInfo *t)
|
||||
zfac = len_v3(t->persinv[0]) * 2.0f/t->ar->winx * zfac * 30.0f;
|
||||
|
||||
for (i = 0; i<3; i++) {
|
||||
VECCOPY(axis, t->con.mtx[i]);
|
||||
copy_v3_v3(axis, t->con.mtx[i]);
|
||||
|
||||
mul_v3_fl(axis, zfac);
|
||||
/* now we can project to get window coordinate */
|
||||
|
@@ -269,7 +269,7 @@ static void createTransTexspace(TransInfo *t)
|
||||
td->ext= t->ext= MEM_callocN(sizeof(TransDataExtension), "TransTexspace");
|
||||
|
||||
td->flag= TD_SELECTED;
|
||||
VECCOPY(td->center, ob->obmat[3]);
|
||||
copy_v3_v3(td->center, ob->obmat[3]);
|
||||
td->ob = ob;
|
||||
|
||||
copy_m3_m4(td->mtx, ob->obmat);
|
||||
@@ -282,9 +282,9 @@ static void createTransTexspace(TransInfo *t)
|
||||
*texflag &= ~AUTOSPACE;
|
||||
}
|
||||
|
||||
VECCOPY(td->iloc, td->loc);
|
||||
VECCOPY(td->ext->irot, td->ext->rot);
|
||||
VECCOPY(td->ext->isize, td->ext->size);
|
||||
copy_v3_v3(td->iloc, td->loc);
|
||||
copy_v3_v3(td->ext->irot, td->ext->rot);
|
||||
copy_v3_v3(td->ext->isize, td->ext->size);
|
||||
}
|
||||
|
||||
/* ********************* edge (for crease) ***** */
|
||||
@@ -420,7 +420,7 @@ static short apply_targetless_ik(Object *ob)
|
||||
copy_m4_m3(offs_bone, bone->bone_mat);
|
||||
|
||||
/* The bone's root offset (is in the parent's coordinate system) */
|
||||
VECCOPY(offs_bone[3], bone->head);
|
||||
copy_v3_v3(offs_bone[3], bone->head);
|
||||
|
||||
/* Get the length translation of parent (length along y axis) */
|
||||
offs_bone[3][1]+= parbone->length;
|
||||
@@ -431,7 +431,7 @@ static short apply_targetless_ik(Object *ob)
|
||||
copy_m4_m4(rmat, parbone->arm_mat); /* rmat used as temp */
|
||||
|
||||
/* the location of actual parent transform */
|
||||
VECCOPY(rmat[3], offs_bone[3]);
|
||||
copy_v3_v3(rmat[3], offs_bone[3]);
|
||||
offs_bone[3][0]= offs_bone[3][1]= offs_bone[3][2]= 0.0f;
|
||||
mul_m4_v3(parchan->parent->pose_mat, rmat[3]);
|
||||
|
||||
@@ -449,7 +449,7 @@ static short apply_targetless_ik(Object *ob)
|
||||
else {
|
||||
copy_m4_m3(tmat, bone->bone_mat);
|
||||
|
||||
VECCOPY(tmat[3], bone->head);
|
||||
copy_v3_v3(tmat[3], bone->head);
|
||||
invert_m4_m4(imat, tmat);
|
||||
}
|
||||
/* result matrix */
|
||||
@@ -491,7 +491,7 @@ static short apply_targetless_ik(Object *ob)
|
||||
|
||||
/* causes problems with some constraints (e.g. childof), so disable this */
|
||||
/* as it is IK shouldn't affect location directly */
|
||||
/* VECCOPY(parchan->loc, rmat[3]); */
|
||||
/* copy_v3_v3(parchan->loc, rmat[3]); */
|
||||
}
|
||||
|
||||
}
|
||||
@@ -511,8 +511,8 @@ static void add_pose_transdata(TransInfo *t, bPoseChannel *pchan, Object *ob, Tr
|
||||
float cmat[3][3], tmat[3][3];
|
||||
float vec[3];
|
||||
|
||||
VECCOPY(vec, pchan->pose_mat[3]);
|
||||
VECCOPY(td->center, vec);
|
||||
copy_v3_v3(vec, pchan->pose_mat[3]);
|
||||
copy_v3_v3(td->center, vec);
|
||||
|
||||
td->ob = ob;
|
||||
td->flag = TD_SELECTED;
|
||||
@@ -530,10 +530,10 @@ static void add_pose_transdata(TransInfo *t, bPoseChannel *pchan, Object *ob, Tr
|
||||
td->protectflag= pchan->protectflag;
|
||||
|
||||
td->loc = pchan->loc;
|
||||
VECCOPY(td->iloc, pchan->loc);
|
||||
copy_v3_v3(td->iloc, pchan->loc);
|
||||
|
||||
td->ext->size= pchan->size;
|
||||
VECCOPY(td->ext->isize, pchan->size);
|
||||
copy_v3_v3(td->ext->isize, pchan->size);
|
||||
|
||||
if (pchan->rotmode > 0) {
|
||||
td->ext->rot= pchan->eul;
|
||||
@@ -541,7 +541,7 @@ static void add_pose_transdata(TransInfo *t, bPoseChannel *pchan, Object *ob, Tr
|
||||
td->ext->rotAngle= NULL;
|
||||
td->ext->quat= NULL;
|
||||
|
||||
VECCOPY(td->ext->irot, pchan->eul);
|
||||
copy_v3_v3(td->ext->irot, pchan->eul);
|
||||
}
|
||||
else if (pchan->rotmode == ROT_MODE_AXISANGLE) {
|
||||
td->ext->rot= NULL;
|
||||
@@ -550,7 +550,7 @@ static void add_pose_transdata(TransInfo *t, bPoseChannel *pchan, Object *ob, Tr
|
||||
td->ext->quat= NULL;
|
||||
|
||||
td->ext->irotAngle= pchan->rotAngle;
|
||||
VECCOPY(td->ext->irotAxis, pchan->rotAxis);
|
||||
copy_v3_v3(td->ext->irotAxis, pchan->rotAxis);
|
||||
}
|
||||
else {
|
||||
td->ext->rot= NULL;
|
||||
@@ -626,7 +626,7 @@ static void add_pose_transdata(TransInfo *t, bPoseChannel *pchan, Object *ob, Tr
|
||||
else {
|
||||
// abusive storage of scale in the loc pointer :)
|
||||
td->loc= &bone->xwidth;
|
||||
VECCOPY (td->iloc, td->loc);
|
||||
copy_v3_v3(td->iloc, td->loc);
|
||||
td->val= NULL;
|
||||
}
|
||||
}
|
||||
@@ -636,13 +636,13 @@ static void add_pose_transdata(TransInfo *t, bPoseChannel *pchan, Object *ob, Tr
|
||||
bKinematicConstraint *data= has_targetless_ik(pchan);
|
||||
if(data) {
|
||||
if(data->flag & CONSTRAINT_IK_TIP) {
|
||||
VECCOPY(data->grabtarget, pchan->pose_tail);
|
||||
copy_v3_v3(data->grabtarget, pchan->pose_tail);
|
||||
}
|
||||
else {
|
||||
VECCOPY(data->grabtarget, pchan->pose_head);
|
||||
copy_v3_v3(data->grabtarget, pchan->pose_head);
|
||||
}
|
||||
td->loc = data->grabtarget;
|
||||
VECCOPY(td->iloc, td->loc);
|
||||
copy_v3_v3(td->iloc, td->loc);
|
||||
data->flag |= CONSTRAINT_IK_AUTO;
|
||||
|
||||
/* only object matrix correction */
|
||||
@@ -885,7 +885,7 @@ static short pose_grab_with_ik_add(bPoseChannel *pchan)
|
||||
else
|
||||
data->flag= CONSTRAINT_IK_TIP;
|
||||
data->flag |= CONSTRAINT_IK_TEMP|CONSTRAINT_IK_AUTO;
|
||||
VECCOPY(data->grabtarget, pchan->pose_tail);
|
||||
copy_v3_v3(data->grabtarget, pchan->pose_tail);
|
||||
data->rootbone= 0; /* watch-it! has to be 0 here, since we're still on the same bone for the first time through the loop [#25885] */
|
||||
|
||||
/* we only include bones that are part of a continual connected chain */
|
||||
@@ -1109,7 +1109,7 @@ static void createTransArmatureVerts(TransInfo *t)
|
||||
td->val= &ebo->rad_head;
|
||||
td->ival= *td->val;
|
||||
|
||||
VECCOPY (td->center, ebo->head);
|
||||
copy_v3_v3(td->center, ebo->head);
|
||||
td->flag= TD_SELECTED;
|
||||
|
||||
copy_m3_m3(td->smtx, smtx);
|
||||
@@ -1125,7 +1125,7 @@ static void createTransArmatureVerts(TransInfo *t)
|
||||
{
|
||||
td->val= &ebo->rad_tail;
|
||||
td->ival= *td->val;
|
||||
VECCOPY (td->center, ebo->tail);
|
||||
copy_v3_v3(td->center, ebo->tail);
|
||||
td->flag= TD_SELECTED;
|
||||
|
||||
copy_m3_m3(td->smtx, smtx);
|
||||
@@ -1152,10 +1152,10 @@ static void createTransArmatureVerts(TransInfo *t)
|
||||
{
|
||||
// abusive storage of scale in the loc pointer :)
|
||||
td->loc= &ebo->xwidth;
|
||||
VECCOPY (td->iloc, td->loc);
|
||||
copy_v3_v3(td->iloc, td->loc);
|
||||
td->val= NULL;
|
||||
}
|
||||
VECCOPY (td->center, ebo->head);
|
||||
copy_v3_v3(td->center, ebo->head);
|
||||
td->flag= TD_SELECTED;
|
||||
|
||||
/* use local bone matrix */
|
||||
@@ -1181,7 +1181,7 @@ static void createTransArmatureVerts(TransInfo *t)
|
||||
td->val= &(ebo->roll);
|
||||
td->ival= ebo->roll;
|
||||
|
||||
VECCOPY (td->center, ebo->head);
|
||||
copy_v3_v3(td->center, ebo->head);
|
||||
td->flag= TD_SELECTED;
|
||||
|
||||
td->ext = NULL;
|
||||
@@ -1194,8 +1194,8 @@ static void createTransArmatureVerts(TransInfo *t)
|
||||
{
|
||||
if (ebo->flag & BONE_TIPSEL)
|
||||
{
|
||||
VECCOPY (td->iloc, ebo->tail);
|
||||
VECCOPY (td->center, td->iloc);
|
||||
copy_v3_v3(td->iloc, ebo->tail);
|
||||
copy_v3_v3(td->center, td->iloc);
|
||||
td->loc= ebo->tail;
|
||||
td->flag= TD_SELECTED;
|
||||
if (ebo->flag & BONE_EDITMODE_LOCKED)
|
||||
@@ -1220,8 +1220,8 @@ static void createTransArmatureVerts(TransInfo *t)
|
||||
}
|
||||
if (ebo->flag & BONE_ROOTSEL)
|
||||
{
|
||||
VECCOPY (td->iloc, ebo->head);
|
||||
VECCOPY (td->center, td->iloc);
|
||||
copy_v3_v3(td->iloc, ebo->head);
|
||||
copy_v3_v3(td->center, td->iloc);
|
||||
td->loc= ebo->head;
|
||||
td->flag= TD_SELECTED;
|
||||
if (ebo->flag & BONE_EDITMODE_LOCKED)
|
||||
@@ -1279,8 +1279,8 @@ static void createTransMBallVerts(TransInfo *t)
|
||||
for(ml= mb->editelems->first; ml; ml= ml->next) {
|
||||
if(propmode || (ml->flag & SELECT)) {
|
||||
td->loc= &ml->x;
|
||||
VECCOPY(td->iloc, td->loc);
|
||||
VECCOPY(td->center, td->loc);
|
||||
copy_v3_v3(td->iloc, td->loc);
|
||||
copy_v3_v3(td->center, td->loc);
|
||||
|
||||
if(ml->flag & SELECT) td->flag= TD_SELECTED | TD_USEQUAT | TD_SINGLESIZE;
|
||||
else td->flag= TD_USEQUAT;
|
||||
@@ -1444,9 +1444,9 @@ static void createTransCurveVerts(bContext *C, TransInfo *t)
|
||||
((bezt->f2 & SELECT) && hide_handles) ||
|
||||
((bezt->f1 & SELECT) && hide_handles == 0)
|
||||
) {
|
||||
VECCOPY(td->iloc, bezt->vec[0]);
|
||||
copy_v3_v3(td->iloc, bezt->vec[0]);
|
||||
td->loc= bezt->vec[0];
|
||||
VECCOPY(td->center, bezt->vec[(hide_handles || bezt->f2 & SELECT) ? 1:0]);
|
||||
copy_v3_v3(td->center, bezt->vec[(hide_handles || bezt->f2 & SELECT) ? 1:0]);
|
||||
if (hide_handles) {
|
||||
if(bezt->f2 & SELECT) td->flag= TD_SELECTED;
|
||||
else td->flag= 0;
|
||||
@@ -1469,9 +1469,9 @@ static void createTransCurveVerts(bContext *C, TransInfo *t)
|
||||
|
||||
/* This is the Curve Point, the other two are handles */
|
||||
if(propmode || (bezt->f2 & SELECT)) {
|
||||
VECCOPY(td->iloc, bezt->vec[1]);
|
||||
copy_v3_v3(td->iloc, bezt->vec[1]);
|
||||
td->loc= bezt->vec[1];
|
||||
VECCOPY(td->center, td->loc);
|
||||
copy_v3_v3(td->center, td->loc);
|
||||
if(bezt->f2 & SELECT) td->flag= TD_SELECTED;
|
||||
else td->flag= 0;
|
||||
td->ext = NULL;
|
||||
@@ -1503,9 +1503,9 @@ static void createTransCurveVerts(bContext *C, TransInfo *t)
|
||||
((bezt->f2 & SELECT) && hide_handles) ||
|
||||
((bezt->f3 & SELECT) && hide_handles == 0)
|
||||
) {
|
||||
VECCOPY(td->iloc, bezt->vec[2]);
|
||||
copy_v3_v3(td->iloc, bezt->vec[2]);
|
||||
td->loc= bezt->vec[2];
|
||||
VECCOPY(td->center, bezt->vec[(hide_handles || bezt->f2 & SELECT) ? 1:2]);
|
||||
copy_v3_v3(td->center, bezt->vec[(hide_handles || bezt->f2 & SELECT) ? 1:2]);
|
||||
if (hide_handles) {
|
||||
if(bezt->f2 & SELECT) td->flag= TD_SELECTED;
|
||||
else td->flag= 0;
|
||||
@@ -1547,9 +1547,9 @@ static void createTransCurveVerts(bContext *C, TransInfo *t)
|
||||
for(a= nu->pntsu*nu->pntsv, bp= nu->bp; a>0; a--, bp++) {
|
||||
if(bp->hide==0) {
|
||||
if(propmode || (bp->f1 & SELECT)) {
|
||||
VECCOPY(td->iloc, bp->vec);
|
||||
copy_v3_v3(td->iloc, bp->vec);
|
||||
td->loc= bp->vec;
|
||||
VECCOPY(td->center, td->loc);
|
||||
copy_v3_v3(td->center, td->loc);
|
||||
if(bp->f1 & SELECT) td->flag= TD_SELECTED;
|
||||
else td->flag= 0;
|
||||
td->ext = NULL;
|
||||
@@ -1619,9 +1619,9 @@ static void createTransLatticeVerts(TransInfo *t)
|
||||
while(a--) {
|
||||
if(propmode || (bp->f1 & SELECT)) {
|
||||
if(bp->hide==0) {
|
||||
VECCOPY(td->iloc, bp->vec);
|
||||
copy_v3_v3(td->iloc, bp->vec);
|
||||
td->loc= bp->vec;
|
||||
VECCOPY(td->center, td->loc);
|
||||
copy_v3_v3(td->center, td->loc);
|
||||
if(bp->f1 & SELECT) td->flag= TD_SELECTED;
|
||||
else td->flag= 0;
|
||||
copy_m3_m3(td->smtx, smtx);
|
||||
@@ -1714,15 +1714,15 @@ static void createTransParticleVerts(bContext *C, TransInfo *t)
|
||||
|
||||
for(k=0, key=point->keys; k<point->totkey; k++, key++) {
|
||||
if(key->flag & PEK_USE_WCO) {
|
||||
VECCOPY(key->world_co, key->co);
|
||||
copy_v3_v3(key->world_co, key->co);
|
||||
mul_m4_v3(mat, key->world_co);
|
||||
td->loc = key->world_co;
|
||||
}
|
||||
else
|
||||
td->loc = key->co;
|
||||
|
||||
VECCOPY(td->iloc, td->loc);
|
||||
VECCOPY(td->center, td->loc);
|
||||
copy_v3_v3(td->iloc, td->loc);
|
||||
copy_v3_v3(td->center, td->loc);
|
||||
|
||||
if(key->flag & PEK_SELECT)
|
||||
td->flag |= TD_SELECTED;
|
||||
@@ -1787,13 +1787,13 @@ void flushTransParticles(TransInfo *t)
|
||||
invert_m4_m4(imat,mat);
|
||||
|
||||
for(k=0, key=point->keys; k<point->totkey; k++, key++) {
|
||||
VECCOPY(co, key->world_co);
|
||||
copy_v3_v3(co, key->world_co);
|
||||
mul_m4_v3(imat, co);
|
||||
|
||||
|
||||
/* optimization for proportional edit */
|
||||
if(!propmode || !compare_v3v3(key->co, co, 0.0001f)) {
|
||||
VECCOPY(key->co, co);
|
||||
copy_v3_v3(key->co, co);
|
||||
point->flag |= PEP_EDIT_RECALC;
|
||||
}
|
||||
}
|
||||
@@ -1910,7 +1910,7 @@ static void get_face_center(float *cent, EditMesh *em, EditVert *eve)
|
||||
if(efa->v1==eve || efa->v2==eve || efa->v3==eve || efa->v4==eve)
|
||||
break;
|
||||
if(efa) {
|
||||
VECCOPY(cent, efa->cent);
|
||||
copy_v3_v3(cent, efa->cent);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1924,13 +1924,13 @@ static void VertsToTransData(TransInfo *t, TransData *td, EditMesh *em, EditVert
|
||||
//else
|
||||
td->loc = eve->co;
|
||||
|
||||
VECCOPY(td->center, td->loc);
|
||||
copy_v3_v3(td->center, td->loc);
|
||||
if(t->around==V3D_LOCAL && (em->selectmode & SCE_SELECT_FACE))
|
||||
get_face_center(td->center, em, eve);
|
||||
VECCOPY(td->iloc, td->loc);
|
||||
copy_v3_v3(td->iloc, td->loc);
|
||||
|
||||
// Setting normals
|
||||
VECCOPY(td->axismtx[2], eve->no);
|
||||
copy_v3_v3(td->axismtx[2], eve->no);
|
||||
td->axismtx[0][0] =
|
||||
td->axismtx[0][1] =
|
||||
td->axismtx[0][2] =
|
||||
@@ -1960,9 +1960,9 @@ static void createTransBMeshVerts(TransInfo *t, BME_Mesh *bm, BME_TransData_Head
|
||||
if ( (vtd = BME_get_transdata(td,v)) ) {
|
||||
tob->loc = vtd->loc;
|
||||
tob->val = &vtd->factor;
|
||||
VECCOPY(tob->iloc,vtd->co);
|
||||
VECCOPY(tob->center,vtd->org);
|
||||
VECCOPY(tob->axismtx[0],vtd->vec);
|
||||
copy_v3_v3(tob->iloc,vtd->co);
|
||||
copy_v3_v3(tob->center,vtd->org);
|
||||
copy_v3_v3(tob->axismtx[0],vtd->vec);
|
||||
tob->axismtx[1][0] = vtd->max ? *vtd->max : 0;
|
||||
tob++;
|
||||
i++;
|
||||
@@ -2305,8 +2305,8 @@ static void UVsToTransData(SpaceImage *sima, TransData *td, TransData2D *td2d, f
|
||||
|
||||
td->flag = 0;
|
||||
td->loc = td2d->loc;
|
||||
VECCOPY(td->center, td->loc);
|
||||
VECCOPY(td->iloc, td->loc);
|
||||
copy_v3_v3(td->center, td->loc);
|
||||
copy_v3_v3(td->iloc, td->loc);
|
||||
|
||||
memset(td->axismtx, 0, sizeof(td->axismtx));
|
||||
td->axismtx[2][2] = 1.0f;
|
||||
@@ -2606,10 +2606,10 @@ static void createTransNlaData(bContext *C, TransInfo *t)
|
||||
/* now, link the transform data up to this data */
|
||||
if (ELEM(t->mode, TFM_TRANSLATION, TFM_TIME_EXTEND)) {
|
||||
td->loc= tdn->h1;
|
||||
VECCOPY(td->iloc, tdn->h1);
|
||||
copy_v3_v3(td->iloc, tdn->h1);
|
||||
|
||||
/* store all the other gunk that is required by transform */
|
||||
VECCOPY(td->center, center);
|
||||
copy_v3_v3(td->center, center);
|
||||
memset(td->axismtx, 0, sizeof(td->axismtx));
|
||||
td->axismtx[2][2] = 1.0f;
|
||||
|
||||
@@ -2638,10 +2638,10 @@ static void createTransNlaData(bContext *C, TransInfo *t)
|
||||
/* now, link the transform data up to this data */
|
||||
if (ELEM(t->mode, TFM_TRANSLATION, TFM_TIME_EXTEND)) {
|
||||
td->loc= tdn->h2;
|
||||
VECCOPY(td->iloc, tdn->h2);
|
||||
copy_v3_v3(td->iloc, tdn->h2);
|
||||
|
||||
/* store all the other gunk that is required by transform */
|
||||
VECCOPY(td->center, center);
|
||||
copy_v3_v3(td->center, center);
|
||||
memset(td->axismtx, 0, sizeof(td->axismtx));
|
||||
td->axismtx[2][2] = 1.0f;
|
||||
|
||||
@@ -3194,7 +3194,7 @@ static void bezt_to_transdata (TransData *td, TransData2D *td2d, AnimData *adt,
|
||||
td->center[1] = cent[1];
|
||||
td->center[2] = 0.0f;
|
||||
|
||||
VECCOPY(td->iloc, td->loc);
|
||||
copy_v3_v3(td->iloc, td->loc);
|
||||
}
|
||||
else {
|
||||
td2d->loc[0] = loc[0];
|
||||
@@ -3203,8 +3203,8 @@ static void bezt_to_transdata (TransData *td, TransData2D *td2d, AnimData *adt,
|
||||
td2d->loc2d = loc;
|
||||
|
||||
td->loc = td2d->loc;
|
||||
VECCOPY(td->center, cent);
|
||||
VECCOPY(td->iloc, td->loc);
|
||||
copy_v3_v3(td->center, cent);
|
||||
copy_v3_v3(td->iloc, td->loc);
|
||||
}
|
||||
|
||||
if (td->flag & TD_MOVEHANDLE1) {
|
||||
@@ -3903,8 +3903,8 @@ static TransData *SeqToTransData(TransData *td, TransData2D *td2d, TransDataSeq
|
||||
|
||||
td->flag = 0;
|
||||
td->loc = td2d->loc;
|
||||
VECCOPY(td->center, td->loc);
|
||||
VECCOPY(td->iloc, td->loc);
|
||||
copy_v3_v3(td->center, td->loc);
|
||||
copy_v3_v3(td->iloc, td->loc);
|
||||
|
||||
memset(td->axismtx, 0, sizeof(td->axismtx));
|
||||
td->axismtx[2][2] = 1.0f;
|
||||
@@ -4255,7 +4255,7 @@ static void ObjectToTransData(TransInfo *t, TransData *td, Object *ob)
|
||||
td->ob = ob;
|
||||
|
||||
td->loc = ob->loc;
|
||||
VECCOPY(td->iloc, td->loc);
|
||||
copy_v3_v3(td->iloc, td->loc);
|
||||
|
||||
if (ob->rotmode > 0) {
|
||||
td->ext->rot= ob->rot;
|
||||
@@ -4263,8 +4263,8 @@ static void ObjectToTransData(TransInfo *t, TransData *td, Object *ob)
|
||||
td->ext->rotAngle= NULL;
|
||||
td->ext->quat= NULL;
|
||||
|
||||
VECCOPY(td->ext->irot, ob->rot);
|
||||
VECCOPY(td->ext->drot, ob->drot);
|
||||
copy_v3_v3(td->ext->irot, ob->rot);
|
||||
copy_v3_v3(td->ext->drot, ob->drot);
|
||||
}
|
||||
else if (ob->rotmode == ROT_MODE_AXISANGLE) {
|
||||
td->ext->rot= NULL;
|
||||
@@ -4273,9 +4273,9 @@ static void ObjectToTransData(TransInfo *t, TransData *td, Object *ob)
|
||||
td->ext->quat= NULL;
|
||||
|
||||
td->ext->irotAngle= ob->rotAngle;
|
||||
VECCOPY(td->ext->irotAxis, ob->rotAxis);
|
||||
copy_v3_v3(td->ext->irotAxis, ob->rotAxis);
|
||||
// td->ext->drotAngle= ob->drotAngle; // XXX, not implimented
|
||||
// VECCOPY(td->ext->drotAxis, ob->drotAxis); // XXX, not implimented
|
||||
// copy_v3_v3(td->ext->drotAxis, ob->drotAxis); // XXX, not implimented
|
||||
}
|
||||
else {
|
||||
td->ext->rot= NULL;
|
||||
@@ -4289,10 +4289,10 @@ static void ObjectToTransData(TransInfo *t, TransData *td, Object *ob)
|
||||
td->ext->rotOrder=ob->rotmode;
|
||||
|
||||
td->ext->size = ob->size;
|
||||
VECCOPY(td->ext->isize, ob->size);
|
||||
VECCOPY(td->ext->dsize, ob->dsize);
|
||||
copy_v3_v3(td->ext->isize, ob->size);
|
||||
copy_v3_v3(td->ext->dsize, ob->dsize);
|
||||
|
||||
VECCOPY(td->center, ob->obmat[3]);
|
||||
copy_v3_v3(td->center, ob->obmat[3]);
|
||||
|
||||
copy_m4_m4(td->ext->obmat, ob->obmat);
|
||||
|
||||
@@ -5202,8 +5202,8 @@ static void NodeToTransData(TransData *td, TransData2D *td2d, bNode *node)
|
||||
}
|
||||
|
||||
td->loc = td2d->loc;
|
||||
VECCOPY(td->center, td->loc);
|
||||
VECCOPY(td->iloc, td->loc);
|
||||
copy_v3_v3(td->center, td->loc);
|
||||
copy_v3_v3(td->iloc, td->loc);
|
||||
|
||||
memset(td->axismtx, 0, sizeof(td->axismtx));
|
||||
td->axismtx[2][2] = 1.0f;
|
||||
|
@@ -115,9 +115,9 @@ void getViewVector(TransInfo *t, float coord[3], float vec[3])
|
||||
{
|
||||
float p1[4], p2[4];
|
||||
|
||||
VECCOPY(p1, coord);
|
||||
copy_v3_v3(p1, coord);
|
||||
p1[3] = 1.0f;
|
||||
VECCOPY(p2, p1);
|
||||
copy_v3_v3(p2, p1);
|
||||
p2[3] = 1.0f;
|
||||
mul_m4_v4(t->viewmat, p2);
|
||||
|
||||
@@ -130,7 +130,7 @@ void getViewVector(TransInfo *t, float coord[3], float vec[3])
|
||||
sub_v3_v3v3(vec, p1, p2);
|
||||
}
|
||||
else {
|
||||
VECCOPY(vec, t->viewinv[2]);
|
||||
copy_v3_v3(vec, t->viewinv[2]);
|
||||
}
|
||||
normalize_v3(vec);
|
||||
}
|
||||
@@ -694,12 +694,12 @@ static void recalcData_view3d(TransInfo *t)
|
||||
if ((ebo->flag & BONE_CONNECTED) && ebo->parent){
|
||||
/* If this bone has a parent tip that has been moved */
|
||||
if (ebo->parent->flag & BONE_TIPSEL){
|
||||
VECCOPY (ebo->head, ebo->parent->tail);
|
||||
copy_v3_v3 (ebo->head, ebo->parent->tail);
|
||||
if(t->mode==TFM_BONE_ENVELOPE) ebo->rad_head= ebo->parent->rad_tail;
|
||||
}
|
||||
/* If this bone has a parent tip that has NOT been moved */
|
||||
else{
|
||||
VECCOPY (ebo->parent->tail, ebo->head);
|
||||
copy_v3_v3 (ebo->parent->tail, ebo->head);
|
||||
if(t->mode==TFM_BONE_ENVELOPE) ebo->parent->rad_tail= ebo->rad_head;
|
||||
}
|
||||
}
|
||||
@@ -736,7 +736,7 @@ static void recalcData_view3d(TransInfo *t)
|
||||
float qrot[4];
|
||||
|
||||
ebo = td->extra;
|
||||
VECCOPY(up_axis, td->axismtx[2]);
|
||||
copy_v3_v3(up_axis, td->axismtx[2]);
|
||||
|
||||
if (t->mode != TFM_ROTATION)
|
||||
{
|
||||
@@ -1259,12 +1259,12 @@ void applyTransObjects(TransInfo *t)
|
||||
TransData *td;
|
||||
|
||||
for (td = t->data; td < t->data + t->total; td++) {
|
||||
VECCOPY(td->iloc, td->loc);
|
||||
copy_v3_v3(td->iloc, td->loc);
|
||||
if (td->ext->rot) {
|
||||
VECCOPY(td->ext->irot, td->ext->rot);
|
||||
copy_v3_v3(td->ext->irot, td->ext->rot);
|
||||
}
|
||||
if (td->ext->size) {
|
||||
VECCOPY(td->ext->isize, td->ext->size);
|
||||
copy_v3_v3(td->ext->isize, td->ext->size);
|
||||
}
|
||||
}
|
||||
recalcData(t);
|
||||
@@ -1273,7 +1273,7 @@ void applyTransObjects(TransInfo *t)
|
||||
static void restoreElement(TransData *td) {
|
||||
/* TransData for crease has no loc */
|
||||
if (td->loc) {
|
||||
VECCOPY(td->loc, td->iloc);
|
||||
copy_v3_v3(td->loc, td->iloc);
|
||||
}
|
||||
if (td->val) {
|
||||
*td->val = td->ival;
|
||||
@@ -1281,17 +1281,17 @@ static void restoreElement(TransData *td) {
|
||||
|
||||
if (td->ext && (td->flag&TD_NO_EXT)==0) {
|
||||
if (td->ext->rot) {
|
||||
VECCOPY(td->ext->rot, td->ext->irot);
|
||||
copy_v3_v3(td->ext->rot, td->ext->irot);
|
||||
}
|
||||
if(td->ext->rotAngle) {
|
||||
*td->ext->rotAngle= td->ext->irotAngle;
|
||||
}
|
||||
if(td->ext->rotAxis) {
|
||||
VECCOPY(td->ext->rotAxis, td->ext->irotAxis);
|
||||
copy_v3_v3(td->ext->rotAxis, td->ext->irotAxis);
|
||||
}
|
||||
/* XXX, drotAngle & drotAxis not used yet */
|
||||
if (td->ext->size) {
|
||||
VECCOPY(td->ext->size, td->ext->isize);
|
||||
copy_v3_v3(td->ext->size, td->ext->isize);
|
||||
}
|
||||
if (td->ext->quat) {
|
||||
QUATCOPY(td->ext->quat, td->ext->iquat);
|
||||
@@ -1335,7 +1335,7 @@ void calculateCenter2D(TransInfo *t)
|
||||
Object *ob= t->obedit?t->obedit:t->poseobj;
|
||||
float vec[3];
|
||||
|
||||
VECCOPY(vec, t->center);
|
||||
copy_v3_v3(vec, t->center);
|
||||
mul_m4_v3(ob->obmat, vec);
|
||||
projectIntView(t, vec, t->center2d);
|
||||
}
|
||||
@@ -1349,7 +1349,7 @@ void calculateCenterCursor(TransInfo *t)
|
||||
float *cursor;
|
||||
|
||||
cursor = give_cursor(t->scene, t->view);
|
||||
VECCOPY(t->center, cursor);
|
||||
copy_v3_v3(t->center, cursor);
|
||||
|
||||
/* If edit or pose mode, move cursor in local space */
|
||||
if (t->flag & (T_EDIT|T_POSE)) {
|
||||
@@ -1421,7 +1421,7 @@ void calculateCenterMedian(TransInfo *t)
|
||||
}
|
||||
if(i)
|
||||
mul_v3_fl(partial, 1.0f / total);
|
||||
VECCOPY(t->center, partial);
|
||||
copy_v3_v3(t->center, partial);
|
||||
|
||||
calculateCenter2D(t);
|
||||
}
|
||||
@@ -1446,8 +1446,8 @@ void calculateCenterBound(TransInfo *t)
|
||||
}
|
||||
}
|
||||
else {
|
||||
VECCOPY(max, t->data[i].center);
|
||||
VECCOPY(min, t->data[i].center);
|
||||
copy_v3_v3(max, t->data[i].center);
|
||||
copy_v3_v3(min, t->data[i].center);
|
||||
}
|
||||
}
|
||||
add_v3_v3v3(t->center, min, max);
|
||||
@@ -1501,7 +1501,7 @@ void calculateCenter(TransInfo *t)
|
||||
Object *ob= OBACT;
|
||||
if(ob)
|
||||
{
|
||||
VECCOPY(t->center, ob->obmat[3]);
|
||||
copy_v3_v3(t->center, ob->obmat[3]);
|
||||
projectIntView(t, t->center, t->center2d);
|
||||
}
|
||||
}
|
||||
@@ -1510,7 +1510,7 @@ void calculateCenter(TransInfo *t)
|
||||
}
|
||||
|
||||
/* setting constraint center */
|
||||
VECCOPY(t->con.center, t->center);
|
||||
copy_v3_v3(t->con.center, t->center);
|
||||
if(t->flag & (T_EDIT|T_POSE))
|
||||
{
|
||||
Object *ob= t->obedit?t->obedit:t->poseobj;
|
||||
@@ -1530,7 +1530,7 @@ void calculateCenter(TransInfo *t)
|
||||
{
|
||||
float axis[3];
|
||||
/* persinv is nasty, use viewinv instead, always right */
|
||||
VECCOPY(axis, t->viewinv[2]);
|
||||
copy_v3_v3(axis, t->viewinv[2]);
|
||||
normalize_v3(axis);
|
||||
|
||||
/* 6.0 = 6 grid units */
|
||||
@@ -1543,8 +1543,8 @@ void calculateCenter(TransInfo *t)
|
||||
/* rotate only needs correct 2d center, grab needs initgrabz() value */
|
||||
if(t->mode==TFM_TRANSLATION)
|
||||
{
|
||||
VECCOPY(t->center, axis);
|
||||
VECCOPY(t->con.center, t->center);
|
||||
copy_v3_v3(t->center, axis);
|
||||
copy_v3_v3(t->con.center, t->center);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1557,7 +1557,7 @@ void calculateCenter(TransInfo *t)
|
||||
Object *ob= t->obedit?t->obedit:t->poseobj;
|
||||
float vec[3];
|
||||
|
||||
VECCOPY(vec, t->center);
|
||||
copy_v3_v3(vec, t->center);
|
||||
mul_m4_v3(ob->obmat, vec);
|
||||
initgrabz(t->ar->regiondata, vec[0], vec[1], vec[2]);
|
||||
}
|
||||
|
@@ -884,7 +884,7 @@ static void draw_manipulator_rotate(View3D *v3d, RegionView3D *rv3d, int moving,
|
||||
|
||||
if(arcs) {
|
||||
/* clipplane makes nice handles, calc here because of multmatrix but with translate! */
|
||||
VECCOPY(plane, rv3d->viewinv[2]);
|
||||
VECCOPY(plane, rv3d->viewinv[2]); /* float -> double */
|
||||
plane[3]= -0.02f*size; // clip just a bit more
|
||||
glClipPlane(GL_CLIP_PLANE0, plane);
|
||||
}
|
||||
@@ -1498,15 +1498,15 @@ void BIF_draw_manipulator(const bContext *C)
|
||||
if(v3d->around==V3D_ACTIVE && scene->obedit==NULL) {
|
||||
Object *ob= OBACT;
|
||||
if(ob && !(ob->mode & OB_MODE_POSE))
|
||||
VECCOPY(rv3d->twmat[3], ob->obmat[3]);
|
||||
copy_v3_v3(rv3d->twmat[3], ob->obmat[3]);
|
||||
}
|
||||
break;
|
||||
case V3D_LOCAL:
|
||||
case V3D_CENTROID:
|
||||
VECCOPY(rv3d->twmat[3], scene->twcent);
|
||||
copy_v3_v3(rv3d->twmat[3], scene->twcent);
|
||||
break;
|
||||
case V3D_CURSOR:
|
||||
VECCOPY(rv3d->twmat[3], give_cursor(scene, v3d));
|
||||
copy_v3_v3(rv3d->twmat[3], give_cursor(scene, v3d));
|
||||
break;
|
||||
}
|
||||
|
||||
|
@@ -222,7 +222,7 @@ int createSpaceNormal(float mat[3][3], float normal[3])
|
||||
{
|
||||
float tangent[3] = {0.0f, 0.0f, 1.0f};
|
||||
|
||||
VECCOPY(mat[2], normal);
|
||||
copy_v3_v3(mat[2], normal);
|
||||
if (normalize_v3(mat[2]) == 0.0f) {
|
||||
return 0; /* error return */
|
||||
}
|
||||
@@ -243,7 +243,7 @@ int createSpaceNormal(float mat[3][3], float normal[3])
|
||||
|
||||
int createSpaceNormalTangent(float mat[3][3], float normal[3], float tangent[3])
|
||||
{
|
||||
VECCOPY(mat[2], normal);
|
||||
copy_v3_v3(mat[2], normal);
|
||||
if (normalize_v3(mat[2]) == 0.0f) {
|
||||
return 0; /* error return */
|
||||
}
|
||||
@@ -659,7 +659,7 @@ int getTransformOrientation(const bContext *C, float normal[3], float plane[3],
|
||||
for(eed= em->edges.first; eed; eed= eed->next) {
|
||||
if(eed->f & SELECT) {
|
||||
/* use average vert normals as plane and edge vector as normal */
|
||||
VECCOPY(plane, eed->v1->no);
|
||||
copy_v3_v3(plane, eed->v1->no);
|
||||
VECADD(plane, plane, eed->v2->no);
|
||||
sub_v3_v3v3(normal, eed->v2->co, eed->v1->co);
|
||||
break;
|
||||
@@ -680,7 +680,7 @@ int getTransformOrientation(const bContext *C, float normal[3], float plane[3],
|
||||
else {
|
||||
v2 = eve;
|
||||
|
||||
VECCOPY(plane, v1->no);
|
||||
copy_v3_v3(plane, v1->no);
|
||||
VECADD(plane, plane, v2->no);
|
||||
sub_v3_v3v3(normal, v2->co, v1->co);
|
||||
break;
|
||||
@@ -694,7 +694,7 @@ int getTransformOrientation(const bContext *C, float normal[3], float plane[3],
|
||||
for (eve = em->verts.first; eve; eve = eve->next)
|
||||
{
|
||||
if ( eve->f & SELECT ) {
|
||||
VECCOPY(normal, eve->no);
|
||||
copy_v3_v3(normal, eve->no);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -792,7 +792,7 @@ int getTransformOrientation(const bContext *C, float normal[3], float plane[3],
|
||||
/* Rotation of MetaElem is stored in quat */
|
||||
quat_to_mat4( mat,ml_sel->quat);
|
||||
|
||||
VECCOPY(normal, mat[2]);
|
||||
copy_v3_v3(normal, mat[2]);
|
||||
|
||||
negate_v3_v3(plane, mat[1]);
|
||||
|
||||
@@ -893,8 +893,8 @@ int getTransformOrientation(const bContext *C, float normal[3], float plane[3],
|
||||
}
|
||||
|
||||
if (ob) {
|
||||
VECCOPY(normal, ob->obmat[2]);
|
||||
VECCOPY(plane, ob->obmat[1]);
|
||||
copy_v3_v3(normal, ob->obmat[2]);
|
||||
copy_v3_v3(plane, ob->obmat[1]);
|
||||
}
|
||||
result = ORIENTATION_NORMAL;
|
||||
}
|
||||
|
@@ -264,7 +264,7 @@ void applyProject(TransInfo *t)
|
||||
if (td->flag & TD_SKIP)
|
||||
continue;
|
||||
|
||||
VECCOPY(iloc, td->loc);
|
||||
copy_v3_v3(iloc, td->loc);
|
||||
if (t->flag & (T_EDIT|T_POSE))
|
||||
{
|
||||
Object *ob = t->obedit?t->obedit:t->poseobj;
|
||||
@@ -274,7 +274,7 @@ void applyProject(TransInfo *t)
|
||||
{
|
||||
td->ob->recalc |= OB_RECALC_OB|OB_RECALC_DATA|OB_RECALC_TIME;
|
||||
object_handle_update(t->scene, td->ob);
|
||||
VECCOPY(iloc, td->ob->obmat[3]);
|
||||
copy_v3_v3(iloc, td->ob->obmat[3]);
|
||||
}
|
||||
|
||||
project_float(t->ar, iloc, mval);
|
||||
@@ -543,7 +543,7 @@ void addSnapPoint(TransInfo *t)
|
||||
if (t->tsnap.status & POINT_INIT) {
|
||||
TransSnapPoint *p = MEM_callocN(sizeof(TransSnapPoint), "SnapPoint");
|
||||
|
||||
VECCOPY(p->co, t->tsnap.snapPoint);
|
||||
copy_v3_v3(p->co, t->tsnap.snapPoint);
|
||||
|
||||
BLI_addtail(&t->tsnap.points, p);
|
||||
|
||||
@@ -580,7 +580,7 @@ void getSnapPoint(TransInfo *t, float vec[3])
|
||||
|
||||
mul_v3_fl(vec, 1.0f / total);
|
||||
} else {
|
||||
VECCOPY(vec, t->tsnap.snapPoint)
|
||||
copy_v3_v3(vec, t->tsnap.snapPoint);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -628,7 +628,7 @@ float RotationBetween(TransInfo *t, float p1[3], float p2[3])
|
||||
{
|
||||
float angle, start[3], end[3], center[3];
|
||||
|
||||
VECCOPY(center, t->center);
|
||||
copy_v3_v3(center, t->center);
|
||||
if(t->flag & (T_EDIT|T_POSE)) {
|
||||
Object *ob= t->obedit?t->obedit:t->poseobj;
|
||||
mul_m4_v3(ob->obmat, center);
|
||||
@@ -684,7 +684,7 @@ float ResizeBetween(TransInfo *t, float p1[3], float p2[3])
|
||||
{
|
||||
float d1[3], d2[3], center[3];
|
||||
|
||||
VECCOPY(center, t->center);
|
||||
copy_v3_v3(center, t->center);
|
||||
if(t->flag & (T_EDIT|T_POSE)) {
|
||||
Object *ob= t->obedit?t->obedit:t->poseobj;
|
||||
mul_m4_v3(ob->obmat, center);
|
||||
@@ -784,12 +784,12 @@ void CalcSnapGeometry(TransInfo *t, float *UNUSED(vec))
|
||||
}
|
||||
else
|
||||
{
|
||||
VECCOPY(vec, p1->p);
|
||||
copy_v3_v3(vec, p1->p);
|
||||
}
|
||||
|
||||
if (last_p == NULL)
|
||||
{
|
||||
VECCOPY(p, vec);
|
||||
copy_v3_v3(p, vec);
|
||||
max_dist = 0;
|
||||
break;
|
||||
}
|
||||
@@ -798,7 +798,7 @@ void CalcSnapGeometry(TransInfo *t, float *UNUSED(vec))
|
||||
|
||||
if (new_dist < max_dist)
|
||||
{
|
||||
VECCOPY(p, vec);
|
||||
copy_v3_v3(p, vec);
|
||||
max_dist = new_dist;
|
||||
}
|
||||
}
|
||||
@@ -806,7 +806,7 @@ void CalcSnapGeometry(TransInfo *t, float *UNUSED(vec))
|
||||
|
||||
if (max_dist != FLT_MAX)
|
||||
{
|
||||
VECCOPY(loc, p);
|
||||
copy_v3_v3(loc, p);
|
||||
/* XXX, is there a correct normal in this case ???, for now just z up */
|
||||
no[0]= 0.0;
|
||||
no[1]= 0.0;
|
||||
@@ -830,11 +830,11 @@ void CalcSnapGeometry(TransInfo *t, float *UNUSED(vec))
|
||||
|
||||
if (dot_v3v3(tangent, tangent) > 0)
|
||||
{
|
||||
VECCOPY(t->tsnap.snapTangent, tangent);
|
||||
copy_v3_v3(t->tsnap.snapTangent, tangent);
|
||||
}
|
||||
|
||||
VECCOPY(t->tsnap.snapPoint, loc);
|
||||
VECCOPY(t->tsnap.snapNormal, no);
|
||||
copy_v3_v3(t->tsnap.snapPoint, loc);
|
||||
copy_v3_v3(t->tsnap.snapNormal, no);
|
||||
|
||||
t->tsnap.status |= POINT_INIT;
|
||||
}
|
||||
@@ -873,7 +873,7 @@ void TargetSnapCenter(TransInfo *t)
|
||||
// Only need to calculate once
|
||||
if ((t->tsnap.status & TARGET_INIT) == 0)
|
||||
{
|
||||
VECCOPY(t->tsnap.snapTarget, t->center);
|
||||
copy_v3_v3(t->tsnap.snapTarget, t->center);
|
||||
if(t->flag & (T_EDIT|T_POSE)) {
|
||||
Object *ob= t->obedit?t->obedit:t->poseobj;
|
||||
mul_m4_v3(ob->obmat, t->tsnap.snapTarget);
|
||||
@@ -903,7 +903,7 @@ void TargetSnapActive(TransInfo *t)
|
||||
|
||||
if (active_td)
|
||||
{
|
||||
VECCOPY(t->tsnap.snapTarget, active_td->center);
|
||||
copy_v3_v3(t->tsnap.snapTarget, active_td->center);
|
||||
|
||||
if(t->flag & (T_EDIT|T_POSE)) {
|
||||
Object *ob= t->obedit?t->obedit:t->poseobj;
|
||||
@@ -974,14 +974,14 @@ void TargetSnapClosest(TransInfo *t)
|
||||
float loc[3];
|
||||
float dist;
|
||||
|
||||
VECCOPY(loc, bb->vec[j]);
|
||||
copy_v3_v3(loc, bb->vec[j]);
|
||||
mul_m4_v3(td->ext->obmat, loc);
|
||||
|
||||
dist = t->tsnap.distance(t, loc, t->tsnap.snapPoint);
|
||||
|
||||
if (closest == NULL || fabs(dist) < fabs(t->tsnap.dist))
|
||||
{
|
||||
VECCOPY(t->tsnap.snapTarget, loc);
|
||||
copy_v3_v3(t->tsnap.snapTarget, loc);
|
||||
closest = td;
|
||||
t->tsnap.dist = dist;
|
||||
}
|
||||
@@ -993,13 +993,13 @@ void TargetSnapClosest(TransInfo *t)
|
||||
float loc[3];
|
||||
float dist;
|
||||
|
||||
VECCOPY(loc, td->center);
|
||||
copy_v3_v3(loc, td->center);
|
||||
|
||||
dist = t->tsnap.distance(t, loc, t->tsnap.snapPoint);
|
||||
|
||||
if (closest == NULL || fabs(dist) < fabs(t->tsnap.dist))
|
||||
{
|
||||
VECCOPY(t->tsnap.snapTarget, loc);
|
||||
copy_v3_v3(t->tsnap.snapTarget, loc);
|
||||
closest = td;
|
||||
t->tsnap.dist = dist;
|
||||
}
|
||||
@@ -1014,7 +1014,7 @@ void TargetSnapClosest(TransInfo *t)
|
||||
float loc[3];
|
||||
float dist;
|
||||
|
||||
VECCOPY(loc, td->center);
|
||||
copy_v3_v3(loc, td->center);
|
||||
|
||||
if(t->flag & (T_EDIT|T_POSE)) {
|
||||
Object *ob= t->obedit?t->obedit:t->poseobj;
|
||||
@@ -1025,7 +1025,7 @@ void TargetSnapClosest(TransInfo *t)
|
||||
|
||||
if (closest == NULL || fabs(dist) < fabs(t->tsnap.dist))
|
||||
{
|
||||
VECCOPY(t->tsnap.snapTarget, loc);
|
||||
copy_v3_v3(t->tsnap.snapTarget, loc);
|
||||
closest = td;
|
||||
t->tsnap.dist = dist;
|
||||
}
|
||||
@@ -1052,11 +1052,11 @@ static int snapFace(ARegion *ar, float v1co[3], float v2co[3], float v3co[3], fl
|
||||
int screen_loc[2];
|
||||
int new_dist;
|
||||
|
||||
VECCOPY(intersect, ray_normal_local);
|
||||
copy_v3_v3(intersect, ray_normal_local);
|
||||
mul_v3_fl(intersect, lambda);
|
||||
add_v3_v3(intersect, ray_start_local);
|
||||
|
||||
VECCOPY(location, intersect);
|
||||
copy_v3_v3(location, intersect);
|
||||
|
||||
if (v4co)
|
||||
normal_quad_v3( normal,v1co, v2co, v3co, v4co);
|
||||
@@ -1075,8 +1075,8 @@ static int snapFace(ARegion *ar, float v1co[3], float v2co[3], float v3co[3], fl
|
||||
*depth = new_depth;
|
||||
retval = 1;
|
||||
|
||||
VECCOPY(loc, location);
|
||||
VECCOPY(no, normal);
|
||||
copy_v3_v3(loc, location);
|
||||
copy_v3_v3(no, normal);
|
||||
|
||||
mul_m3_v3(timat, no);
|
||||
normalize_v3(no);
|
||||
@@ -1095,7 +1095,7 @@ static int snapEdge(ARegion *ar, float v1co[3], short v1no[3], float v2co[3], sh
|
||||
int result;
|
||||
int retval = 0;
|
||||
|
||||
VECCOPY(ray_end, ray_normal_local);
|
||||
copy_v3_v3(ray_end, ray_normal_local);
|
||||
mul_v3_fl(ray_end, 2000);
|
||||
add_v3_v3v3(ray_end, ray_start_local, ray_end);
|
||||
|
||||
@@ -1116,11 +1116,11 @@ static int snapEdge(ARegion *ar, float v1co[3], short v1no[3], float v2co[3], sh
|
||||
|
||||
if (mul > 1) {
|
||||
mul = 1;
|
||||
VECCOPY(intersect, v1co);
|
||||
copy_v3_v3(intersect, v1co);
|
||||
}
|
||||
else if (mul < 0) {
|
||||
mul = 0;
|
||||
VECCOPY(intersect, v2co);
|
||||
copy_v3_v3(intersect, v2co);
|
||||
}
|
||||
|
||||
if (dot_v3v3(ray_normal_local, dvec) > 0)
|
||||
@@ -1130,7 +1130,7 @@ static int snapEdge(ARegion *ar, float v1co[3], short v1no[3], float v2co[3], sh
|
||||
int screen_loc[2];
|
||||
int new_dist;
|
||||
|
||||
VECCOPY(location, intersect);
|
||||
copy_v3_v3(location, intersect);
|
||||
|
||||
mul_m4_v3(obmat, location);
|
||||
|
||||
@@ -1164,7 +1164,7 @@ static int snapEdge(ARegion *ar, float v1co[3], short v1no[3], float v2co[3], sh
|
||||
normalize_v3(no);
|
||||
}
|
||||
|
||||
VECCOPY(loc, location);
|
||||
copy_v3_v3(loc, location);
|
||||
|
||||
*dist = new_dist;
|
||||
}
|
||||
@@ -1188,7 +1188,7 @@ static int snapVertex(ARegion *ar, float vco[3], short vno[3], float mval[2], fl
|
||||
int screen_loc[2];
|
||||
int new_dist;
|
||||
|
||||
VECCOPY(location, vco);
|
||||
copy_v3_v3(location, vco);
|
||||
|
||||
mul_m4_v3(obmat, location);
|
||||
|
||||
@@ -1202,7 +1202,7 @@ static int snapVertex(ARegion *ar, float vco[3], short vno[3], float mval[2], fl
|
||||
*depth = new_depth;
|
||||
retval = 1;
|
||||
|
||||
VECCOPY(loc, location);
|
||||
copy_v3_v3(loc, location);
|
||||
|
||||
if (no)
|
||||
{
|
||||
@@ -1226,8 +1226,8 @@ static int snapArmature(short snap_mode, ARegion *ar, Object *ob, bArmature *arm
|
||||
|
||||
invert_m4_m4(imat, obmat);
|
||||
|
||||
VECCOPY(ray_start_local, ray_start);
|
||||
VECCOPY(ray_normal_local, ray_normal);
|
||||
copy_v3_v3(ray_start_local, ray_start);
|
||||
copy_v3_v3(ray_normal_local, ray_normal);
|
||||
|
||||
mul_m4_v3(imat, ray_start_local);
|
||||
mul_mat3_m4_v3(imat, ray_normal_local);
|
||||
@@ -1300,8 +1300,8 @@ static int snapDerivedMesh(short snap_mode, ARegion *ar, Object *ob, DerivedMesh
|
||||
copy_m3_m4(timat, imat);
|
||||
transpose_m3(timat);
|
||||
|
||||
VECCOPY(ray_start_local, ray_start);
|
||||
VECCOPY(ray_normal_local, ray_normal);
|
||||
copy_v3_v3(ray_start_local, ray_start);
|
||||
copy_v3_v3(ray_normal_local, ray_normal);
|
||||
|
||||
mul_m4_v3(imat, ray_start_local);
|
||||
mul_mat3_m4_v3(imat, ray_normal_local);
|
||||
@@ -1699,8 +1699,8 @@ static void addDepthPeel(ListBase *depth_peels, float depth, float p[3], float n
|
||||
|
||||
peel->depth = depth;
|
||||
peel->ob = ob;
|
||||
VECCOPY(peel->p, p);
|
||||
VECCOPY(peel->no, no);
|
||||
copy_v3_v3(peel->p, p);
|
||||
copy_v3_v3(peel->no, no);
|
||||
|
||||
BLI_addtail(depth_peels, peel);
|
||||
|
||||
@@ -1724,8 +1724,8 @@ static int peelDerivedMesh(Object *ob, DerivedMesh *dm, float obmat[][4], float
|
||||
copy_m3_m4(timat, imat);
|
||||
transpose_m3(timat);
|
||||
|
||||
VECCOPY(ray_start_local, ray_start);
|
||||
VECCOPY(ray_normal_local, ray_normal);
|
||||
copy_v3_v3(ray_start_local, ray_start);
|
||||
copy_v3_v3(ray_normal_local, ray_normal);
|
||||
|
||||
mul_m4_v3(imat, ray_start_local);
|
||||
mul_mat3_m4_v3(imat, ray_normal_local);
|
||||
@@ -1757,11 +1757,11 @@ static int peelDerivedMesh(Object *ob, DerivedMesh *dm, float obmat[][4], float
|
||||
float intersect[3];
|
||||
float new_depth;
|
||||
|
||||
VECCOPY(intersect, ray_normal_local);
|
||||
copy_v3_v3(intersect, ray_normal_local);
|
||||
mul_v3_fl(intersect, lambda);
|
||||
add_v3_v3(intersect, ray_start_local);
|
||||
|
||||
VECCOPY(location, intersect);
|
||||
copy_v3_v3(location, intersect);
|
||||
|
||||
if (f->v4)
|
||||
normal_quad_v3( normal,verts[f->v1].co, verts[f->v2].co, verts[f->v3].co, verts[f->v4].co);
|
||||
@@ -1787,11 +1787,11 @@ static int peelDerivedMesh(Object *ob, DerivedMesh *dm, float obmat[][4], float
|
||||
float intersect[3];
|
||||
float new_depth;
|
||||
|
||||
VECCOPY(intersect, ray_normal_local);
|
||||
copy_v3_v3(intersect, ray_normal_local);
|
||||
mul_v3_fl(intersect, lambda);
|
||||
add_v3_v3(intersect, ray_start_local);
|
||||
|
||||
VECCOPY(location, intersect);
|
||||
copy_v3_v3(location, intersect);
|
||||
|
||||
if (f->v4)
|
||||
normal_quad_v3( normal,verts[f->v1].co, verts[f->v2].co, verts[f->v3].co, verts[f->v4].co);
|
||||
|
@@ -116,7 +116,7 @@ static void get_vert2geom_distance(int numVerts, float (*v_cos)[3],
|
||||
float tmp_co[3];
|
||||
|
||||
/* Convert the vertex to tree coordinates. */
|
||||
VECCOPY(tmp_co, v_cos[i]);
|
||||
copy_v3_v3(tmp_co, v_cos[i]);
|
||||
space_transform_apply(loc2trgt, tmp_co);
|
||||
|
||||
/* Use local proximity heuristics (to reduce the nearest search).
|
||||
|
@@ -72,12 +72,12 @@ static void node_shader_exec_geom(void *data, bNode *node, bNodeStack **UNUSED(i
|
||||
}
|
||||
|
||||
/* out: global, local, view, orco, uv, normal, vertex color */
|
||||
VECCOPY(out[GEOM_OUT_GLOB]->vec, shi->gl);
|
||||
VECCOPY(out[GEOM_OUT_LOCAL]->vec, shi->co);
|
||||
VECCOPY(out[GEOM_OUT_VIEW]->vec, shi->view);
|
||||
VECCOPY(out[GEOM_OUT_ORCO]->vec, shi->lo);
|
||||
VECCOPY(out[GEOM_OUT_UV]->vec, suv->uv);
|
||||
VECCOPY(out[GEOM_OUT_NORMAL]->vec, shi->vno);
|
||||
copy_v3_v3(out[GEOM_OUT_GLOB]->vec, shi->gl);
|
||||
copy_v3_v3(out[GEOM_OUT_LOCAL]->vec, shi->co);
|
||||
copy_v3_v3(out[GEOM_OUT_VIEW]->vec, shi->view);
|
||||
copy_v3_v3(out[GEOM_OUT_ORCO]->vec, shi->lo);
|
||||
copy_v3_v3(out[GEOM_OUT_UV]->vec, suv->uv);
|
||||
copy_v3_v3(out[GEOM_OUT_NORMAL]->vec, shi->vno);
|
||||
|
||||
if (shi->totcol) {
|
||||
/* find vertex color layer by name */
|
||||
|
@@ -120,13 +120,11 @@ static void node_shader_exec_material(void *data, bNode *node, bNodeStack **in,
|
||||
normalize_v3(shi->vn);
|
||||
}
|
||||
else
|
||||
VECCOPY(shi->vn, shi->vno);
|
||||
copy_v3_v3(shi->vn, shi->vno);
|
||||
|
||||
/* custom option to flip normal */
|
||||
if(node->custom1 & SH_NODE_MAT_NEG) {
|
||||
shi->vn[0]= -shi->vn[0];
|
||||
shi->vn[1]= -shi->vn[1];
|
||||
shi->vn[2]= -shi->vn[2];
|
||||
negate_v3(shi->vn);
|
||||
}
|
||||
|
||||
if (node->type == SH_NODE_MATERIAL_EXT) {
|
||||
|
@@ -1777,11 +1777,11 @@ void sample_occ(Render *re, ShadeInput *shi)
|
||||
|
||||
if(cache->sample && cache->step) {
|
||||
sample= &cache->sample[(shi->ys-cache->y)*cache->w + (shi->xs-cache->x)];
|
||||
VECCOPY(sample->co, shi->co);
|
||||
VECCOPY(sample->n, shi->vno);
|
||||
VECCOPY(sample->ao, shi->ao);
|
||||
VECCOPY(sample->env, shi->env);
|
||||
VECCOPY(sample->indirect, shi->indirect);
|
||||
copy_v3_v3(sample->co, shi->co);
|
||||
copy_v3_v3(sample->n, shi->vno);
|
||||
copy_v3_v3(sample->ao, shi->ao);
|
||||
copy_v3_v3(sample->env, shi->env);
|
||||
copy_v3_v3(sample->indirect, shi->indirect);
|
||||
sample->intensity= MAX3(sample->ao[0], sample->ao[1], sample->ao[2]);
|
||||
sample->intensity= MAX2(sample->intensity, MAX3(sample->env[0], sample->env[1], sample->env[2]));
|
||||
sample->intensity= MAX2(sample->intensity, MAX3(sample->indirect[0], sample->indirect[1], sample->indirect[2]));
|
||||
@@ -1872,11 +1872,11 @@ void cache_occ_samples(Render *re, RenderPart *pa, ShadeSample *ssamp)
|
||||
exclude.facenr= shi->vlr->index;
|
||||
sample_occ_tree(re, tree, &exclude, shi->co, shi->vno, shi->thread, onlyshadow, shi->ao, shi->env, shi->indirect);
|
||||
|
||||
VECCOPY(sample->co, shi->co);
|
||||
VECCOPY(sample->n, shi->vno);
|
||||
VECCOPY(sample->ao, shi->ao);
|
||||
VECCOPY(sample->env, shi->env);
|
||||
VECCOPY(sample->indirect, shi->indirect);
|
||||
copy_v3_v3(sample->co, shi->co);
|
||||
copy_v3_v3(sample->n, shi->vno);
|
||||
copy_v3_v3(sample->ao, shi->ao);
|
||||
copy_v3_v3(sample->env, shi->env);
|
||||
copy_v3_v3(sample->indirect, shi->indirect);
|
||||
sample->intensity= MAX3(sample->ao[0], sample->ao[1], sample->ao[2]);
|
||||
sample->intensity= MAX2(sample->intensity, MAX3(sample->env[0], sample->env[1], sample->env[2]));
|
||||
sample->intensity= MAX2(sample->intensity, MAX3(sample->indirect[0], sample->indirect[1], sample->indirect[2]));
|
||||
|
@@ -505,7 +505,7 @@ static int stucci(Tex *tex, float *texvec, TexResult *texres)
|
||||
|
||||
if(texres->nor) {
|
||||
|
||||
VECCOPY(texres->nor, nor);
|
||||
copy_v3_v3(texres->nor, nor);
|
||||
tex_normal_derivate(tex, texres);
|
||||
|
||||
if(tex->stype==TEX_WALLOUT) {
|
||||
@@ -755,9 +755,9 @@ static int plugintex(Tex *tex, float *texvec, float *dxt, float *dyt, int osatex
|
||||
if(pit && pit->doit) {
|
||||
if(texres->nor) {
|
||||
if (pit->version < 6) {
|
||||
VECCOPY(pit->result+5, texres->nor);
|
||||
copy_v3_v3(pit->result+5, texres->nor);
|
||||
} else {
|
||||
VECCOPY(result+5, texres->nor);
|
||||
copy_v3_v3(result+5, texres->nor);
|
||||
}
|
||||
}
|
||||
if (pit->version < 6) {
|
||||
@@ -781,9 +781,9 @@ static int plugintex(Tex *tex, float *texvec, float *dxt, float *dyt, int osatex
|
||||
if(rgbnor & TEX_NOR) {
|
||||
if(texres->nor) {
|
||||
if (pit->version < 6) {
|
||||
VECCOPY(texres->nor, pit->result+5);
|
||||
copy_v3_v3(texres->nor, pit->result+5);
|
||||
} else {
|
||||
VECCOPY(texres->nor, result+5);
|
||||
copy_v3_v3(texres->nor, result+5);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -820,7 +820,7 @@ static int cubemap_glob(float *n, float x, float y, float z, float *adr1, float
|
||||
nor[0]= x; nor[1]= y; nor[2]= z; // use local render coord
|
||||
}
|
||||
else {
|
||||
VECCOPY(nor, n);
|
||||
copy_v3_v3(nor, n);
|
||||
}
|
||||
mul_mat3_m4_v3(R.viewinv, nor);
|
||||
|
||||
@@ -914,7 +914,7 @@ static int cubemap_ob(Object *ob, float *n, float x, float y, float z, float *ad
|
||||
|
||||
if(n==NULL) return 0;
|
||||
|
||||
VECCOPY(nor, n);
|
||||
copy_v3_v3(nor, n);
|
||||
if(ob) mul_mat3_m4_v3(ob->imat, nor);
|
||||
|
||||
x1= fabs(nor[0]);
|
||||
@@ -1219,7 +1219,7 @@ static int multitex(Tex *tex, float *texvec, float *dxt, float *dyt, int osatex,
|
||||
/* ton: added this, for Blender convention reason.
|
||||
* artificer: added the use of tmpvec to avoid scaling texvec
|
||||
*/
|
||||
VECCOPY(tmpvec, texvec);
|
||||
copy_v3_v3(tmpvec, texvec);
|
||||
mul_v3_fl(tmpvec, 1.0f/tex->noisesize);
|
||||
|
||||
switch(tex->stype) {
|
||||
@@ -1241,7 +1241,7 @@ static int multitex(Tex *tex, float *texvec, float *dxt, float *dyt, int osatex,
|
||||
/* ton: added this, for Blender convention reason.
|
||||
* artificer: added the use of tmpvec to avoid scaling texvec
|
||||
*/
|
||||
VECCOPY(tmpvec, texvec);
|
||||
copy_v3_v3(tmpvec, texvec);
|
||||
mul_v3_fl(tmpvec, 1.0f/tex->noisesize);
|
||||
|
||||
retval= voronoiTex(tex, tmpvec, texres);
|
||||
@@ -1250,7 +1250,7 @@ static int multitex(Tex *tex, float *texvec, float *dxt, float *dyt, int osatex,
|
||||
/* ton: added this, for Blender convention reason.
|
||||
* artificer: added the use of tmpvec to avoid scaling texvec
|
||||
*/
|
||||
VECCOPY(tmpvec, texvec);
|
||||
copy_v3_v3(tmpvec, texvec);
|
||||
mul_v3_fl(tmpvec, 1.0f/tex->noisesize);
|
||||
|
||||
retval= mg_distNoiseTex(tex, tmpvec, texres);
|
||||
@@ -1477,32 +1477,32 @@ void texture_rgb_blend(float *in, float *tex, float *out, float fact, float facg
|
||||
|
||||
case MTEX_BLEND_HUE:
|
||||
fact*= facg;
|
||||
VECCOPY(in, out);
|
||||
copy_v3_v3(in, out);
|
||||
ramp_blend(MA_RAMP_HUE, in, in+1, in+2, fact, tex);
|
||||
break;
|
||||
case MTEX_BLEND_SAT:
|
||||
fact*= facg;
|
||||
VECCOPY(in, out);
|
||||
copy_v3_v3(in, out);
|
||||
ramp_blend(MA_RAMP_SAT, in, in+1, in+2, fact, tex);
|
||||
break;
|
||||
case MTEX_BLEND_VAL:
|
||||
fact*= facg;
|
||||
VECCOPY(in, out);
|
||||
copy_v3_v3(in, out);
|
||||
ramp_blend(MA_RAMP_VAL, in, in+1, in+2, fact, tex);
|
||||
break;
|
||||
case MTEX_BLEND_COLOR:
|
||||
fact*= facg;
|
||||
VECCOPY(in, out);
|
||||
copy_v3_v3(in, out);
|
||||
ramp_blend(MA_RAMP_COLOR, in, in+1, in+2, fact, tex);
|
||||
break;
|
||||
case MTEX_SOFT_LIGHT:
|
||||
fact*= facg;
|
||||
VECCOPY(in, out);
|
||||
copy_v3_v3(in, out);
|
||||
ramp_blend(MA_RAMP_SOFT, in, in+1, in+2, fact, tex);
|
||||
break;
|
||||
case MTEX_LIN_LIGHT:
|
||||
fact*= facg;
|
||||
VECCOPY(in, out);
|
||||
copy_v3_v3(in, out);
|
||||
ramp_blend(MA_RAMP_LINEAR, in, in+1, in+2, fact, tex);
|
||||
break;
|
||||
}
|
||||
@@ -1924,8 +1924,8 @@ static int ntap_bump_compute(NTapBump *ntap_bump, ShadeInput *shi, MTex *mtex, T
|
||||
Hscale *= 0.1f; // factor 0.1 proved to look like the previous bump code
|
||||
|
||||
if( !ntap_bump->init_done ) {
|
||||
VECCOPY(ntap_bump->vNacc, shi->vn);
|
||||
VECCOPY(ntap_bump->vNorg, shi->vn);
|
||||
copy_v3_v3(ntap_bump->vNacc, shi->vn);
|
||||
copy_v3_v3(ntap_bump->vNorg, shi->vn);
|
||||
ntap_bump->fPrevMagnitude = 1.0f;
|
||||
ntap_bump->iPrevBumpSpace = 0;
|
||||
|
||||
@@ -2056,9 +2056,9 @@ static int ntap_bump_compute(NTapBump *ntap_bump, ShadeInput *shi, MTex *mtex, T
|
||||
float obj2view[3][3], view2obj[3][3], tmp[4][4];
|
||||
// local copies of derivatives and normal
|
||||
float dPdx[3], dPdy[3], vN[3];
|
||||
VECCOPY(dPdx, shi->dxco);
|
||||
VECCOPY(dPdy, shi->dyco);
|
||||
VECCOPY(vN, ntap_bump->vNorg);
|
||||
copy_v3_v3(dPdx, shi->dxco);
|
||||
copy_v3_v3(dPdy, shi->dyco);
|
||||
copy_v3_v3(vN, ntap_bump->vNorg);
|
||||
|
||||
if( mtex->texflag & MTEX_BUMP_OBJECTSPACE ) {
|
||||
// TODO: these calculations happen for every pixel!
|
||||
@@ -2200,14 +2200,14 @@ void do_material_tex(ShadeInput *shi)
|
||||
co= tempvec;
|
||||
dx= dxt;
|
||||
dy= dyt;
|
||||
VECCOPY(tempvec, shi->co);
|
||||
copy_v3_v3(tempvec, shi->co);
|
||||
if(mtex->texflag & MTEX_OB_DUPLI_ORIG)
|
||||
if(shi->obi && shi->obi->duplitexmat)
|
||||
mul_m4_v3(shi->obi->duplitexmat, tempvec);
|
||||
mul_m4_v3(ob->imat_ren, tempvec);
|
||||
if(shi->osatex) {
|
||||
VECCOPY(dxt, shi->dxco);
|
||||
VECCOPY(dyt, shi->dyco);
|
||||
copy_v3_v3(dxt, shi->dxco);
|
||||
copy_v3_v3(dyt, shi->dyco);
|
||||
mul_mat3_m4_v3(ob->imat_ren, dxt);
|
||||
mul_mat3_m4_v3(ob->imat_ren, dyt);
|
||||
}
|
||||
@@ -2369,7 +2369,7 @@ void do_material_tex(ShadeInput *shi)
|
||||
float *warpnor= texres.nor, warpnor_[3];
|
||||
|
||||
if(use_ntap_bump) {
|
||||
VECCOPY(warpnor_, texres.nor);
|
||||
copy_v3_v3(warpnor_, texres.nor);
|
||||
warpnor= warpnor_;
|
||||
normalize_v3(warpnor_);
|
||||
}
|
||||
@@ -2485,7 +2485,7 @@ void do_material_tex(ShadeInput *shi)
|
||||
else {
|
||||
float nor[3];
|
||||
|
||||
VECCOPY(nor, texres.nor);
|
||||
copy_v3_v3(nor, texres.nor);
|
||||
|
||||
if(mtex->normapspace == MTEX_NSPACE_CAMERA);
|
||||
else if(mtex->normapspace == MTEX_NSPACE_WORLD) {
|
||||
@@ -2687,7 +2687,7 @@ void do_volume_tex(ShadeInput *shi, float *xyz, int mapto_flag, float *col, floa
|
||||
if(mtex->texco==TEXCO_OBJECT) {
|
||||
Object *ob= mtex->object;
|
||||
if(ob) {
|
||||
VECCOPY(co, xyz);
|
||||
copy_v3_v3(co, xyz);
|
||||
if(mtex->texflag & MTEX_OB_DUPLI_ORIG) {
|
||||
if(shi->obi && shi->obi->duplitexmat)
|
||||
mul_m4_v3(shi->obi->duplitexmat, co);
|
||||
@@ -2699,16 +2699,16 @@ void do_volume_tex(ShadeInput *shi, float *xyz, int mapto_flag, float *col, floa
|
||||
else if(mtex->texco==TEXCO_ORCO) {
|
||||
|
||||
if(mtex->texflag & MTEX_DUPLI_MAPTO) {
|
||||
VECCOPY(co, shi->duplilo);
|
||||
copy_v3_v3(co, shi->duplilo);
|
||||
}
|
||||
else {
|
||||
Object *ob= shi->obi->ob;
|
||||
VECCOPY(co, xyz);
|
||||
copy_v3_v3(co, xyz);
|
||||
mul_m4_v3(ob->imat_ren, co);
|
||||
}
|
||||
}
|
||||
else if(mtex->texco==TEXCO_GLOB) {
|
||||
VECCOPY(co, xyz);
|
||||
copy_v3_v3(co, xyz);
|
||||
mul_m4_v3(R.viewinv, co);
|
||||
}
|
||||
else continue; // can happen when texco defines disappear and it renders old files
|
||||
@@ -3054,7 +3054,7 @@ void do_sky_tex(float *rco, float *lo, float *dxyview, float *hor, float *zen, f
|
||||
break;
|
||||
case TEXCO_OBJECT:
|
||||
if(mtex->object) {
|
||||
VECCOPY(tempvec, lo);
|
||||
copy_v3_v3(tempvec, lo);
|
||||
mul_m4_v3(mtex->object->imat_ren, tempvec);
|
||||
co= tempvec;
|
||||
}
|
||||
@@ -3062,16 +3062,16 @@ void do_sky_tex(float *rco, float *lo, float *dxyview, float *hor, float *zen, f
|
||||
|
||||
case TEXCO_GLOB:
|
||||
if(rco) {
|
||||
VECCOPY(tempvec, rco);
|
||||
copy_v3_v3(tempvec, rco);
|
||||
mul_m4_v3(R.viewinv, tempvec);
|
||||
co= tempvec;
|
||||
}
|
||||
else
|
||||
co= lo;
|
||||
|
||||
// VECCOPY(shi->dxgl, shi->dxco);
|
||||
// copy_v3_v3(shi->dxgl, shi->dxco);
|
||||
// mul_m3_v3(R.imat, shi->dxco);
|
||||
// VECCOPY(shi->dygl, shi->dyco);
|
||||
// copy_v3_v3(shi->dygl, shi->dyco);
|
||||
// mul_m3_v3(R.imat, shi->dyco);
|
||||
break;
|
||||
}
|
||||
@@ -3203,11 +3203,11 @@ void do_lamp_tex(LampRen *la, float *lavec, ShadeInput *shi, float *colf, int ef
|
||||
co= tempvec;
|
||||
dx= dxt;
|
||||
dy= dyt;
|
||||
VECCOPY(tempvec, shi->co);
|
||||
copy_v3_v3(tempvec, shi->co);
|
||||
mul_m4_v3(ob->imat_ren, tempvec);
|
||||
if(shi->osatex) {
|
||||
VECCOPY(dxt, shi->dxco);
|
||||
VECCOPY(dyt, shi->dyco);
|
||||
copy_v3_v3(dxt, shi->dxco);
|
||||
copy_v3_v3(dyt, shi->dyco);
|
||||
mul_mat3_m4_v3(ob->imat_ren, dxt);
|
||||
mul_mat3_m4_v3(ob->imat_ren, dyt);
|
||||
}
|
||||
@@ -3219,12 +3219,12 @@ void do_lamp_tex(LampRen *la, float *lavec, ShadeInput *shi, float *colf, int ef
|
||||
}
|
||||
else if(mtex->texco==TEXCO_GLOB) {
|
||||
co= shi->gl; dx= shi->dxco; dy= shi->dyco;
|
||||
VECCOPY(shi->gl, shi->co);
|
||||
copy_v3_v3(shi->gl, shi->co);
|
||||
mul_m4_v3(R.viewinv, shi->gl);
|
||||
}
|
||||
else if(mtex->texco==TEXCO_VIEW) {
|
||||
|
||||
VECCOPY(tempvec, lavec);
|
||||
copy_v3_v3(tempvec, lavec);
|
||||
mul_m3_v3(la->imat, tempvec);
|
||||
|
||||
if(la->type==LA_SPOT) {
|
||||
@@ -3238,8 +3238,8 @@ void do_lamp_tex(LampRen *la, float *lavec, ShadeInput *shi, float *colf, int ef
|
||||
|
||||
dx= dxt; dy= dyt;
|
||||
if(shi->osatex) {
|
||||
VECCOPY(dxt, shi->dxlv);
|
||||
VECCOPY(dyt, shi->dylv);
|
||||
copy_v3_v3(dxt, shi->dxlv);
|
||||
copy_v3_v3(dyt, shi->dylv);
|
||||
/* need some matrix conversion here? la->imat is a [3][3] matrix!!! **/
|
||||
mul_m3_v3(la->imat, dxt);
|
||||
mul_m3_v3(la->imat, dyt);
|
||||
|
@@ -428,7 +428,7 @@ VlakRen *RE_vlakren_copy(ObjectRen *obr, VlakRen *vlr)
|
||||
surfnor= RE_vlakren_get_surfnor(obr, vlr, 0);
|
||||
if(surfnor) {
|
||||
surfnor1= RE_vlakren_get_surfnor(obr, vlr1, 1);
|
||||
VECCOPY(surfnor1, surfnor);
|
||||
copy_v3_v3(surfnor1, surfnor);
|
||||
}
|
||||
|
||||
tangent= RE_vlakren_get_nmap_tangent(obr, vlr, 0);
|
||||
@@ -451,13 +451,12 @@ void RE_vlakren_get_normal(Render *UNUSED(re), ObjectInstanceRen *obi, VlakRen *
|
||||
float (*nmat)[3]= obi->nmat;
|
||||
|
||||
if(obi->flag & R_TRANSFORMED) {
|
||||
VECCOPY(nor, vlr->n);
|
||||
|
||||
mul_m3_v3(nmat, nor);
|
||||
mul_v3_m3v3(nor, nmat, vlr->n);
|
||||
normalize_v3(nor);
|
||||
}
|
||||
else
|
||||
VECCOPY(nor, vlr->n);
|
||||
else {
|
||||
copy_v3_v3(nor, vlr->n);
|
||||
}
|
||||
}
|
||||
|
||||
void RE_set_customdata_names(ObjectRen *obr, CustomData *data)
|
||||
@@ -953,7 +952,7 @@ HaloRen *RE_inithalo(Render *re, ObjectRen *obr, Material *ma, float *vec, f
|
||||
}
|
||||
|
||||
har= RE_findOrAddHalo(obr, obr->tothalo++);
|
||||
VECCOPY(har->co, vec);
|
||||
copy_v3_v3(har->co, vec);
|
||||
har->hasize= hasize;
|
||||
|
||||
/* actual projectvert is done in function project_renderdata() because of parts/border/pano */
|
||||
@@ -1009,7 +1008,7 @@ HaloRen *RE_inithalo(Render *re, ObjectRen *obr, Material *ma, float *vec, f
|
||||
else {
|
||||
|
||||
mtex= ma->mtex[0];
|
||||
VECCOPY(texvec, vec);
|
||||
copy_v3_v3(texvec, vec);
|
||||
|
||||
if(mtex->texco & TEXCO_NORM) {
|
||||
;
|
||||
@@ -1022,7 +1021,7 @@ HaloRen *RE_inithalo(Render *re, ObjectRen *obr, Material *ma, float *vec, f
|
||||
}
|
||||
else {
|
||||
if(orco) {
|
||||
VECCOPY(texvec, orco);
|
||||
copy_v3_v3(texvec, orco);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1067,7 +1066,7 @@ HaloRen *RE_inithalo_particle(Render *re, ObjectRen *obr, DerivedMesh *dm, Mater
|
||||
}
|
||||
|
||||
har= RE_findOrAddHalo(obr, obr->tothalo++);
|
||||
VECCOPY(har->co, vec);
|
||||
copy_v3_v3(har->co, vec);
|
||||
har->hasize= hasize;
|
||||
|
||||
/* actual projectvert is done in function project_renderdata() because of parts/border/pano */
|
||||
@@ -1123,7 +1122,7 @@ HaloRen *RE_inithalo_particle(Render *re, ObjectRen *obr, DerivedMesh *dm, Mater
|
||||
for(i=0; i<MAX_MTEX; i++)
|
||||
if(ma->mtex[i] && (ma->septex & (1<<i))==0) {
|
||||
mtex= ma->mtex[i];
|
||||
VECCOPY(texvec, vec);
|
||||
copy_v3_v3(texvec, vec);
|
||||
|
||||
if(mtex->texco & TEXCO_NORM) {
|
||||
;
|
||||
@@ -1133,7 +1132,7 @@ HaloRen *RE_inithalo_particle(Render *re, ObjectRen *obr, DerivedMesh *dm, Mater
|
||||
mul_m4_v3(mtex->object->imat_ren,texvec);
|
||||
}
|
||||
else if(mtex->texco & TEXCO_GLOB){
|
||||
VECCOPY(texvec,vec);
|
||||
copy_v3_v3(texvec,vec);
|
||||
}
|
||||
else if(mtex->texco & TEXCO_UV && uvco){
|
||||
int uv_index=CustomData_get_named_layer_index(&dm->faceData,CD_MTFACE,mtex->uvname);
|
||||
@@ -1153,7 +1152,7 @@ HaloRen *RE_inithalo_particle(Render *re, ObjectRen *obr, DerivedMesh *dm, Mater
|
||||
texvec[2] = pa_co[2];
|
||||
}
|
||||
else if(orco) {
|
||||
VECCOPY(texvec, orco);
|
||||
copy_v3_v3(texvec, orco);
|
||||
}
|
||||
|
||||
hasrgb = externtex(mtex, texvec, &tin, &tr, &tg, &tb, &ta, 0);
|
||||
@@ -1264,7 +1263,7 @@ void project_renderdata(Render *re, void (*projectfunc)(const float *, float mat
|
||||
vec[2]= -re->panosi*har->co[0] + re->panoco*har->co[2];
|
||||
}
|
||||
else {
|
||||
VECCOPY(vec, har->co);
|
||||
copy_v3_v3(vec, har->co);
|
||||
}
|
||||
|
||||
projectfunc(vec, re->winmat, hoco);
|
||||
|
@@ -114,10 +114,8 @@ void shade_material_loop(ShadeInput *shi, ShadeResult *shr)
|
||||
float fac= shi->translucency;
|
||||
|
||||
shade_input_init_material(shi);
|
||||
|
||||
VECCOPY(shi->vn, shi->vno);
|
||||
VECMUL(shi->vn, -1.0f);
|
||||
VECMUL(shi->facenor, -1.0f);
|
||||
negate_v3_v3(shi->vn, shi->vno);
|
||||
negate_v3(shi->facenor);
|
||||
shi->depth++; /* hack to get real shadow now */
|
||||
shade_lamp_loop(shi, &shr_t);
|
||||
shi->depth--;
|
||||
@@ -184,8 +182,8 @@ void shade_input_do_shade(ShadeInput *shi, ShadeResult *shr)
|
||||
|
||||
/* copy additional passes */
|
||||
if(shi->passflag & (SCE_PASS_VECTOR|SCE_PASS_NORMAL)) {
|
||||
QUATCOPY(shr->winspeed, shi->winspeed);
|
||||
VECCOPY(shr->nor, shi->vn);
|
||||
copy_v4_v4(shr->winspeed, shi->winspeed);
|
||||
copy_v3_v3(shr->nor, shi->vn);
|
||||
}
|
||||
|
||||
/* MIST */
|
||||
@@ -286,9 +284,9 @@ void shade_input_set_triangle_i(ShadeInput *shi, ObjectInstanceRen *obi, VlakRen
|
||||
|
||||
/* calculate vertexnormals */
|
||||
if(vlr->flag & R_SMOOTH) {
|
||||
VECCOPY(shi->n1, shi->v1->n);
|
||||
VECCOPY(shi->n2, shi->v2->n);
|
||||
VECCOPY(shi->n3, shi->v3->n);
|
||||
copy_v3_v3(shi->n1, shi->v1->n);
|
||||
copy_v3_v3(shi->n2, shi->v2->n);
|
||||
copy_v3_v3(shi->n3, shi->v3->n);
|
||||
|
||||
if(obi->flag & R_TRANSFORMED) {
|
||||
mul_m3_v3(obi->nmat, shi->n1); normalize_v3(shi->n1);
|
||||
@@ -341,26 +339,26 @@ void shade_input_set_strand(ShadeInput *shi, StrandRen *strand, StrandPoint *spo
|
||||
shi->mode= shi->mat->mode_l; /* or-ed result for all nodes */
|
||||
|
||||
/* shade_input_set_viewco equivalent */
|
||||
VECCOPY(shi->co, spoint->co);
|
||||
VECCOPY(shi->view, shi->co);
|
||||
copy_v3_v3(shi->co, spoint->co);
|
||||
copy_v3_v3(shi->view, shi->co);
|
||||
normalize_v3(shi->view);
|
||||
|
||||
shi->xs= (int)spoint->x;
|
||||
shi->ys= (int)spoint->y;
|
||||
|
||||
if(shi->osatex || (R.r.mode & R_SHADOW)) {
|
||||
VECCOPY(shi->dxco, spoint->dtco);
|
||||
VECCOPY(shi->dyco, spoint->dsco);
|
||||
copy_v3_v3(shi->dxco, spoint->dtco);
|
||||
copy_v3_v3(shi->dyco, spoint->dsco);
|
||||
}
|
||||
|
||||
/* dxview, dyview, not supported */
|
||||
|
||||
/* facenormal, simply viewco flipped */
|
||||
VECCOPY(shi->facenor, spoint->nor);
|
||||
copy_v3_v3(shi->facenor, spoint->nor);
|
||||
|
||||
/* shade_input_set_normals equivalent */
|
||||
if(shi->mat->mode & MA_TANGENT_STR) {
|
||||
VECCOPY(shi->vn, spoint->tan)
|
||||
copy_v3_v3(shi->vn, spoint->tan);
|
||||
}
|
||||
else {
|
||||
float cross[3];
|
||||
@@ -373,7 +371,7 @@ void shade_input_set_strand(ShadeInput *shi, StrandRen *strand, StrandPoint *spo
|
||||
negate_v3(shi->vn);
|
||||
}
|
||||
|
||||
VECCOPY(shi->vno, shi->vn);
|
||||
copy_v3_v3(shi->vno, shi->vn);
|
||||
}
|
||||
|
||||
void shade_input_set_strand_texco(ShadeInput *shi, StrandRen *strand, StrandVert *svert, StrandPoint *spoint)
|
||||
@@ -393,17 +391,17 @@ void shade_input_set_strand_texco(ShadeInput *shi, StrandRen *strand, StrandVert
|
||||
}
|
||||
|
||||
if(mode & (MA_TANGENT_V|MA_NORMAP_TANG)) {
|
||||
VECCOPY(shi->tang, spoint->tan);
|
||||
VECCOPY(shi->nmaptang, spoint->tan);
|
||||
copy_v3_v3(shi->tang, spoint->tan);
|
||||
copy_v3_v3(shi->nmaptang, spoint->tan);
|
||||
}
|
||||
|
||||
if(mode & MA_STR_SURFDIFF) {
|
||||
float *surfnor= RE_strandren_get_surfnor(obr, strand, 0);
|
||||
|
||||
if(surfnor)
|
||||
VECCOPY(shi->surfnor, surfnor)
|
||||
copy_v3_v3(shi->surfnor, surfnor);
|
||||
else
|
||||
VECCOPY(shi->surfnor, shi->vn)
|
||||
copy_v3_v3(shi->surfnor, shi->vn);
|
||||
|
||||
if(shi->mat->strand_surfnor > 0.0f) {
|
||||
shi->surfdist= 0.0f;
|
||||
@@ -418,7 +416,7 @@ void shade_input_set_strand_texco(ShadeInput *shi, StrandRen *strand, StrandVert
|
||||
|
||||
speed= RE_strandren_get_winspeed(shi->obi, strand, 0);
|
||||
if(speed)
|
||||
QUATCOPY(shi->winspeed, speed)
|
||||
copy_v4_v4(shi->winspeed, speed);
|
||||
else
|
||||
shi->winspeed[0]= shi->winspeed[1]= shi->winspeed[2]= shi->winspeed[3]= 0.0f;
|
||||
}
|
||||
@@ -426,18 +424,18 @@ void shade_input_set_strand_texco(ShadeInput *shi, StrandRen *strand, StrandVert
|
||||
/* shade_input_set_shade_texco equivalent */
|
||||
if(texco & NEED_UV) {
|
||||
if(texco & TEXCO_ORCO) {
|
||||
VECCOPY(shi->lo, strand->orco);
|
||||
copy_v3_v3(shi->lo, strand->orco);
|
||||
/* no shi->osatex, orco derivatives are zero */
|
||||
}
|
||||
|
||||
if(texco & TEXCO_GLOB) {
|
||||
VECCOPY(shi->gl, shi->co);
|
||||
copy_v3_v3(shi->gl, shi->co);
|
||||
mul_m4_v3(R.viewinv, shi->gl);
|
||||
|
||||
if(shi->osatex) {
|
||||
VECCOPY(shi->dxgl, shi->dxco);
|
||||
copy_v3_v3(shi->dxgl, shi->dxco);
|
||||
mul_mat3_m4_v3(R.viewinv, shi->dxgl);
|
||||
VECCOPY(shi->dygl, shi->dyco);
|
||||
copy_v3_v3(shi->dygl, shi->dyco);
|
||||
mul_mat3_m4_v3(R.viewinv, shi->dygl);
|
||||
}
|
||||
}
|
||||
@@ -603,7 +601,7 @@ void shade_input_calc_viewco(ShadeInput *shi, float x, float y, float z, float v
|
||||
/* for non-wire, intersect with the triangle to get the exact coord */
|
||||
float fac, dface, v1[3];
|
||||
|
||||
VECCOPY(v1, shi->v1->co);
|
||||
copy_v3_v3(v1, shi->v1->co);
|
||||
if(shi->obi->flag & R_TRANSFORMED)
|
||||
mul_m4_v3(shi->obi->mat, v1);
|
||||
|
||||
@@ -721,9 +719,9 @@ void shade_input_set_uv(ShadeInput *shi)
|
||||
if((vlr->flag & R_SMOOTH) || (shi->mat->texco & NEED_UV) || (shi->passflag & SCE_PASS_UV)) {
|
||||
float v1[3], v2[3], v3[3];
|
||||
|
||||
VECCOPY(v1, shi->v1->co);
|
||||
VECCOPY(v2, shi->v2->co);
|
||||
VECCOPY(v3, shi->v3->co);
|
||||
copy_v3_v3(v1, shi->v1->co);
|
||||
copy_v3_v3(v2, shi->v2->co);
|
||||
copy_v3_v3(v3, shi->v3->co);
|
||||
|
||||
if(shi->obi->flag & R_TRANSFORMED) {
|
||||
mul_m4_v3(shi->obi->mat, v1);
|
||||
@@ -822,18 +820,18 @@ void shade_input_set_normals(ShadeInput *shi)
|
||||
shi->vn[2]= l*n3[2]-u*n1[2]-v*n2[2];
|
||||
|
||||
// use unnormalized normal (closer to games)
|
||||
VECCOPY(shi->nmapnorm, shi->vn);
|
||||
copy_v3_v3(shi->nmapnorm, shi->vn);
|
||||
|
||||
normalize_v3(shi->vn);
|
||||
}
|
||||
else
|
||||
{
|
||||
VECCOPY(shi->vn, shi->facenor);
|
||||
VECCOPY(shi->nmapnorm, shi->vn);
|
||||
copy_v3_v3(shi->vn, shi->facenor);
|
||||
copy_v3_v3(shi->nmapnorm, shi->vn);
|
||||
}
|
||||
|
||||
/* used in nodes */
|
||||
VECCOPY(shi->vno, shi->vn);
|
||||
copy_v3_v3(shi->vno, shi->vn);
|
||||
|
||||
/* flip normals to viewing direction */
|
||||
if(!(shi->vlr->flag & R_TANGENT))
|
||||
@@ -856,18 +854,18 @@ void shade_input_set_vertex_normals(ShadeInput *shi)
|
||||
shi->vn[2]= l*n3[2]-u*n1[2]-v*n2[2];
|
||||
|
||||
// use unnormalized normal (closer to games)
|
||||
VECCOPY(shi->nmapnorm, shi->vn);
|
||||
copy_v3_v3(shi->nmapnorm, shi->vn);
|
||||
|
||||
normalize_v3(shi->vn);
|
||||
}
|
||||
else
|
||||
{
|
||||
VECCOPY(shi->vn, shi->facenor);
|
||||
VECCOPY(shi->nmapnorm, shi->vn);
|
||||
copy_v3_v3(shi->vn, shi->facenor);
|
||||
copy_v3_v3(shi->nmapnorm, shi->vn);
|
||||
}
|
||||
|
||||
/* used in nodes */
|
||||
VECCOPY(shi->vno, shi->vn);
|
||||
copy_v3_v3(shi->vno, shi->vn);
|
||||
}
|
||||
|
||||
|
||||
@@ -956,7 +954,7 @@ void shade_input_set_shade_texco(ShadeInput *shi)
|
||||
mul_m3_v3(obi->nmat, shi->tang);
|
||||
|
||||
normalize_v3(shi->tang);
|
||||
VECCOPY(shi->nmaptang, shi->tang);
|
||||
copy_v3_v3(shi->nmaptang, shi->tang);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -969,9 +967,9 @@ void shade_input_set_shade_texco(ShadeInput *shi)
|
||||
|
||||
vlr_set_uv_indices(shi->vlr, &j1, &j2, &j3);
|
||||
|
||||
VECCOPY(c0, &tangent[j1*4]);
|
||||
VECCOPY(c1, &tangent[j2*4]);
|
||||
VECCOPY(c2, &tangent[j3*4]);
|
||||
copy_v3_v3(c0, &tangent[j1*4]);
|
||||
copy_v3_v3(c1, &tangent[j2*4]);
|
||||
copy_v3_v3(c2, &tangent[j3*4]);
|
||||
|
||||
// keeping tangents normalized at vertex level
|
||||
// corresponds better to how it's done in game engines
|
||||
@@ -999,12 +997,12 @@ void shade_input_set_shade_texco(ShadeInput *shi)
|
||||
float *surfnor= RE_vlakren_get_surfnor(obr, shi->vlr, 0);
|
||||
|
||||
if(surfnor) {
|
||||
VECCOPY(shi->surfnor, surfnor)
|
||||
copy_v3_v3(shi->surfnor, surfnor);
|
||||
if(obi->flag & R_TRANSFORMED)
|
||||
mul_m3_v3(obi->nmat, shi->surfnor);
|
||||
}
|
||||
else
|
||||
VECCOPY(shi->surfnor, shi->vn)
|
||||
copy_v3_v3(shi->surfnor, shi->vn);
|
||||
|
||||
shi->surfdist= 0.0f;
|
||||
}
|
||||
@@ -1057,16 +1055,16 @@ void shade_input_set_shade_texco(ShadeInput *shi)
|
||||
}
|
||||
}
|
||||
|
||||
VECCOPY(shi->duplilo, obi->dupliorco);
|
||||
copy_v3_v3(shi->duplilo, obi->dupliorco);
|
||||
}
|
||||
|
||||
if(texco & TEXCO_GLOB) {
|
||||
VECCOPY(shi->gl, shi->co);
|
||||
copy_v3_v3(shi->gl, shi->co);
|
||||
mul_m4_v3(R.viewinv, shi->gl);
|
||||
if(shi->osatex) {
|
||||
VECCOPY(shi->dxgl, shi->dxco);
|
||||
copy_v3_v3(shi->dxgl, shi->dxco);
|
||||
mul_mat3_m4_v3(R.viewinv, shi->dxgl);
|
||||
VECCOPY(shi->dygl, shi->dyco);
|
||||
copy_v3_v3(shi->dygl, shi->dyco);
|
||||
mul_mat3_m4_v3(R.viewinv, shi->dygl);
|
||||
}
|
||||
}
|
||||
|
@@ -85,7 +85,7 @@ static void fogcolor(float *colf, float *rco, float *view)
|
||||
hor[0]= R.wrld.horr; hor[1]= R.wrld.horg; hor[2]= R.wrld.horb;
|
||||
zen[0]= R.wrld.zenr; zen[1]= R.wrld.zeng; zen[2]= R.wrld.zenb;
|
||||
|
||||
VECCOPY(vec, rco);
|
||||
copy_v3_v3(vec, rco);
|
||||
|
||||
/* we loop from cur coord to mist start in steps */
|
||||
stepsize= 1.0f;
|
||||
@@ -1119,7 +1119,7 @@ float lamp_get_visibility(LampRen *lar, float *co, float *lv, float *dist)
|
||||
{
|
||||
if(lar->type==LA_SUN || lar->type==LA_HEMI) {
|
||||
*dist= 1.0f;
|
||||
VECCOPY(lv, lar->vec);
|
||||
copy_v3_v3(lv, lar->vec);
|
||||
return 1.0f;
|
||||
}
|
||||
else {
|
||||
@@ -1183,7 +1183,7 @@ float lamp_get_visibility(LampRen *lar, float *co, float *lv, float *dist)
|
||||
float lvrot[3], x;
|
||||
|
||||
/* rotate view to lampspace */
|
||||
VECCOPY(lvrot, lv);
|
||||
copy_v3_v3(lvrot, lv);
|
||||
mul_m3_v3(lar->imat, lvrot);
|
||||
|
||||
x= MAX2(fabs(lvrot[0]/lvrot[2]) , fabs(lvrot[1]/lvrot[2]));
|
||||
@@ -1425,7 +1425,7 @@ static void shade_one_light(LampRen *lar, ShadeInput *shi, ShadeResult *shr, int
|
||||
add_to_diffuse(shr->diff, shi, is, i_noshad*lacol[0], i_noshad*lacol[1], i_noshad*lacol[2]);
|
||||
}
|
||||
else
|
||||
VECCOPY(shr->diff, shr->shad);
|
||||
copy_v3_v3(shr->diff, shr->shad);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1712,9 +1712,9 @@ void shade_lamp_loop(ShadeInput *shi, ShadeResult *shr)
|
||||
/* AO was calculated for scanline already */
|
||||
if(shi->depth || shi->volume_depth)
|
||||
ambient_occlusion(shi);
|
||||
VECCOPY(shr->ao, shi->ao);
|
||||
VECCOPY(shr->env, shi->env); // XXX multiply
|
||||
VECCOPY(shr->indirect, shi->indirect); // XXX multiply
|
||||
copy_v3_v3(shr->ao, shi->ao);
|
||||
copy_v3_v3(shr->env, shi->env); // XXX multiply
|
||||
copy_v3_v3(shr->indirect, shi->indirect); // XXX multiply
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1759,7 +1759,7 @@ void shade_lamp_loop(ShadeInput *shi, ShadeResult *shr)
|
||||
invalpha= (shr->col[3] > FLT_EPSILON)? 1.0f/shr->col[3]: 1.0f;
|
||||
|
||||
if(texfac==0.0f) {
|
||||
VECCOPY(col, shr->col);
|
||||
copy_v3_v3(col, shr->col);
|
||||
mul_v3_fl(col, invalpha);
|
||||
}
|
||||
else if(texfac==1.0f) {
|
||||
@@ -1767,7 +1767,7 @@ void shade_lamp_loop(ShadeInput *shi, ShadeResult *shr)
|
||||
mul_v3_fl(col, invalpha);
|
||||
}
|
||||
else {
|
||||
VECCOPY(col, shr->col);
|
||||
copy_v3_v3(col, shr->col);
|
||||
mul_v3_fl(col, invalpha);
|
||||
col[0]= pow(col[0], 1.0f-texfac);
|
||||
col[1]= pow(col[1], 1.0f-texfac);
|
||||
@@ -1787,9 +1787,9 @@ void shade_lamp_loop(ShadeInput *shi, ShadeResult *shr)
|
||||
}
|
||||
|
||||
if(shi->combinedflag & SCE_PASS_SHADOW)
|
||||
VECCOPY(shr->combined, shr->shad) /* note, no ';' ! */
|
||||
copy_v3_v3(shr->combined, shr->shad); /* note, no ';' ! */
|
||||
else
|
||||
VECCOPY(shr->combined, shr->diff);
|
||||
copy_v3_v3(shr->combined, shr->diff);
|
||||
|
||||
/* calculate shadow pass, we use a multiplication mask */
|
||||
/* if diff = 0,0,0 it doesn't matter what the shadow pass is, so leave it as is */
|
||||
@@ -1867,7 +1867,7 @@ void shade_lamp_loop(ShadeInput *shi, ShadeResult *shr)
|
||||
sub_v3_v3v3(shr->refl, result, shr->combined);
|
||||
|
||||
if(shi->combinedflag & SCE_PASS_REFLECT)
|
||||
VECCOPY(shr->combined, result);
|
||||
copy_v3_v3(shr->combined, result);
|
||||
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user