src/utilities/behaviors/SteamVRInput.js
function getController(hand, config) {
	const findGamepad = (resolve, reject) => {
		const gamepad = altspace.getGamepads().find((g) => g.mapping === 'steamvr' && g.hand === hand);
		if (gamepad) {
			if(config.logging) console.log("SteamVR input device found", gamepad);
			resolve(gamepad);
		} else {
			if(config.logging) console.log("SteamVR input device not found trying again in 500ms...");
			setTimeout(findGamepad, 500, resolve, reject);
		}
	};

	return new Promise(findGamepad);
}
function getController(hand, config) {
	const findGamepad = (resolve, reject) => {
		const gamepad = altspace.getGamepads().find((g) => g.mapping === 'steamvr' && g.hand === hand);
		if (gamepad) {
			if(config.logging) console.log("SteamVR input device found", gamepad);
			resolve(gamepad);
		} else {
			if(config.logging) console.log("SteamVR input device not found trying again in 500ms...");
			setTimeout(findGamepad, 500, resolve, reject);
		}
	};

	return new Promise(findGamepad);
}
function getController ( hand , config ) { const findGamepad = ( resolve , reject ) => { const gamepad = altspace . getGamepads ( ) . find ( ( g ) => g . mapping === 'steamvr' && g . hand === hand ) ; if ( gamepad ) { if ( config . logging ) console . log ( "SteamVR input device found" , gamepad ) ; resolve ( gamepad ) ; } else { if ( config . logging ) console . log ( "SteamVR input device not found trying again in 500ms..." ) ; setTimeout ( findGamepad , 500 , resolve , reject ) ; } } ; return new Promise ( findGamepad ) ; }
Returns a Promise that resovles static when a steamvr controller is found
Returns a Promise that resovles static when a steamvr controller is found