diff options
Diffstat (limited to 'source/blender/blenkernel/intern/camera.c')
-rw-r--r-- | source/blender/blenkernel/intern/camera.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/source/blender/blenkernel/intern/camera.c b/source/blender/blenkernel/intern/camera.c index 536ec95e3d1..aee8ede4062 100644 --- a/source/blender/blenkernel/intern/camera.c +++ b/source/blender/blenkernel/intern/camera.c @@ -227,7 +227,7 @@ void BKE_camera_params_from_object(CameraParams *params, Object *ob) else if (ob->type == OB_LAMP) { /* lamp object */ Lamp *la = ob->data; - float fac = cosf((float)M_PI * la->spotsize / 360.0f); + float fac = cosf(la->spotsize * 0.5f); float phi = acos(fac); params->lens = 16.0f * fac / sinf(phi); @@ -535,16 +535,11 @@ int BKE_camera_view_frame_fit_to_scene(Scene *scene, struct View3D *v3d, Object float plane_isect_pt_1[3], plane_isect_pt_2[3]; - /* could make a generic macro */ -#define SQRT_SIGNED(f) copysign(sqrtf(fabsf(f)), f) - /* apply the dist-from-plane's to the transformed plane points */ for (i = 0; i < 4; i++) { - mul_v3_v3fl(plane_tx[i], data_cb.normal_tx[i], SQRT_SIGNED(data_cb.dist_vals_sq[i])); + mul_v3_v3fl(plane_tx[i], data_cb.normal_tx[i], sqrtf_signed(data_cb.dist_vals_sq[i])); } -#undef SQRT_SIGNED - isect_plane_plane_v3(plane_isect_1, plane_isect_1_no, plane_tx[0], data_cb.normal_tx[0], plane_tx[2], data_cb.normal_tx[2]); |