Fix for strange (showed in windows only) error that delivered flat curve

deforms by default. Proved to be a [3] array passed on to function needing
[4] array. Bad bad...
Thanks Ole for finding it! :)
This commit is contained in:
2004-11-21 10:42:42 +00:00
parent cbb66c68f0
commit 0069a48897
4 changed files with 7 additions and 3 deletions

View File

@@ -202,6 +202,7 @@ int interval_test(int min, int max, int p1, int cycl)
return p1; return p1;
} }
/* warning, *vec needs FOUR items! */
int where_on_path(Object *ob, float ctime, float *vec, float *dir) /* returns OK */ int where_on_path(Object *ob, float ctime, float *vec, float *dir) /* returns OK */
{ {
Curve *cu; Curve *cu;

View File

@@ -509,6 +509,7 @@ struct chartrans *text_to_curve(Object *ob, int mode)
CLAMP(ctime, 0.0, 1.0); CLAMP(ctime, 0.0, 1.0);
/* calc the right loc AND the right rot separately */ /* calc the right loc AND the right rot separately */
/* vec, tvec need 4 items */
where_on_path(cu->textoncurve, ctime, vec, tvec); where_on_path(cu->textoncurve, ctime, vec, tvec);
where_on_path(cu->textoncurve, ctime+dtime, tvec, rotvec); where_on_path(cu->textoncurve, ctime+dtime, tvec, rotvec);

View File

@@ -411,7 +411,7 @@ static void init_curve_deform(Object *par, Object *ob, CurveDeform *cd)
} }
/* this makes sure we can extend for non-cyclic */ /* this makes sure we can extend for non-cyclic. *vec needs 4 items! */
static int where_on_path_deform(Object *ob, float ctime, float *vec, float *dir) /* returns OK */ static int where_on_path_deform(Object *ob, float ctime, float *vec, float *dir) /* returns OK */
{ {
Curve *cu= ob->data; Curve *cu= ob->data;
@@ -427,7 +427,8 @@ static int where_on_path_deform(Object *ob, float ctime, float *vec, float *dir)
ctime1= CLAMPIS(ctime, 0.0, 1.0); ctime1= CLAMPIS(ctime, 0.0, 1.0);
} }
else ctime1= ctime; else ctime1= ctime;
/* vec needs 4 items */
if(where_on_path(ob, ctime1, vec, dir)) { if(where_on_path(ob, ctime1, vec, dir)) {
if(cycl==0) { if(cycl==0) {
@@ -456,7 +457,7 @@ static int where_on_path_deform(Object *ob, float ctime, float *vec, float *dir)
static void calc_curve_deform(Object *par, float *co, short axis, CurveDeform *cd) static void calc_curve_deform(Object *par, float *co, short axis, CurveDeform *cd)
{ {
Curve *cu= par->data; Curve *cu= par->data;
float fac, loc[3], dir[3], *quat, mat[3][3], cent[3]; float fac, loc[4], dir[3], *quat, mat[3][3], cent[3];
short upflag, index; short upflag, index;
if(axis==OB_POSX || axis==OB_NEGX) { if(axis==OB_POSX || axis==OB_NEGX) {

View File

@@ -1009,6 +1009,7 @@ void ob_parcurve(Object *ob, Object *par, float mat[][4])
CLAMP(ctime, 0.0, 1.0); CLAMP(ctime, 0.0, 1.0);
} }
/* vec: 4 items! */
if( where_on_path(par, ctime, vec, dir) ) { if( where_on_path(par, ctime, vec, dir) ) {
if(cu->flag & CU_FOLLOW) { if(cu->flag & CU_FOLLOW) {