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:
authorDalai Felinto <dfelinto@gmail.com>2015-10-25 02:02:42 +0300
committerDalai Felinto <dfelinto@gmail.com>2015-10-25 02:02:42 +0300
commit3bc5399f72f5b3f1942a91e89ad238b832882384 (patch)
treef4a0e80f64f28b850fbafbbc782400988a402fa4 /source/blender/editors/space_view3d/view3d_view.c
parent11c00caddcc1e1c099af8c68b50485b8a00ecea8 (diff)
Fix T46590 Strange camera behavior (partial revert of fbca69c6)
I'm sure there is a way of using the new functions for the obmat_to_viewmat() routine. But for now let's get it back to a working state
Diffstat (limited to 'source/blender/editors/space_view3d/view3d_view.c')
-rw-r--r--source/blender/editors/space_view3d/view3d_view.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c
index 5fc7b57739e..bacb8e212cb 100644
--- a/source/blender/editors/space_view3d/view3d_view.c
+++ b/source/blender/editors/space_view3d/view3d_view.c
@@ -849,10 +849,18 @@ void view3d_winmatrix_set(ARegion *ar, const View3D *v3d, const rctf *rect)
static void obmat_to_viewmat(RegionView3D *rv3d, Object *ob)
{
+ float bmat[4][4];
+ float tmat[3][3];
+
rv3d->view = RV3D_VIEW_USER; /* don't show the grid */
- mat4_to_quat(rv3d->viewquat, ob->obmat);
- invert_qt_normalized(rv3d->viewquat);
- quat_to_mat4(rv3d->viewmat, rv3d->viewquat);
+
+ copy_m4_m4(bmat, ob->obmat);
+ normalize_m4(bmat);
+ invert_m4_m4(rv3d->viewmat, bmat);
+
+ /* view quat calculation, needed for add object */
+ copy_m3_m4(tmat, rv3d->viewmat);
+ mat3_to_quat(rv3d->viewquat, tmat);
}
static float view3d_quat_axis[6][4] = {