MCPcopy Create free account
hub / github.com/LibreVR/Revive / ovr_GetFloat

Function ovr_GetFloat

ReviveXR/REV_CAPI.cpp:1333–1354  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1331}
1332
1333OVR_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
1356OVR_PUBLIC_FUNCTION(ovrBool) ovr_SetFloat(ovrSession session, const char* propertyName, float value)
1357{

Callers

nothing calls this directly

Calls 1

Vector3fClass · 0.70

Tested by

no test coverage detected