Head Mounted Display
Functions for managing viewer information.
Summary
Functions |
|
---|---|
gvr_compute_distorted_point(const gvr_context *gvr, const int32_t eye, const gvr_vec2f uv_in, gvr_vec2f uv_out[3])
|
void
Computes the distorted point for a given point in a given eye.
|
gvr_get_eye_from_head_matrix(const gvr_context *gvr, const int32_t eye)
|
Gets the transformation matrix to convert from Head Space to Eye Space for the given eye.
|
gvr_get_viewer_model(const gvr_context *gvr)
|
const char *
Gets the name of the viewer model.
|
gvr_get_viewer_type(const gvr_context *gvr)
|
int32_t
Gets the type of the viewer, as defined by gvr_viewer_type.
|
gvr_get_viewer_vendor(const gvr_context *gvr)
|
const char *
Gets the name of the viewer vendor.
|
gvr_get_window_bounds(const gvr_context *gvr)
|
Gets the window bounds.
|
gvr_refresh_viewer_profile(gvr_context *gvr)
|
void
Refreshes gvr_context with the viewer profile that is stored on the device.
|
gvr_set_default_viewer_profile(gvr_context *gvr, const char *viewer_profile_uri)
|
bool
Sets the default viewer profile specified by viewer_profile_uri.
|
Functions
gvr_compute_distorted_point
void gvr_compute_distorted_point( const gvr_context *gvr, const int32_t eye, const gvr_vec2f uv_in, gvr_vec2f uv_out[3] )
Computes the distorted point for a given point in a given eye.
The distortion inverts the optical distortion caused by the lens for the eye. Due to chromatic aberration, the distortion is different for each color channel.
Details | |||||||||
---|---|---|---|---|---|---|---|---|---|
Parameters |
|
gvr_get_eye_from_head_matrix
gvr_mat4f gvr_get_eye_from_head_matrix( const gvr_context *gvr, const int32_t eye )
Gets the transformation matrix to convert from Head Space to Eye Space for the given eye.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Returns |
Transformation matrix from Head Space to selected Eye Space.
|
gvr_get_viewer_model
const char * gvr_get_viewer_model( const gvr_context *gvr )
Gets the name of the viewer model.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
A pointer to the model name. May be NULL if no viewer is paired. WARNING: This method guarantees the validity of the returned pointer only until the next use of the
gvr context. The string should be copied immediately if persistence is required. |
gvr_get_viewer_type
int32_t gvr_get_viewer_type( const gvr_context *gvr )
Gets the type of the viewer, as defined by gvr_viewer_type.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
The gvr_viewer_type of the currently paired viewer.
|
gvr_get_viewer_vendor
const char * gvr_get_viewer_vendor( const gvr_context *gvr )
Gets the name of the viewer vendor.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
A pointer to the vendor name. May be NULL if no viewer is paired. WARNING: This method guarantees the validity of the returned pointer only until the next use of the
gvr context. The string should be copied immediately if persistence is required. |
gvr_get_window_bounds
gvr_recti gvr_get_window_bounds( const gvr_context *gvr )
Gets the window bounds.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
Window bounds in physical pixels.
|
gvr_refresh_viewer_profile
void gvr_refresh_viewer_profile( gvr_context *gvr )
Refreshes gvr_context with the viewer profile that is stored on the device.
If it can not find the viewer profile, nothing will happen.
Details | |||
---|---|---|---|
Parameters |
|
gvr_set_default_viewer_profile
bool gvr_set_default_viewer_profile( gvr_context *gvr, const char *viewer_profile_uri )
Sets the default viewer profile specified by viewer_profile_uri.
The viewer_profile_uri that is passed in will be ignored if a valid viewer profile has already been stored on the device that the app is running on.
Note: This function has the potential of blocking for up to 30 seconds for each redirect if a shortened URI is passed in as argument. It will try to unroll the shortened URI for a maximum number of 5 times if the redirect continues. In that case, it is recommended to create a separate thread to call this function so that other tasks like rendering will not be blocked on this. The blocking can be avoided if a standard URI is passed in.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Returns |
True if the viewer profile specified by viewer_profile_uri was successfully stored and applied, false otherwise.
|