| 1331 | } |
| 1332 | |
| 1333 | OVR_PUBLIC_FUNCTION(float) ovr_GetFloat(ovrSession session, const char* propertyName, float defaultVal) |
| 1334 | { |
| 1335 | REV_TRACE(ovr_GetFloat); |
| 1336 | |
| 1337 | if (session) |
| 1338 | { |
| 1339 | if (strcmp(propertyName, "IPD") == 0) |
| 1340 | return XR::Vector3f(session->ViewPoses[ovrEye_Left].pose.position).Distance( |
| 1341 | XR::Vector3f(session->ViewPoses[ovrEye_Right].pose.position)); |
| 1342 | |
| 1343 | if (strcmp(propertyName, "VsyncToNextVsync") == 0) |
| 1344 | return (*session->CurrentFrame).predictedDisplayPeriod / 1e9f; |
| 1345 | } |
| 1346 | |
| 1347 | // Override defaults, we should always return a valid value for these |
| 1348 | if (strcmp(propertyName, OVR_KEY_PLAYER_HEIGHT) == 0) |
| 1349 | defaultVal = OVR_DEFAULT_PLAYER_HEIGHT; |
| 1350 | else if (strcmp(propertyName, OVR_KEY_EYE_HEIGHT) == 0) |
| 1351 | defaultVal = OVR_DEFAULT_EYE_HEIGHT; |
| 1352 | |
| 1353 | return defaultVal; |
| 1354 | } |
| 1355 | |
| 1356 | OVR_PUBLIC_FUNCTION(ovrBool) ovr_SetFloat(ovrSession session, const char* propertyName, float value) |
| 1357 | { |