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>2015-10-22 19:08:17 +0300
committerCampbell Barton <ideasman42@gmail.com>2015-10-22 19:09:28 +0300
commit80470b639c1c5091541c56ae80212fa8e5148913 (patch)
treef86e47e0213f7e93a5aa9adfec33380700ff51c4 /source/blender/editors/space_view3d/view3d_fly.c
parent0d54aa9c024261851bef24a3ebfd2bd875fec380 (diff)
BLI_math: axis_angle_to_quat_single
Useful to avoid defining a vector for an axis-aligned rotation. Matches axis_angle_to_mat3_single behavior.
Diffstat (limited to 'source/blender/editors/space_view3d/view3d_fly.c')
-rw-r--r--source/blender/editors/space_view3d/view3d_fly.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/source/blender/editors/space_view3d/view3d_fly.c b/source/blender/editors/space_view3d/view3d_fly.c
index e6910cf9303..f3ee99fc3bf 100644
--- a/source/blender/editors/space_view3d/view3d_fly.c
+++ b/source/blender/editors/space_view3d/view3d_fly.c
@@ -720,8 +720,6 @@ static int flyApply(bContext *C, FlyInfo *fly)
float dvec[3] = {0, 0, 0}; /* this is the direction thast added to the view offset per redraw */
/* Camera Uprighting variables */
- float upvec[3] = {0, 0, 0}; /* stores the view's up vector */
-
float moffset[2]; /* mouse offset from the views center */
float tmp_quat[4]; /* used for rotating the view */
@@ -815,6 +813,7 @@ static int flyApply(bContext *C, FlyInfo *fly)
/* rotate about the X axis- look up/down */
if (moffset[1]) {
+ float upvec[3];
copy_v3_fl3(upvec, 1.0f, 0.0f, 0.0f);
mul_m3_v3(mat, upvec);
/* Rotate about the relative up vec */
@@ -830,7 +829,7 @@ static int flyApply(bContext *C, FlyInfo *fly)
/* rotate about the Y axis- look left/right */
if (moffset[0]) {
-
+ float upvec[3];
/* if we're upside down invert the moffset */
copy_v3_fl3(upvec, 0.0f, 1.0f, 0.0f);
mul_m3_v3(mat, upvec);
@@ -858,6 +857,7 @@ static int flyApply(bContext *C, FlyInfo *fly)
}
if (fly->zlock == FLY_AXISLOCK_STATE_ACTIVE) {
+ float upvec[3];
copy_v3_fl3(upvec, 1.0f, 0.0f, 0.0f);
mul_m3_v3(mat, upvec);
@@ -882,6 +882,7 @@ static int flyApply(bContext *C, FlyInfo *fly)
/* only apply xcorrect when mouse isn't applying x rot */
if (fly->xlock == FLY_AXISLOCK_STATE_ACTIVE && moffset[1] == 0) {
+ float upvec[3];
copy_v3_fl3(upvec, 0.0f, 0.0f, 1.0f);
mul_m3_v3(mat, upvec);
/* make sure we have some z rolling */