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:
authorCampbell Barton <ideasman42@gmail.com>2009-09-11 19:35:30 +0400
committerCampbell Barton <ideasman42@gmail.com>2009-09-11 19:35:30 +0400
commitee768ada680ce0a8aa184c882005c0ef1c0140fb (patch)
treee4f475510c9628d9fae6b3ff3581276b4af3f374 /source/blender/makesdna/DNA_curve_types.h
parent042d3e595693ce0c280b46d13db921afbcf105a4 (diff)
curve twist
* added new twist method - "Tangent", suggested by Martin. the nice thing about this is its stable no matter how you rotate the data, rotation is local to each segment. * added smooth option that smooths the twisting (before applying user twist), to workaround Z-Up and Tangent's ugly curve twisting. Id prefer not to have this however it makes tangent much nicer. Possibly tangent can be improved some other way and this can be removed. A smooth value of 1.0 will iterate over and smooth the twisting by the resolution value of the spline. * Minimum-Twist method now corrects for cyclic twist by taking the roll difference between first and last, then increasingly counter rotate each segment over the entire curve. Previously it calculated from both directions and blended them. details * BevPoints use quats rather then 3x3 matrix. * added BevPoint direction "dir" and tangent "tan" used only for 3D curves. * don't calculate BevPoint->cosa, BevPoint->sina for 3D curves. * split bevel tilt calculation into functions. * nurbs curves currently don't generate tangents and wont work with tangent twist method. * some of the use of quats should be optimized. * smoothing is not animation safe, the higher the smoothing the higher the likelyhood of flipping.
Diffstat (limited to 'source/blender/makesdna/DNA_curve_types.h')
-rw-r--r--source/blender/makesdna/DNA_curve_types.h16
1 files changed, 12 insertions, 4 deletions
diff --git a/source/blender/makesdna/DNA_curve_types.h b/source/blender/makesdna/DNA_curve_types.h
index 3a7cf874dbd..013491187ae 100644
--- a/source/blender/makesdna/DNA_curve_types.h
+++ b/source/blender/makesdna/DNA_curve_types.h
@@ -71,7 +71,9 @@ typedef struct BevList {
#
#
typedef struct BevPoint {
- float vec[3], mat[3][3], alfa, radius, sina, cosa;
+ float vec[3], alfa, radius;
+ float sina, cosa; /* 2D Only */
+ float dir[3], tan[3], quat[4]; /* 3D Only */
short split_tag, dupe_tag;
} BevPoint;
@@ -165,7 +167,8 @@ typedef struct Curve {
int texflag; /* keep an int because of give_obdata_texspace() */
- short drawflag, pad[3];
+ short drawflag, twist_mode, pad[2];
+ float twist_smooth, pad2;
short pathlen, totcol;
short flag, bevresol;
@@ -174,7 +177,7 @@ typedef struct Curve {
/* default */
short resolu, resolv;
short resolu_ren, resolv_ren;
-
+
/* edit, index in nurb list */
int actnu;
/* edit, last selected bpoint */
@@ -231,7 +234,12 @@ typedef struct Curve {
#define CU_RETOPO 1024
#define CU_DS_EXPAND 2048
-#define CU_NO_TWIST 4096
+/* twist mode */
+#define CU_TWIST_Z_UP 0
+// #define CU_TWIST_Y_UP 1 // not used yet
+// #define CU_TWIST_X_UP 2
+#define CU_TWIST_MINIMUM 3
+#define CU_TWIST_TANGENT 4
/* spacemode */
#define CU_LEFT 0