Trying a little something with the MMB behavior.

Constraint selection is now based on mouse motion (instead of pointer position).

What that means is that if you simply click MMB, it works exactly like it did with old transform (in 90% of the case, the last 10% is when MMB click was unpredictable in old transform because of extreme viewport orientation)

Also, since this means you don't really have a referential on which to base yourself, it draws a dashed line representing the mouse motion, starting at the center of the axis lines.


Please test and discuss, if this is better than before or not.
This commit is contained in:
2005-03-17 02:34:25 +00:00
parent 07c26eb397
commit 9a30f56937
3 changed files with 30 additions and 3 deletions

View File

@@ -613,9 +613,24 @@ void BIF_drawConstraint(void)
}
else {
if (tc->mode & CON_SELECT) {
drawLine(tc->center, tc->mtx[0], 'x', 0);
drawLine(tc->center, tc->mtx[1], 'y', 0);
drawLine(tc->center, tc->mtx[2], 'z', 0);
float vec[3];
short mval[2];
char col2[3] = {255,255,255};
getmouseco_areawin(mval);
window_to_3d(vec, (short)(mval[0] - t->con.imval[0]), (short)(mval[1] - t->con.imval[1]));
VecAddf(vec, vec, tc->center);
drawLine(tc->center, tc->mtx[0], 'x', 0);
drawLine(tc->center, tc->mtx[1], 'y', 0);
drawLine(tc->center, tc->mtx[2], 'z', 0);
glColor3ubv(col2);
setlinestyle(1);
glBegin(GL_LINE_STRIP);
glVertex3fv(tc->center);
glVertex3fv(vec);
glEnd();
}
if (tc->mode & CON_AXIS0) {
@@ -720,6 +735,9 @@ void selectConstraint(TransInfo *t) {
void postSelectConstraint(TransInfo *t)
{
if (!(t->con.mode & CON_SELECT))
return;
t->con.mode &= ~CON_AXIS0;
t->con.mode &= ~CON_AXIS1;
t->con.mode &= ~CON_AXIS2;
@@ -748,8 +766,13 @@ void setNearestAxis(TransInfo *t)
}
getmouseco_areawin(coord);
#if 1
mvec[0] = (float)(coord[0] - t->con.imval[0]);
mvec[1] = (float)(coord[1] - t->con.imval[1]);
#else
mvec[0] = (float)(coord[0] - t->center2d[0]);
mvec[1] = (float)(coord[1] - t->center2d[1]);
#endif
mvec[2] = 0.0f;
for (i = 0; i<3; i++) {