Monado OpenXR Runtime
|
Functions related to field-of-view. More...
#include "math/m_mathinclude.h"
#include "math/m_api.h"
#include "util/u_debug.h"
#include <math.h>
#include <stdio.h>
#include <assert.h>
Macros | |
#define | METERS_FORMAT "%0.4fm" |
#define | DEG_FORMAT "%0.1f deg" |
Functions | |
static bool | math_solve_triangle (double w_total, double w_1, double theta_total, double *out_theta_1, double *out_theta_2, double *out_d) |
Perform some of the computations from "Computing Half-Fields-Of-View from Simpler Display Models", to solve for the half-angles for a triangle where we know the center and total angle but not the "distance". More... | |
bool | math_compute_fovs (double w_total, double w_1, double horizfov_total, double h_total, double h_1, double vertfov_total, struct xrt_fov *fov) |
Perform the computations from "Computing Half-Fields-Of-View from Simpler Display Models", to get half-FOVs from things we can retrieve from other APIs. More... | |
Functions related to field-of-view.
|
static |
Perform some of the computations from "Computing Half-Fields-Of-View from Simpler Display Models", to solve for the half-angles for a triangle where we know the center and total angle but not the "distance".
In the diagram below, the top angle is theta_total, the length of the bottom is w_total, and the distance between the vertical line and the left corner is w_1. out_theta_1 is the angle at the top of the left-most right triangle, out_theta_2 is the angle at the top of the right-most right triangle, and out_d is the length of that center vertical line, a logical "distance".
Any outparams that are NULL will simply not be set.
The triangle need not be symmetrical, despite how the diagram looks.
Distances are in arbitrary but consistent units. Angles are in radians.
Referenced by math_compute_fovs().