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>2015-09-04 15:04:54 +0300
committerCampbell Barton <ideasman42@gmail.com>2015-09-04 15:13:20 +0300
commit1d71ad2eaa5176ed6ab8ca5bfbeb5f8eb9fa3453 (patch)
treedf95b8ed9109e20a754f1e4de00bcbdbeaff4aa1 /source/blender/blenkernel/intern/camera.c
parentd0e7ba3fd1a9becfc843eeee1d1f9fffd83f3748 (diff)
Math Lib: Use plane intersect from graphics-gems
Diffstat (limited to 'source/blender/blenkernel/intern/camera.c')
-rw-r--r--source/blender/blenkernel/intern/camera.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/source/blender/blenkernel/intern/camera.c b/source/blender/blenkernel/intern/camera.c
index 88e089d9960..b67f553b3b0 100644
--- a/source/blender/blenkernel/intern/camera.c
+++ b/source/blender/blenkernel/intern/camera.c
@@ -565,7 +565,7 @@ static void camera_frame_fit_data_init(
static bool camera_frame_fit_calc_from_data(
CameraParams *params, CameraViewFrameData *data, float r_co[3], float *r_scale)
{
- float plane_tx[CAMERA_VIEWFRAME_NUM_PLANES][3];
+ float plane_tx[CAMERA_VIEWFRAME_NUM_PLANES][4];
unsigned int i;
if (data->tot <= 1) {
@@ -609,15 +609,13 @@ static bool camera_frame_fit_calc_from_data(
/* apply the dist-from-plane's to the transformed plane points */
for (i = 0; i < CAMERA_VIEWFRAME_NUM_PLANES; i++) {
- mul_v3_v3fl(plane_tx[i], data->normal_tx[i], sqrtf_signed(data->dist_vals_sq[i]));
+ float co[3];
+ mul_v3_v3fl(co, data->normal_tx[i], sqrtf_signed(data->dist_vals_sq[i]));
+ plane_from_point_normal_v3(plane_tx[i], co, data->normal_tx[i]);
}
- if ((!isect_plane_plane_v3(plane_isect_1, plane_isect_1_no,
- plane_tx[0], data->normal_tx[0],
- plane_tx[2], data->normal_tx[2])) ||
- (!isect_plane_plane_v3(plane_isect_2, plane_isect_2_no,
- plane_tx[1], data->normal_tx[1],
- plane_tx[3], data->normal_tx[3])))
+ if ((!isect_plane_plane_v3(plane_tx[0], plane_tx[2], plane_isect_1, plane_isect_1_no)) ||
+ (!isect_plane_plane_v3(plane_tx[1], plane_tx[3], plane_isect_2, plane_isect_2_no)))
{
return false;
}