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>2007-01-02 16:54:24 +0300
committerCampbell Barton <ideasman42@gmail.com>2007-01-02 16:54:24 +0300
commit05338c7c1bdf4ea39286ad26a3ace6c8d1a85354 (patch)
treed19765472814505fa22637229159ce413be17f93 /source/blender/src/editview.c
parent426cc6dca3f7081502f07eb656af2aafa22023a7 (diff)
improved z-locking (would previously still try to rotate about the view axis and then right it).
also added error messages for libdata and dont allow views with object locking to fly.
Diffstat (limited to 'source/blender/src/editview.c')
-rw-r--r--source/blender/src/editview.c31
1 files changed, 25 insertions, 6 deletions
diff --git a/source/blender/src/editview.c b/source/blender/src/editview.c
index 26a768e5926..210c0fff7db 100644
--- a/source/blender/src/editview.c
+++ b/source/blender/src/editview.c
@@ -2135,7 +2135,17 @@ void fly(void)
if(curarea->spacetype!=SPACE_VIEW3D) return;
- if(G.vd->persp==2 && G.vd->camera->id.lib) return;
+
+ if(G.vd->persp==2 && G.vd->camera->id.lib) {
+ error("Cannot fly a camera from an external library");
+ return;
+ }
+
+ if(G.vd->ob_centre) {
+ error("Cannot fly when the view is locked to an object");
+ return;
+ }
+
persp_backup= G.vd->persp;
dist_backup= G.vd->dist;
@@ -2325,10 +2335,18 @@ void fly(void)
/* rotate about the Y axis- look left/right */
if (moffset[0]) {
- upvec[0]=0;
- upvec[1]=1;
- upvec[2]=0;
- Mat3MulVecfl(mat, upvec);
+
+ if (zlock) {
+ upvec[0]=0;
+ upvec[1]=0;
+ upvec[2]=1;
+ } else {
+ upvec[0]=0;
+ upvec[1]=1;
+ upvec[2]=0;
+ Mat3MulVecfl(mat, upvec);
+ }
+
VecRotToQuat( upvec, (float)moffset[0]*time_redraw*20, tmp_quat); /* Rotate about the relative up vec */
QuatMul(G.vd->viewquat, G.vd->viewquat, tmp_quat);
@@ -2431,7 +2449,6 @@ void fly(void)
insertkey(&G.vd->camera->id, ID_OB, actname, NULL, OB_LOC_Z);
}
}
- DAG_object_flush_update(G.scene, G.vd->camera, OB_RECALC_OB);
}
scrarea_do_windraw(curarea);
screen_swapbuffers();
@@ -2463,6 +2480,8 @@ void fly(void)
Mat3CpyMat4(mat3, G.vd->camera->obmat);
Mat3ToCompatibleEul(mat3, G.vd->camera->rot, rot_backup);
+ DAG_object_flush_update(G.scene, G.vd->camera, OB_RECALC_OB);
+
if (G.flags & G_RECORDKEYS) {
allqueue(REDRAWIPO, 0);
allspace(REMAKEIPO, 0);