diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-11-30 08:40:32 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-11-30 08:40:32 +0400 |
commit | 8c3df03c5f3dc3246dc73111c3946757ee3e54ef (patch) | |
tree | 27f48df7c8353ee20cb9c54ca68a2016a95f40e0 /source/blender/editors/space_view3d/view3d_view.c | |
parent | c3406db4f5e87402d43a5d2a5e0049b16479d2d5 (diff) |
make previous commit work when the camera is locked to the view (in that case use the camera lens, not the viewport lens value).
Diffstat (limited to 'source/blender/editors/space_view3d/view3d_view.c')
-rw-r--r-- | source/blender/editors/space_view3d/view3d_view.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c index ea09aca900f..e79f24eea09 100644 --- a/source/blender/editors/space_view3d/view3d_view.c +++ b/source/blender/editors/space_view3d/view3d_view.c @@ -1521,10 +1521,9 @@ float ED_view3d_pixel_size(RegionView3D *rv3d, const float co[3]) } /* use for perspective view only */ -float ED_view3d_dist_from_radius(View3D *v3d, const float radius) +float ED_view3d_dist_from_radius(const float angle, const float radius) { - const float angle = (((float)M_PI) - focallength_to_fov(v3d->lens, DEFAULT_SENSOR_WIDTH)); - return radius * fabsf(1.0f / cosf(angle / 2.0f)); + return radius * fabsf(1.0f / cosf((((float)M_PI) - angle) / 2.0f)); } /* view matrix properties utilities */ |