[Bf-blender-cvs] [6f2aa50] master: Avoid redundant normalize in obmat_to_viewmat
Campbell Barton
noreply at git.blender.org
Sun Oct 25 07:56:37 CET 2015
Commit: 6f2aa50a727311cccd0f140408c077ffcb80feb8
Author: Campbell Barton
Date: Sun Oct 25 17:30:16 2015 +1100
Branches: master
https://developer.blender.org/rB6f2aa50a727311cccd0f140408c077ffcb80feb8
Avoid redundant normalize in obmat_to_viewmat
===================================================================
M source/blender/editors/space_view3d/view3d_view.c
===================================================================
diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c
index bacb8e2..19df5e4 100644
--- a/source/blender/editors/space_view3d/view3d_view.c
+++ b/source/blender/editors/space_view3d/view3d_view.c
@@ -850,17 +850,14 @@ 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 */
- copy_m4_m4(bmat, ob->obmat);
- normalize_m4(bmat);
+ normalize_m4_m4(bmat, ob->obmat);
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);
+ mat4_normalized_to_quat(rv3d->viewquat, rv3d->viewmat);
}
static float view3d_quat_axis[6][4] = {
More information about the Bf-blender-cvs
mailing list