Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTon Roosendaal <ton@blender.org>2005-05-13 17:06:20 +0400
committerTon Roosendaal <ton@blender.org>2005-05-13 17:06:20 +0400
commitc7942efdba12dcfbeede0219968c95e058a2baed (patch)
treea8aae2c5bf3907d1cd47e36b93f12e4a0193dc75 /source/blender/blenkernel/intern/lattice.c
parent05b985d6c8b1e004113def4bb57f48b43cbd704a (diff)
Deform with Curves didn't take the 'tilt' value into account.
Note, the tilting only works for '3D' curves, and is accessible in EditMode curve with TKEY.
Diffstat (limited to 'source/blender/blenkernel/intern/lattice.c')
-rw-r--r--source/blender/blenkernel/intern/lattice.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/lattice.c b/source/blender/blenkernel/intern/lattice.c
index 4d6f0942f91..3da60f99826 100644
--- a/source/blender/blenkernel/intern/lattice.c
+++ b/source/blender/blenkernel/intern/lattice.c
@@ -457,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)
{
Curve *cu= par->data;
- float fac, loc[4], dir[3], *quat, mat[3][3], cent[3];
+ float fac, loc[4], dir[3], *quat, q[4], mat[3][3], cent[3];
short upflag, index;
if(axis==OB_POSX || axis==OB_NEGX) {
@@ -495,6 +495,17 @@ static void calc_curve_deform(Object *par, float *co, short axis, CurveDeform *c
if( where_on_path_deform(par, fac, loc, dir)) { /* returns OK */
quat= vectoquat(dir, axis, upflag);
+
+ /* the tilt */
+ if(loc[3]!=0.0) {
+ Normalise(dir);
+ q[0]= (float)cos(0.5*loc[3]);
+ fac= (float)sin(0.5*loc[3]);
+ q[1]= -fac*dir[0];
+ q[2]= -fac*dir[1];
+ q[3]= -fac*dir[2];
+ QuatMul(quat, q, quat);
+ }
QuatToMat3(quat, mat);
/* local rotation */