cgv
|
the vr namespace for virtual reality support More...
Classes | |
struct | controller_input_config |
configuration of a controller input axis More... | |
struct | driver_registry |
use this template to register your own driver More... | |
class | gl_vr_display |
implements offscreen rendering More... | |
class | vr_calibration_base |
base class with write access to driver calibration matrix More... | |
class | vr_camera |
interface for mono or stereo cameras in VR headsets More... | |
struct | vr_controller_info |
information provided for controller devices More... | |
struct | vr_controller_state |
Extends the trackable state by information on the buttons, input axes and vibration strengths. More... | |
struct | vr_device_info |
information provided for any device type More... | |
class | vr_driver |
interface class for vr drivers. More... | |
struct | vr_hmd_info |
information provided for hmd device More... | |
class | vr_kit |
a vr kit is composed of headset, two controllers, and two trackers, where all devices can be attached or detached More... | |
struct | vr_kit_info |
information provided for a vr kit More... | |
struct | vr_kit_state |
structure that stores all information describing the state of a VR kit More... | |
class | vr_log |
helper struct for logging vr events More... | |
struct | vr_trackable_info |
information provided for trackable devices More... | |
struct | vr_trackable_state |
a trackable knows whether it is tracked and its 6d pose stored as 3x4 matrix in column major format More... | |
struct | vr_tracking_reference_info |
information provided for a base station / tracking reference More... | |
struct | vr_tracking_system_info |
information provided for tracking system More... | |
Enumerations | |
enum | EyeSelection |
enum to support restriction of eyes to a single eye | |
enum | CameraState |
different status values for a vr camera | |
enum | CameraFrameFormat |
currently only a single frame format supported | |
enum | CameraFrameSplit |
in case of stereo cameras a frame contains images of both eyes either split vertically (left right) or horizontally (top bottom) | |
enum | VRControllerType |
type of controller | |
enum | VRControllerRole |
role of controller | |
enum | VRInputType |
different controller input types | |
enum | VRAxisType |
different axis types of controller inputs | |
enum | KeyAction |
repeated definition from cgv/gui/key_event.h | |
enum | VRKeys { , VR_SYSTEM, VR_MENU, VR_GRIP, VR_DPAD_DOWN_LEFT, VR_DPAD_DOWN, VR_DPAD_DOWN_RIGHT, VR_DPAD_LEFT, VR_DPAD_RIGHT, VR_DPAD_UP_LEFT, VR_DPAD_UP, VR_DPAD_UP_RIGHT, VR_A, VR_INPUT0_TOUCH, VR_INPUT0, VR_INPUT1_TOUCH, VR_INPUT1, VR_INPUT2_TOUCH, VR_INPUT2, VR_INPUT3_TOUCH, VR_INPUT3, VR_INPUT4_TOUCH, VR_INPUT4, VR_PROXIMITY, VR_END, VR_BEGIN =VR_SYSTEM } |
enumerate all VR keys starting at 1024 More... | |
enum | VRButtonStateFlags { VRF_SYSTEM = 0x000001, VRF_MENU = 0x000002, VRF_GRIP = 0x000004, VRF_DPAD_LEFT = 0x000008, VRF_DPAD_RIGHT = 0x000010, VRF_DPAD_DOWN = 0x000020, VRF_DPAD_UP = 0x000040, VRF_A = 0x000080, VRF_INPUT0_TOUCH = 0x000100, VRF_INPUT0 = 0x000200, VRF_INPUT1_TOUCH = 0x000400, VRF_INPUT1 = 0x000800, VRF_INPUT2_TOUCH = 0x001000, VRF_INPUT2 = 0x002000, VRF_INPUT3_TOUCH = 0x004000, VRF_INPUT3 = 0x008000, VRF_INPUT4_TOUCH = 0x010000, VRF_INPUT4 = 0x020000, VRF_PROXIMITY = 0x040000 } |
one flag for each vr controller button More... | |
enum | VRStatus { VRS_DETACHED, VRS_ATTACHED, VRS_TRACKED } |
different status values for a trackable More... | |
enum | VRMeshId |
enumerate for different mesh types | |
Functions | |
std::map< void *, vr_kit * > & | ref_vr_kit_map () |
access to vr_kit map singleton | |
std::vector< vr_driver * > & | ref_drivers () |
return registered drivers | |
std::ostream & | operator<< (std::ostream &os, const vr_device_info &di) |
stream out operator for device infos | |
std::ostream & | operator<< (std::ostream &os, const vr_trackable_info &TI) |
stream out operator for trackable device infos | |
std::ostream & | operator<< (std::ostream &os, const vr_hmd_info &HI) |
stream out operator for hmd device infos | |
std::ostream & | operator<< (std::ostream &os, const vr_controller_info &CI) |
stream out operator for controller device infos | |
std::ostream & | operator<< (std::ostream &os, const vr_kit_info &VI) |
stream out operator for vr kit info | |
std::ostream & | operator<< (std::ostream &os, const vr_tracking_reference_info &TI) |
stream out operator for tracking reference device infos | |
std::ostream & | operator<< (std::ostream &os, const vr_tracking_system_info &TSI) |
stream out operator for tracking system infos | |
std::string | get_key_string (unsigned short key) |
convert key to string | |
std::string | get_state_flag_string (VRButtonStateFlags flags) |
convert flags to string | |
std::string | get_status_string (VRStatus status) |
convert flags to string | |
const std::string & | get_vrmesh_file_name (VRMeshId id) |
return the file name for the given vrmesh type | |
void | set_vrmesh_file_name (VRMeshId id, const std::string &file_name) |
set the file name for the given vrmesh type | |
cgv::render::mesh_render_info * | get_vrmesh_render_info (cgv::render::context &ctx, VRMeshId id) |
return a pointer to a mesh info structure for the given mesh type (read and construct if necessary); returns 0 pointer if mesh is not available | |
cgv::render::render_types::mat4 | get_mat4_from_pose (const float pose_matrix[12]) |
convert pose to mat4 | |
cgv::render::render_types::mat4 | get_world_to_eye_transform (const vr_kit *vr_kit_ptr, const vr_kit_state &state, int eye) |
compute lookat matrix for a given eye (0 ... left, 1 ... right) | |
cgv::render::render_types::mat4 | get_world_to_camera_transform (const vr_kit *vr_kit_ptr, const vr_kit_state &state, int eye) |
compute lookat matrix for a given camera (0 ... left, 1 ... right) | |
cgv::render::render_types::mat4 | get_eye_projection_transform (const vr_kit *vr_kit_ptr, const vr_kit_state &state, float z_near, float z_far, int eye) |
query projection matrix for a given eye (0 ... left, 1 ... right) | |
cgv::render::render_types::mat4 | get_camera_projection_transform (const vr_kit *vr_kit_ptr, float z_near, float z_far, int eye, bool undistorted) |
query projection matrix for a given camera (0 ... left or mono, 1 ... right only for stereo cameras) | |
cgv::render::render_types::mat4 | get_texture_transform (const vr_kit *vr_kit_ptr, const vr_kit_state &state, float z_near, float z_far, int eye, bool undistorted) |
query the texture matrix needed for projective texture mapping for a given camera (0 ... left or mono, 1 ... right only for stereo cameras) | |
bool | configure_seethrough_shader_program (cgv::render::context &ctx, cgv::render::shader_program &prog, uint32_t frame_width, uint32_t frame_height, const vr_kit *vr_kit_ptr, const vr_kit_state &state, float z_near, float z_far, int eye, bool undistorted) |
set all uniforms of seethrough shader program for a given camera (0 ... left or mono, 1 ... right only for stereo cameras). More... | |
Variables | |
const unsigned | max_nr_controllers = 8 |
maximum number of attachable controller and tracker devices | |
const unsigned | max_nr_controller_inputs = 5 |
maximum number of inputs per controller | |
const unsigned | max_nr_controller_axes = 8 |
maximum number of axes per controller | |
vr driver management | |
class CGV_API | vr_driver |
forward declaration of vr driver class More... | |
void | register_driver (vr_driver *vrd) |
register a new driver | |
std::vector< vr_driver * > & | get_vr_drivers () |
return a vector with all registered vr drivers | |
the vr namespace for virtual reality support
provides functions bridging the basic vr support with the cgv framework
the helper functions allow to compute the modelview, projection and texture matrices needed for rendering.
one flag for each vr controller button
enum vr::VRKeys |
enumerate all VR keys starting at 1024
enum vr::VRStatus |
CGV_API bool vr::configure_seethrough_shader_program | ( | cgv::render::context & | ctx, |
cgv::render::shader_program & | prog, | ||
uint32_t | frame_width, | ||
uint32_t | frame_height, | ||
const vr_kit * | vr_kit_ptr, | ||
const vr_kit_state & | state, | ||
float | z_near, | ||
float | z_far, | ||
int | eye, | ||
bool | undistorted | ||
) |
set all uniforms of seethrough shader program for a given camera (0 ... left or mono, 1 ... right only for stereo cameras).
For this the get_texture_transform is used to compute the texture matrix. Return whether setting the uniforms was successful.
class CGV_API vr::vr_driver |
forward declaration of vr driver class
give vr driver access to camera initialization and destruction