Commit 24b88728 authored by Davis King's avatar Davis King

Fixed fov parameter range for camera_transform.

parent 17a5b3ae
...@@ -796,7 +796,7 @@ namespace dlib ...@@ -796,7 +796,7 @@ namespace dlib
*this = camera_transform(vector<double>(1,1,1), *this = camera_transform(vector<double>(1,1,1),
vector<double>(0,0,0), vector<double>(0,0,0),
vector<double>(0,0,1), vector<double>(0,0,1),
180, 90,
1); 1);
} }
...@@ -808,6 +808,13 @@ namespace dlib ...@@ -808,6 +808,13 @@ namespace dlib
const unsigned long num_pixels_ const unsigned long num_pixels_
) )
{ {
// make sure requires clause is not broken
DLIB_CASSERT(0 < camera_field_of_view_ && camera_field_of_view_ < 180,
"\t camera_transform::camera_transform()"
<< "\n\t Invalid inputs were given to this function."
<< "\n\t camera_field_of_view_: " << camera_field_of_view_
);
camera_pos = camera_pos_; camera_pos = camera_pos_;
camera_looking_at = camera_looking_at_; camera_looking_at = camera_looking_at_;
camera_up_direction = camera_up_direction_; camera_up_direction = camera_up_direction_;
......
...@@ -600,7 +600,7 @@ namespace dlib ...@@ -600,7 +600,7 @@ namespace dlib
- #get_camera_pos() == vector<double>(1,1,1) - #get_camera_pos() == vector<double>(1,1,1)
- #get_camera_looking_at() == vector<double>(0,0,0) - #get_camera_looking_at() == vector<double>(0,0,0)
- #get_camera_up_direction() == vector<double>(0,0,1) - #get_camera_up_direction() == vector<double>(0,0,1)
- #get_camera_field_of_view() == 180 - #get_camera_field_of_view() == 90
- #get_num_pixels() == 1 - #get_num_pixels() == 1
!*/ !*/
...@@ -613,7 +613,7 @@ namespace dlib ...@@ -613,7 +613,7 @@ namespace dlib
); );
/*! /*!
requires requires
- 0 < camera_field_of_view < 360 - 0 < camera_field_of_view < 180
ensures ensures
- #get_camera_pos() == camera_pos - #get_camera_pos() == camera_pos
- #get_camera_looking_at() == camera_looking_at - #get_camera_looking_at() == camera_looking_at
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment