Use curve radius for paths

- use_radius option, off by default for 2.4x files, on by default on new curves.
- curve deform modifiers (think tentacles)
- follow path (parent mode and constraint)
- curve guides
- added back Alt+S to scale point radius
- Mat3Scale and Mat4Scale arithb.c functions to make a new uniform scale matrix.

- TODO, effectors, looks like they have no way to scale from the radius yet.
This commit is contained in:
2009-09-12 16:25:49 +00:00
parent d16bde417f
commit f130f16fef
15 changed files with 99 additions and 30 deletions

View File

@@ -524,7 +524,7 @@ static int where_on_path_deform(Object *ob, float ctime, float *vec, float *dir,
static int calc_curve_deform(Scene *scene, Object *par, float *co, short axis, CurveDeform *cd, float *quatp)
{
Curve *cu= par->data;
float fac, loc[4], dir[3], cent[3];
float fac, loc[4], dir[3], cent[3], radius;
short upflag, index;
if(axis==MOD_CURVE_POSX || axis==MOD_CURVE_NEGX) {
@@ -579,7 +579,7 @@ static int calc_curve_deform(Scene *scene, Object *par, float *co, short axis, C
}
#endif // XXX old animation system
if( where_on_path_deform(par, fac, loc, dir, NULL, NULL)) { /* returns OK */
if( where_on_path_deform(par, fac, loc, dir, NULL, &radius)) { /* returns OK */
float q[4], mat[3][3], quat[4];
if(cd->no_rot_axis) /* set by caller */
@@ -599,7 +599,14 @@ static int calc_curve_deform(Scene *scene, Object *par, float *co, short axis, C
QuatMul(quat, q, quat);
}
QuatToMat3(quat, mat);
if(cu->flag & CU_PATH_RADIUS) {
float tmat[3][3], rmat[3][3];
Mat3Scale(tmat, radius);
Mat3MulMat3(rmat, mat, tmat);
Mat3CpyMat3(mat, rmat);
}
/* local rotation */
Mat3MulVecfl(mat, cent);