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
path: root/source
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2007-04-19 11:58:42 +0400
committerCampbell Barton <ideasman42@gmail.com>2007-04-19 11:58:42 +0400
commit11c1dbdfbfedf02b5e361b09f024e2bd3cd03745 (patch)
tree7957b5a6c4558d8369f3d60a00d649be4e974f3d /source
parentf9ff47464d9fd30d5def3852dd7fd8e71c0e25d3 (diff)
recent smoothview update broke pan in camera view, some vars used in the function needed to be used after, reverting this change.
Diffstat (limited to 'source')
-rw-r--r--source/blender/src/view.c29
1 files changed, 27 insertions, 2 deletions
diff --git a/source/blender/src/view.c b/source/blender/src/view.c
index a6e689d23fc..7c27fd920f4 100644
--- a/source/blender/src/view.c
+++ b/source/blender/src/view.c
@@ -837,8 +837,33 @@ int get_view3d_viewplane(int winxi, int winyi, rctf *viewplane, float *clipsta,
*clipsta= G.vd->near;
*clipend= G.vd->far;
- if(G.vd->persp==2)
- object_view_settings(G.vd->camera, &lens, clipsta, clipend);
+/*
+ * Cant use this since we need the fac and x1 values set
+ * if(G.vd->persp==2)
+ object_view_settings(G.vd->camera, &lens, &(*clipsta), &(*clipend));*/
+
+ if(G.vd->persp==2) {
+ if(G.vd->camera) {
+ if(G.vd->camera->type==OB_LAMP ) {
+ Lamp *la;
+
+ la= G.vd->camera->data;
+ fac= cos( M_PI*la->spotsize/360.0);
+
+ x1= saacos(fac);
+ lens= 16.0*fac/sin(x1);
+
+ *clipsta= la->clipsta;
+ *clipend= la->clipend;
+ }
+ else if(G.vd->camera->type==OB_CAMERA) {
+ cam= G.vd->camera->data;
+ lens= cam->lens;
+ *clipsta= cam->clipsta;
+ *clipend= cam->clipend;
+ }
+ }
+ }
if(G.vd->persp==0) {
if(winx>winy) x1= -G.vd->dist;