| 45 | // clang-format on |
| 46 | |
| 47 | std::array<float, 16> CreateProjectionMatrix(const xr::System::Session::Frame::View& view) |
| 48 | { |
| 49 | const float n{view.DepthNearZ}; |
| 50 | const float f{view.DepthFarZ}; |
| 51 | |
| 52 | const float r{std::tanf(view.FieldOfView.AngleRight) * n}; |
| 53 | const float l{std::tanf(view.FieldOfView.AngleLeft) * n}; |
| 54 | const float t{std::tanf(view.FieldOfView.AngleUp) * n}; |
| 55 | const float b{std::tanf(view.FieldOfView.AngleDown) * n}; |
| 56 | |
| 57 | std::array<float, 16> bxResult{}; |
| 58 | bx::mtxProj(bxResult.data(), t, b, l, r, n, f, false, bx::Handness::Right); |
| 59 | |
| 60 | return bxResult; |
| 61 | } |
| 62 | |
| 63 | std::array<float, 16> CreateTransformMatrix(const xr::System::Session::Frame::Space& space, bool viewSpace = true) |
| 64 | { |