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>2018-05-10 13:24:07 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-05-10 13:24:07 +0300
commit27da2db0caf77b2f4cae443c3d3146d517a1cc4b (patch)
tree107eea89148ff7c5b4544cc6463b1236ccd73b16 /source/blender/editors/space_view3d
parente6814acf13d37f002f5fe6a20594970fcd186c2e (diff)
3D View: utility to get matrix from cursor
Diffstat (limited to 'source/blender/editors/space_view3d')
-rw-r--r--source/blender/editors/space_view3d/view3d_utils.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/source/blender/editors/space_view3d/view3d_utils.c b/source/blender/editors/space_view3d/view3d_utils.c
index 9ce427fb830..bc6d174efa0 100644
--- a/source/blender/editors/space_view3d/view3d_utils.c
+++ b/source/blender/editors/space_view3d/view3d_utils.c
@@ -81,6 +81,19 @@ View3DCursor *ED_view3d_cursor3d_get(Scene *scene, View3D *v3d)
}
}
+void ED_view3d_cursor3d_calc_mat3(const Scene *scene, const View3D *v3d, float mat[3][3])
+{
+ const View3DCursor *cursor = ED_view3d_cursor3d_get((Scene *)scene, (View3D *)v3d);
+ quat_to_mat3(mat, cursor->rotation);
+}
+
+void ED_view3d_cursor3d_calc_mat4(const Scene *scene, const View3D *v3d, float mat[4][4])
+{
+ const View3DCursor *cursor = ED_view3d_cursor3d_get((Scene *)scene, (View3D *)v3d);
+ quat_to_mat4(mat, cursor->rotation);
+ copy_v3_v3(mat[3], cursor->location);
+}
+
Camera *ED_view3d_camera_data_get(View3D *v3d, RegionView3D *rv3d)
{
/* establish the camera object, so we can default to view mapping if anything is wrong with it */