src/ofxOpenVR.cpp
//-----------------------------------------------------------------------------
// Purpose: Create/destroy GL a Render Model for a single tracked device
//-----------------------------------------------------------------------------
Create/destroy GL a Render Model for a single tracked device
Create / destroy GL a Render Model for a single tracked device
void ofxOpenVR::setupRenderModelForTrackedDevice(vr::TrackedDeviceIndex_t unTrackedDeviceIndex)
{
	if (unTrackedDeviceIndex >= vr::k_unMaxTrackedDeviceCount) {
		return;
	}
	std::string sRenderModelName = getTrackedDeviceString(_pHMD, unTrackedDeviceIndex, vr::Prop_RenderModelName_String);
	CGLRenderModel *pRenderModel = findOrLoadRenderModel(sRenderModelName.c_str());
	if (!pRenderModel) {
		std::string sTrackingSystemName = getTrackedDeviceString(_pHMD, unTrackedDeviceIndex, vr::Prop_TrackingSystemName_String);
		printf("Unable to load render model for tracked device %d (%s.%s)", unTrackedDeviceIndex, sTrackingSystemName.c_str(), sRenderModelName.c_str());
	}
	else {
		_rTrackedDeviceToRenderModel[unTrackedDeviceIndex] = pRenderModel;
	}
}
void ofxOpenVR :: setupRenderModelForTrackedDevice ( vr :: TrackedDeviceIndex_t unTrackedDeviceIndex ) { if ( unTrackedDeviceIndex >= vr :: k_unMaxTrackedDeviceCount ) { return ; } std :: string sRenderModelName = getTrackedDeviceString ( _pHMD , unTrackedDeviceIndex , vr :: Prop_RenderModelName_String ) ; CGLRenderModel * pRenderModel = findOrLoadRenderModel ( sRenderModelName . c_str ( ) ) ; if ( ! pRenderModel ) { std :: string sTrackingSystemName = getTrackedDeviceString ( _pHMD , unTrackedDeviceIndex , vr :: Prop_TrackingSystemName_String ) ; printf ( " " , unTrackedDeviceIndex , sTrackingSystemName . c_str ( ) , sRenderModelName . c_str ( ) ) ; } else { _rTrackedDeviceToRenderModel [ unTrackedDeviceIndex ] = pRenderModel ; } }
Purpose: Create/destroy GL a Render Model for a single tracked device
Purpose : Create / destroy GL a Render Model for a single tracked device
// try to find a model we've already set up