Forum

hmd position and quat sensors are "dead" on Nexus 5

18 August 2017 20:17
I am developing a simple VR app to my Galaxy Nexus 5 using Chrome/59.0.3071.125 via Blend4Web CE 17.06. The app responds perfectly to any rotation movement, so I can look around, this is provided out of the box by the blend4web SDK.
However when I try to access the HMD position or quat data I get the same static values:
pos = [1, 1, 1]
quat = [0, 0, 0, 1]

Regardless of the position of my phone.

Here is the code snippet I use to access the data:

function register_hmd() {
				m_hmd_conf.update();
				// camera rotation is enabled with HMD
				m_hmd.enable_hmd(m_hmd.HMD_ALL_AXES_MOUSE_NONE);

				var cam = m_scenes.get_active_camera();
				var position = m_ctl.create_hmd_position_sensor();
				var rotation = m_ctl.create_hmd_quat_sensor();

				function gesture_detect_cb(obj, id, pulse) {
						var pos = m_ctl.get_sensor_payload(obj, id, 0);
						var quat = m_ctl.get_sensor_payload(obj, id, 1);
						console.log("pos", pos[0], pos[1], pos[2],
												"quat", quat[0], quat[1], quat[2], quat[3]);
						console.log(m_hmd.get_pos);
				}
 
Please register or log in to leave a reply.