* Brought over a 'mode' parameter to drawcircball to prevent
further loss of Hos' hair during tuhopuu merges. This doesn't change any user functionality. 'Mode' can be GL_LINE_LOOP for a circle outline (as it currently is), GL_POLYGON for a filled circle, or whatever gl mode you like.
This commit is contained in:
@@ -55,7 +55,7 @@ void calc_lattverts_ext(void);
|
||||
void calc_meshverts_ext(void);
|
||||
void calc_meshverts_ext_f2(void);
|
||||
void calc_nurbverts_ext(void);
|
||||
void drawcircball(float *cent, float rad, float tmat[][4]);
|
||||
void drawcircball(int mode, float *cent, float rad, float tmat[][4]);
|
||||
void get_local_bounds(struct Object *ob, float *centre, float *size);
|
||||
void draw_object(struct Base *base);
|
||||
void draw_object_ext(struct Base *base);
|
||||
|
||||
@@ -616,7 +616,7 @@ static void drawlamp(Object *ob)
|
||||
mygetmatrix(tmat);
|
||||
Mat4Invert(imat, tmat);
|
||||
|
||||
drawcircball(vec, la->dist, imat);
|
||||
drawcircball(GL_LINE_LOOP, vec, la->dist, imat);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -2864,7 +2864,7 @@ static void drawspiral(float *cent, float rad, float tmat[][4], int start)
|
||||
}
|
||||
}
|
||||
|
||||
void drawcircball(float *cent, float rad, float tmat[][4])
|
||||
void drawcircball(int mode, float *cent, float rad, float tmat[][4])
|
||||
{
|
||||
float vec[3], vx[3], vy[3];
|
||||
int a, tot=32;
|
||||
@@ -2941,7 +2941,7 @@ void drawcircball(float *cent, float rad, float tmat[][4])
|
||||
VecMulf(vx, rad);
|
||||
VecMulf(vy, rad);
|
||||
|
||||
glBegin(GL_LINE_LOOP);
|
||||
glBegin(mode);
|
||||
for(a=0; a<tot; a++) {
|
||||
vec[0]= cent[0] + *(si+a) * vx[0] + *(co+a) * vy[0];
|
||||
vec[1]= cent[1] + *(si+a) * vx[1] + *(co+a) * vy[1];
|
||||
@@ -2994,7 +2994,7 @@ static void drawmball(Object *ob, int dt)
|
||||
glLoadName(code++);
|
||||
}
|
||||
}
|
||||
drawcircball(&(ml->x), ml->rad, imat);
|
||||
drawcircball(GL_LINE_LOOP, &(ml->x), ml->rad, imat);
|
||||
|
||||
/* draw stiffness */
|
||||
if(ob==G.obedit) {
|
||||
@@ -3006,7 +3006,7 @@ static void drawmball(Object *ob, int dt)
|
||||
glLoadName(code++);
|
||||
}
|
||||
}
|
||||
drawcircball(&(ml->x), ml->rad*atan(ml->s)/M_PI_2, imat);
|
||||
drawcircball(GL_LINE_LOOP, &(ml->x), ml->rad*atan(ml->s)/M_PI_2, imat);
|
||||
|
||||
ml= ml->next;
|
||||
}
|
||||
@@ -3027,7 +3027,7 @@ static void draw_forcefield(Object *ob)
|
||||
if(pd->flag & PFIELD_USEMAX) {
|
||||
setlinestyle(3);
|
||||
BIF_ThemeColorBlend(TH_WIRE, TH_BACK, 0.5);
|
||||
drawcircball(vec, pd->maxdist, imat);
|
||||
drawcircball(GL_LINE_LOOP, vec, pd->maxdist, imat);
|
||||
setlinestyle(0);
|
||||
}
|
||||
if (pd->forcefield == PFIELD_WIND) {
|
||||
@@ -3041,13 +3041,13 @@ static void draw_forcefield(Object *ob)
|
||||
else
|
||||
force_val = pd->f_strength;
|
||||
force_val*= 0.1;
|
||||
drawcircball(vec, 1.0, tmat);
|
||||
drawcircball(GL_LINE_LOOP, vec, 1.0, tmat);
|
||||
vec[2]= 0.5*force_val;
|
||||
drawcircball(vec, 1.0, tmat);
|
||||
drawcircball(GL_LINE_LOOP, vec, 1.0, tmat);
|
||||
vec[2]= 1.0*force_val;
|
||||
drawcircball(vec, 1.0, tmat);
|
||||
drawcircball(GL_LINE_LOOP, vec, 1.0, tmat);
|
||||
vec[2]= 1.5*force_val;
|
||||
drawcircball(vec, 1.0, tmat);
|
||||
drawcircball(GL_LINE_LOOP, vec, 1.0, tmat);
|
||||
|
||||
}
|
||||
else if (pd->forcefield == PFIELD_FORCE) {
|
||||
@@ -3059,11 +3059,11 @@ static void draw_forcefield(Object *ob)
|
||||
ffall_val = pd->f_power;
|
||||
|
||||
BIF_ThemeColorBlend(TH_WIRE, TH_BACK, 0.5);
|
||||
drawcircball(vec, 1.0, imat);
|
||||
drawcircball(GL_LINE_LOOP, vec, 1.0, imat);
|
||||
BIF_ThemeColorBlend(TH_WIRE, TH_BACK, 0.9 - 0.4 / pow(1.5, (double)ffall_val));
|
||||
drawcircball(vec, 1.5, imat);
|
||||
drawcircball(GL_LINE_LOOP, vec, 1.5, imat);
|
||||
BIF_ThemeColorBlend(TH_WIRE, TH_BACK, 0.9 - 0.4 / pow(2.0, (double)ffall_val));
|
||||
drawcircball(vec, 2.0, imat);
|
||||
drawcircball(GL_LINE_LOOP, vec, 2.0, imat);
|
||||
}
|
||||
else if (pd->forcefield == PFIELD_VORTEX) {
|
||||
float ffall_val, force_val;
|
||||
@@ -3631,7 +3631,7 @@ void draw_object(Base *base)
|
||||
Mat4Invert(imat, tmat);
|
||||
|
||||
setlinestyle(2);
|
||||
drawcircball(vec, ob->inertia, imat);
|
||||
drawcircball(GL_LINE_LOOP, vec, ob->inertia, imat);
|
||||
setlinestyle(0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4180,7 +4180,7 @@ void draw_prop_circle()
|
||||
mygetmatrix(tmat);
|
||||
Mat4Invert(imat, tmat);
|
||||
|
||||
drawcircball(prop_cent, prop_size, imat);
|
||||
drawcircball(GL_LINE_LOOP, prop_cent, prop_size, imat);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -696,7 +696,7 @@ void BIF_drawPropCircle()
|
||||
mygetmatrix(tmat);
|
||||
Mat4Invert(imat, tmat);
|
||||
|
||||
drawcircball(t->center, t->propsize, imat);
|
||||
drawcircball(GL_LINE_LOOP, t->center, t->propsize, imat);
|
||||
|
||||
/* if editmode we restore */
|
||||
if(G.obedit) myloadmatrix(G.vd->viewmat);
|
||||
|
||||
@@ -776,14 +776,14 @@ static void draw_manipulator_rotate(float mat[][4], int moving, int drawflags, i
|
||||
if(arcs) {
|
||||
if((G.f & G_PICKSEL)==0) {
|
||||
BIF_ThemeColorShade(TH_BACK, -30);
|
||||
drawcircball(unitmat[3], size, unitmat);
|
||||
drawcircball(GL_LINE_LOOP, unitmat[3], size, unitmat);
|
||||
}
|
||||
}
|
||||
/* Screen aligned view rot circle */
|
||||
if(drawflags & MAN_ROT_V) {
|
||||
if(G.f & G_PICKSEL) glLoadName(MAN_ROT_V);
|
||||
BIF_ThemeColor(TH_TRANSFORM);
|
||||
drawcircball(unitmat[3], 1.2f*size, unitmat);
|
||||
drawcircball(GL_LINE_LOOP, unitmat[3], 1.2f*size, unitmat);
|
||||
|
||||
if(moving) {
|
||||
float vec[3];
|
||||
@@ -882,14 +882,14 @@ static void draw_manipulator_rotate(float mat[][4], int moving, int drawflags, i
|
||||
if(drawflags & MAN_ROT_Z) {
|
||||
if(G.f & G_PICKSEL) glLoadName(MAN_ROT_Z);
|
||||
manipulator_setcolor('z', colcode);
|
||||
drawcircball(unitmat[3], 1.0, unitmat);
|
||||
drawcircball(GL_LINE_LOOP, unitmat[3], 1.0, unitmat);
|
||||
}
|
||||
/* X circle */
|
||||
if(drawflags & MAN_ROT_X) {
|
||||
if(G.f & G_PICKSEL) glLoadName(MAN_ROT_X);
|
||||
glRotatef(90.0, 0.0, 1.0, 0.0);
|
||||
manipulator_setcolor('x', colcode);
|
||||
drawcircball(unitmat[3], 1.0, unitmat);
|
||||
drawcircball(GL_LINE_LOOP, unitmat[3], 1.0, unitmat);
|
||||
glRotatef(-90.0, 0.0, 1.0, 0.0);
|
||||
}
|
||||
/* Y circle */
|
||||
@@ -897,7 +897,7 @@ static void draw_manipulator_rotate(float mat[][4], int moving, int drawflags, i
|
||||
if(G.f & G_PICKSEL) glLoadName(MAN_ROT_Y);
|
||||
glRotatef(-90.0, 1.0, 0.0, 0.0);
|
||||
manipulator_setcolor('y', colcode);
|
||||
drawcircball(unitmat[3], 1.0, unitmat);
|
||||
drawcircball(GL_LINE_LOOP, unitmat[3], 1.0, unitmat);
|
||||
glRotatef(90.0, 1.0, 0.0, 0.0);
|
||||
}
|
||||
|
||||
@@ -1231,7 +1231,7 @@ static void draw_manipulator_rotate_cyl(float mat[][4], int moving, int drawflag
|
||||
|
||||
if(G.f & G_PICKSEL) glLoadName(MAN_ROT_V);
|
||||
BIF_ThemeColor(TH_TRANSFORM);
|
||||
drawcircball(unitmat[3], 1.2f*size, unitmat);
|
||||
drawcircball(GL_LINE_LOOP, unitmat[3], 1.2f*size, unitmat);
|
||||
|
||||
if(moving) {
|
||||
float vec[3];
|
||||
@@ -1562,14 +1562,14 @@ static void draw_manipulator_rotate_2d(float mat[][4], int moving, int drawflags
|
||||
if(arcs) {
|
||||
if((G.f & G_PICKSEL)==0) {
|
||||
BIF_ThemeColorShade(TH_BACK, -30);
|
||||
drawcircball(unitmat[3], size, unitmat);
|
||||
drawcircball(GL_LINE_LOOP, unitmat[3], size, unitmat);
|
||||
}
|
||||
}
|
||||
/* Screen aligned view rot circle */
|
||||
if(drawflags & MAN_ROT_V) {
|
||||
if(G.f & G_PICKSEL) glLoadName(MAN_ROT_V);
|
||||
BIF_ThemeColor(TH_TRANSFORM);
|
||||
drawcircball(unitmat[3], 1.2f*size, unitmat);
|
||||
drawcircball(GL_LINE_LOOP, unitmat[3], 1.2f*size, unitmat);
|
||||
|
||||
if(moving) {
|
||||
float vec[3];
|
||||
@@ -1640,20 +1640,20 @@ static void draw_manipulator_rotate_2d(float mat[][4], int moving, int drawflags
|
||||
/* Z circle */
|
||||
if(drawflags & MAN_ROT_Z) {
|
||||
manipulator_setcolor('z', colcode);
|
||||
drawcircball(unitmat[3], 1.0, unitmat);
|
||||
drawcircball(GL_LINE_LOOP, unitmat[3], 1.0, unitmat);
|
||||
}
|
||||
/* X circle */
|
||||
if(drawflags & MAN_ROT_X) {
|
||||
glRotatef(90.0, 0.0, 1.0, 0.0);
|
||||
manipulator_setcolor('x', colcode);
|
||||
drawcircball(unitmat[3], 1.0, unitmat);
|
||||
drawcircball(GL_LINE_LOOP, unitmat[3], 1.0, unitmat);
|
||||
glRotatef(-90.0, 0.0, 1.0, 0.0);
|
||||
}
|
||||
/* Y circle */
|
||||
if(drawflags & MAN_ROT_Y) {
|
||||
glRotatef(-90.0, 1.0, 0.0, 0.0);
|
||||
manipulator_setcolor('y', colcode);
|
||||
drawcircball(unitmat[3], 1.0, unitmat);
|
||||
drawcircball(GL_LINE_LOOP, unitmat[3], 1.0, unitmat);
|
||||
glRotatef(90.0, 1.0, 0.0, 0.0);
|
||||
}
|
||||
|
||||
@@ -1666,14 +1666,14 @@ static void draw_manipulator_rotate_2d(float mat[][4], int moving, int drawflags
|
||||
if(drawflags & MAN_ROT_Z) {
|
||||
if(G.f & G_PICKSEL) glLoadName(MAN_ROT_Z);
|
||||
manipulator_setcolor('z', colcode);
|
||||
drawcircball(unitmat[3], 1.0, unitmat);
|
||||
drawcircball(GL_LINE_LOOP, unitmat[3], 1.0, unitmat);
|
||||
}
|
||||
/* X circle */
|
||||
if(drawflags & MAN_ROT_X) {
|
||||
if(G.f & G_PICKSEL) glLoadName(MAN_ROT_X);
|
||||
glRotatef(90.0, 0.0, 1.0, 0.0);
|
||||
manipulator_setcolor('x', colcode);
|
||||
drawcircball(unitmat[3], 1.0, unitmat);
|
||||
drawcircball(GL_LINE_LOOP, unitmat[3], 1.0, unitmat);
|
||||
glRotatef(-90.0, 0.0, 1.0, 0.0);
|
||||
}
|
||||
/* Y circle */
|
||||
@@ -1681,7 +1681,7 @@ static void draw_manipulator_rotate_2d(float mat[][4], int moving, int drawflags
|
||||
if(G.f & G_PICKSEL) glLoadName(MAN_ROT_Y);
|
||||
glRotatef(-90.0, 1.0, 0.0, 0.0);
|
||||
manipulator_setcolor('y', colcode);
|
||||
drawcircball(unitmat[3], 1.0, unitmat);
|
||||
drawcircball(GL_LINE_LOOP, unitmat[3], 1.0, unitmat);
|
||||
glRotatef(90.0, 1.0, 0.0, 0.0);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user