Forgot these two :)

Please test :)
This commit is contained in:
Alexander Ewering 2004-07-18 15:58:23 +00:00
parent 96e0a103d4
commit e9f86f281e
3 changed files with 1566 additions and 1581 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 42 KiB

File diff suppressed because it is too large Load Diff

@ -4471,6 +4471,7 @@ void transform(int mode)
TransVert *tv;
float vec[3], min[3], max[3], dvec[3], d_dvec[3], dvecp[3], rot0[3], rot1[3], rot2[3], axis[3];
float totmat[3][3], omat[3][3], imat[3][3], mat[3][3], tmat[3][3], phi, dphi;
float oldcurs[3];
float persinv[3][3], persmat[3][3], viewinv[4][4], imat4[4][4];
float *curs, dx1, dx2, dy1, dy2, eul[3], quat[4], rot[3], phi0, phi1, deler, rad = 0.0;
@ -4564,22 +4565,27 @@ void transform(int mode)
}
if(tottrans==0) {
if(G.obedit==0) clearbaseflags_for_editing();
return;
/* if(G.obedit==0) clearbaseflags_for_editing();*/
mode='0';
curs = give_cursor();
VECCOPY(oldcurs, curs);
/* return;*/
}
if(G.obedit==0 && mode=='S') return;
if (mode!='0') {
if(G.vd->around==V3D_LOCAL) {
if(G.obedit) {
centre[0]= centre[1]= centre[2]= 0.0;
}
}
if(G.vd->around==V3D_CENTROID || G.vd->around==V3D_CENTROID_LOC) {
if(G.vd->around==V3D_CENTROID) {
VECCOPY(centre, centroid);
}
else if(G.vd->around==V3D_CURSOR || G.vd->around==V3D_CURSOR_LOC) {
else if(G.vd->around==V3D_CURSOR) {
curs= give_cursor();
VECCOPY(centre, curs);
@ -4600,6 +4606,7 @@ void transform(int mode)
/* moving: is shown in drawobject() */
if(G.obedit) G.moving= 2;
else G.moving= 1;
}
areawinset(curarea->win);
@ -4730,7 +4737,7 @@ void transform(int mode)
}
firsttime= 0;
if(mode=='g' || mode=='G') {
if(mode=='g' || mode=='G' || mode=='0') {
char gmode[10] = "";
keyflags |= KEYFLAG_LOC;
@ -4806,6 +4813,7 @@ void transform(int mode)
/* apply */
tob= transmain;
tv= transvmain;
if (mode!='0') {
for(a=0; a<tottrans; a++, tob++, tv++) {
if(transmain) {
@ -4839,6 +4847,11 @@ void transform(int mode)
else VecAddf(tv->loc, tv->oldloc, dvecp);
}
}
}
else {
VecAddf(curs, oldcurs, dvec);
allqueue(REDRAWVIEW3D, 1);
}
if (typemode){
switch (ax){
@ -4956,7 +4969,8 @@ void transform(int mode)
}
}
if(doit) {
if(doit && (mode!='0')) {
/* apply */
tob= transmain;
tv= transvmain;
@ -4969,7 +4983,7 @@ void transform(int mode)
* 3. multiply with its own rotation, calculate euler.
*/
if (/*(G.vd->flag & V3D_ALIGN)==0*/ G.vd->around != V3D_CURSOR_LOC && G.vd->around != V3D_CENTROID_LOC){
if ((G.vd->flag & V3D_ALIGN)==0) {
/* Roll around local axis */
if (mode=='r' || mode=='R'){
@ -5194,7 +5208,7 @@ void transform(int mode)
scrarea_do_windraw(curarea);
screen_swapbuffers();
}
if(tottrans>1 || G.vd->around==V3D_CURSOR || G.vd->around==V3D_CURSOR_LOC) helpline(centre);
if(tottrans>1 || G.vd->around==V3D_CURSOR) helpline(centre);
else if (G.obpose) helpline (centre);
}
}
@ -5268,7 +5282,7 @@ void transform(int mode)
/* size local with respect to parent AND own rotation */
/* local wrt parent: */
if ( /*(G.vd->flag & V3D_ALIGN)==0 */ G.vd->around != V3D_CURSOR_LOC && G.vd->around != V3D_CENTROID_LOC) {
if ((G.vd->flag & V3D_ALIGN)==0) {
Mat3MulSerie(smat, tob->parmat, mat, tob->parinv, 0, 0,0 ,0, 0);
@ -5318,12 +5332,12 @@ void transform(int mode)
tob->size[1]= (tob->oldsize[1]+tob->olddsize[1])*sizelo[1] -tob->olddsize[1];
tob->size[2]= (tob->oldsize[2]+tob->olddsize[2])*sizelo[2] -tob->olddsize[2];
}
}
else{ //to make the scaling header update correctly if ob centers only is on
} else {
sizelo[0]= size[0];
sizelo[1]= size[1];
sizelo[2]= size[2];
}
if(G.vd->around!=V3D_LOCAL && !G.obpose) {
/* translation */
VecSubf(vec, tob->obvec, centre);
@ -5446,7 +5460,7 @@ void transform(int mode)
scrarea_do_windraw(curarea);
screen_swapbuffers();
}
if(tottrans>1 || G.vd->around==V3D_CURSOR || G.vd->around==V3D_CURSOR_LOC) helpline(centre);
if(tottrans>1 || G.vd->around==V3D_CURSOR) helpline(centre);
}
}
else if(mode=='w') {
@ -5629,6 +5643,7 @@ void transform(int mode)
}
firsttime= 1;
break;
case CKEY:
case GKEY:
case RKEY:
case SKEY:
@ -5653,7 +5668,13 @@ void transform(int mode)
else if(event==RKEY) mode= 'R';
else if(event==SKEY) mode= 'C';
} else {
if(event==GKEY) mode= 'g';
if (event==CKEY) {
mode='0';
G.moving = 0;
curs = give_cursor();
VECCOPY(oldcurs, curs);
}
else if(event==GKEY) mode= 'g';
else if(event==RKEY) mode= 'r';
else if(event==SKEY) mode= 's';
}
@ -6052,6 +6073,7 @@ void transform(int mode)
}
if(G.obedit) calc_trans_verts();
special_trans_update(keyflags);
if (mode == '0') VECCOPY(curs, oldcurs);
}
a= 0;
@ -7341,10 +7363,10 @@ void mirror_edit(short mode) {
tv = transvmain;
// Taking care of all the centre modes
if(G.vd->around==V3D_CENTROID || G.vd->around==V3D_CENTROID_LOC) {
if(G.vd->around==V3D_CENTROID) {
VecCopyf(centre, centroid);
}
else if(G.vd->around==V3D_CURSOR || G.vd->around==V3D_CURSOR_LOC) {
else if(G.vd->around==V3D_CURSOR) {
float *curs;
curs= give_cursor();
VECCOPY(centre, curs);
@ -7468,10 +7490,10 @@ void mirror_object(short mode) {
tob = transmain;
// Taking care of all the centre modes
if(G.vd->around==V3D_CENTROID || G.vd->around==V3D_CENTROID_LOC) {
if(G.vd->around==V3D_CENTROID) {
VecCopyf(centre, centroid);
}
else if(G.vd->around==V3D_CURSOR || G.vd->around==V3D_CURSOR_LOC) {
else if(G.vd->around==V3D_CURSOR) {
float *curs;
curs= give_cursor();
VECCOPY(centre, curs);