| 30 | } |
| 31 | |
| 32 | void |
| 33 | pcl::simulation::Camera::setParameters(int width, |
| 34 | int height, |
| 35 | float fx, |
| 36 | float fy, |
| 37 | float cx, |
| 38 | float cy, |
| 39 | float z_near, |
| 40 | float z_far) |
| 41 | { |
| 42 | width_ = width; |
| 43 | height_ = height; |
| 44 | fx_ = fx; |
| 45 | fy_ = fy; |
| 46 | cx_ = cx; |
| 47 | cy_ = cy; |
| 48 | z_near_ = z_near; |
| 49 | z_far_ = z_far; |
| 50 | |
| 51 | // clang-format off |
| 52 | float z_nf = (z_near_-z_far_); |
| 53 | projection_matrix_ << 2.0f*fx_/width_, 0, 1.0f-(2.0f*cx_/width_), 0, |
| 54 | 0, 2.0f*fy_/height_, 1.0f-(2.0f*cy_/height_), 0, |
| 55 | 0, 0, (z_far_+z_near_)/z_nf, 2.0f*z_near_*z_far_/z_nf, |
| 56 | 0, 0, -1.0f, 0; |
| 57 | // clang-format on |
| 58 | } |
| 59 | |
| 60 | void |
| 61 | pcl::simulation::Camera::initializeCameraParameters() |
no outgoing calls