| 1194 | } |
| 1195 | |
| 1196 | OVR_PUBLIC_FUNCTION(unsigned int) ovr_GetFloatArray(ovrSession session, const char* propertyName, float values[], unsigned int valuesCapacity) |
| 1197 | { |
| 1198 | REV_TRACE(ovr_GetFloatArray); |
| 1199 | |
| 1200 | if (strcmp(propertyName, OVR_KEY_NECK_TO_EYE_DISTANCE) == 0) |
| 1201 | { |
| 1202 | if (valuesCapacity < 2) |
| 1203 | return 0; |
| 1204 | |
| 1205 | // We only know the horizontal depth |
| 1206 | values[0] = vr::VRSystem()->GetFloatTrackedDeviceProperty(vr::k_unTrackedDeviceIndex_Hmd, vr::Prop_UserHeadToEyeDepthMeters_Float); |
| 1207 | values[1] = OVR_DEFAULT_NECK_TO_EYE_VERTICAL; |
| 1208 | return 2; |
| 1209 | } |
| 1210 | |
| 1211 | if (!session) |
| 1212 | return 0; |
| 1213 | |
| 1214 | unsigned int valuesFound = 0; |
| 1215 | char key[vr::k_unMaxSettingsKeyLength] = { 0 }; |
| 1216 | for (vr::EVRSettingsError error = vr::VRSettingsError_None; error != vr::VRSettingsError_None && valuesFound < valuesCapacity; valuesFound++) |
| 1217 | { |
| 1218 | sprintf_s(key, "%s[%d]", propertyName, valuesFound); |
| 1219 | values[valuesFound] = vr::VRSettings()->GetFloat(session->AppKey, key, &error); |
| 1220 | if (error != vr::VRSettingsError_None) |
| 1221 | break; |
| 1222 | } |
| 1223 | return valuesFound; |
| 1224 | } |
| 1225 | |
| 1226 | OVR_PUBLIC_FUNCTION(ovrBool) ovr_SetFloatArray(ovrSession session, const char* propertyName, const float values[], unsigned int valuesSize) |
| 1227 | { |
nothing calls this directly
no outgoing calls
no test coverage detected