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>2011-11-06 14:38:44 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-11-06 14:38:44 +0400
commite936c78251de5bafa99439803ab4fd2caa4df3b2 (patch)
tree51ccdc2efbab74903cb7b428619726832c3b1ab4 /source/blender/blenlib
parent735ab2b22d865570a4585e7088e66a45030ddf2d (diff)
parentb18e661ffcd39b97ac0c8295d778a1cb31339ed8 (diff)
svn merge ^/trunk/blender -r41503:41575
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r--source/blender/blenlib/BLI_math_rotation.h4
-rw-r--r--source/blender/blenlib/intern/math_rotation.c8
-rw-r--r--source/blender/blenlib/intern/pbvh.c2
-rw-r--r--source/blender/blenlib/intern/uvproject.c2
4 files changed, 8 insertions, 8 deletions
diff --git a/source/blender/blenlib/BLI_math_rotation.h b/source/blender/blenlib/BLI_math_rotation.h
index aef1c4bb46c..fca7c3469a1 100644
--- a/source/blender/blenlib/BLI_math_rotation.h
+++ b/source/blender/blenlib/BLI_math_rotation.h
@@ -179,8 +179,8 @@ void dquat_to_mat4(float R[4][4], DualQuat *dq);
void quat_apply_track(float quat[4], short axis, short upflag);
void vec_apply_track(float vec[3], short axis);
-float lens_to_angle(float lens);
-float angle_to_lens(float angle);
+float focallength_to_fov(float focal_length, float sensor);
+float fov_to_focallength(float fov, float sensor);
float angle_wrap_rad(float angle);
float angle_wrap_deg(float angle);
diff --git a/source/blender/blenlib/intern/math_rotation.c b/source/blender/blenlib/intern/math_rotation.c
index 0ca8b72c1e3..7fecbae8229 100644
--- a/source/blender/blenlib/intern/math_rotation.c
+++ b/source/blender/blenlib/intern/math_rotation.c
@@ -1688,14 +1688,14 @@ void vec_apply_track(float vec[3], short axis)
}
/* lens/angle conversion (radians) */
-float lens_to_angle(float lens)
+float focallength_to_fov(float focal_length, float sensor)
{
- return 2.0f * atanf(16.0f/lens);
+ return 2.0f * atanf((sensor/2.0f) / focal_length);
}
-float angle_to_lens(float angle)
+float fov_to_focallength(float hfov, float sensor)
{
- return 16.0f / tanf(angle * 0.5f);
+ return (sensor/2.0f) / tanf(hfov * 0.5f);
}
/* 'mod_inline(-3,4)= 1', 'fmod(-3,4)= -3' */
diff --git a/source/blender/blenlib/intern/pbvh.c b/source/blender/blenlib/intern/pbvh.c
index 6cba79849c2..16cc3c15bfd 100644
--- a/source/blender/blenlib/intern/pbvh.c
+++ b/source/blender/blenlib/intern/pbvh.c
@@ -80,7 +80,7 @@ typedef struct {
struct PBVHNode {
/* Opaque handle for drawing code */
- void *draw_buffers;
+ GPU_Buffers *draw_buffers;
/* Voxel bounds */
BB vb;
diff --git a/source/blender/blenlib/intern/uvproject.c b/source/blender/blenlib/intern/uvproject.c
index 30625e7b34e..8b00d8e48a6 100644
--- a/source/blender/blenlib/intern/uvproject.c
+++ b/source/blender/blenlib/intern/uvproject.c
@@ -141,7 +141,7 @@ UvCameraInfo *project_camera_info(Object *ob, float (*rotmat)[4], float winx, fl
uci.do_pano = (camera->flag & CAM_PANORAMA);
uci.do_persp = (camera->type==CAM_PERSP);
- uci.camangle= lens_to_angle(camera->lens) / 2.0f;
+ uci.camangle= focallength_to_fov(camera->lens, camera->sensor_x) / 2.0f;
uci.camsize= uci.do_persp ? tanf(uci.camangle) : camera->ortho_scale;
/* account for scaled cameras */