| 640 | double aspect_ratio; |
| 641 | |
| 642 | Camera(const af::array& position_, const af::array& lookat_, double fov_, |
| 643 | double focal_length_, uint32_t viewport_width_, |
| 644 | uint32_t viewport_height_) |
| 645 | : position(position_) |
| 646 | , lookat(lookat_) |
| 647 | , fov(fov_) |
| 648 | , focal_length(focal_length_) |
| 649 | , width(viewport_width_) |
| 650 | , height(viewport_height_) { |
| 651 | auto global_vertical = af::array(3, {0.0, 0.0, 1.0}); |
| 652 | |
| 653 | // Compute the camera three main axes |
| 654 | direction = normalize3(lookat - position); |
| 655 | horizontal = normalize3(cross_product(direction, global_vertical)); |
| 656 | vertical = normalize3(cross_product(direction, horizontal)); |
| 657 | |
| 658 | aspect_ratio = (double)width / (double)height; |
| 659 | } |
| 660 | |
| 661 | /** |
| 662 | * @brief Generates the initial rays 4-vector position and velocities |
nothing calls this directly
no test coverage detected