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

Function ovr_GetTouchHapticsDesc

ReviveXR/REV_CAPI.cpp:552–571  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

550}
551
552OVR_PUBLIC_FUNCTION(ovrTouchHapticsDesc) ovr_GetTouchHapticsDesc(ovrSession session, ovrControllerType controllerType)
553{
554 REV_TRACE(ovr_GetTouchHapticsDesc);
555 MICROPROFILE_META_CPU("Controller Type", controllerType);
556
557 ovrTouchHapticsDesc desc = { 0 };
558 if (session && controllerType & ovrControllerType_Touch)
559 {
560 if ((*session->CurrentFrame).predictedDisplayPeriod == 0)
561 desc.SampleRateHz = 0;
562 else
563 desc.SampleRateHz = (int)(1000000000i64 / (*session->CurrentFrame).predictedDisplayPeriod);
564 desc.SampleSizeInBytes = sizeof(uint8_t);
565 desc.SubmitMaxSamples = OVR_HAPTICS_BUFFER_SAMPLES_MAX;
566 desc.SubmitMinSamples = 1;
567 desc.SubmitOptimalSamples = 20;
568 desc.QueueMinSizeToAvoidStarvation = 5;
569 }
570 return desc;
571}
572
573OVR_PUBLIC_FUNCTION(ovrResult) ovr_SetControllerVibration(ovrSession session, ovrControllerType controllerType, float frequency, float amplitude)
574{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected