OpenVR

From Pragma
Jump to: navigation, search

Name: wv_openvr

State:

CLIENT

Description

By loading this module, the openvr library is made available.

Examples

This example will initialize the openvr API and retrieve some property information about the device:

local r = engine.load_library("openvr/wv_openvr")
if(r ~= true) then
	print("WARNING: An error occured trying to load the 'wv_openvr' module: ",r)
	return
end
local err = openvr.initialize()
if(err ~= openvr.INIT_ERROR_NONE) then
	print("WARNING: Unable to initialize openvr: ",openvr.init_error_to_string(err))
	return
end

local err,name = openvr.get_tracking_system_name()
if(err == openvr.TRACKED_PROPERY_ERROR_SUCCESS) then print("Tracking System Name: ",name) end

local err,mdlNumber = openvr.get_model_number()
if(err == openvr.TRACKED_PROPERY_ERROR_SUCCESS) then print("Model Number: ",mdlNumber) end

local err,manufacturer = openvr.get_manufacturer_name()
if(err == openvr.TRACKED_PROPERY_ERROR_SUCCESS) then print("Manufacturer: ",manufacturer) end

openvr.show_mirror_window()

See Also