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

Method GetSample

ReviveXR/HapticsBuffer.cpp:27–37  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25}
26
27float HapticsBuffer::GetSample()
28{
29 // We can't pass the write index, so the buffer is now empty
30 if (m_ReadIndex + 1 == m_WriteIndex)
31 return 0.0f;
32
33 // Index will overflow correctly, so no need for a modulo operator
34 uint8_t sample = m_Buffer[++m_ReadIndex];
35
36 return sample / 255.0f;
37}
38
39ovrHapticsPlaybackState HapticsBuffer::GetState()
40{

Callers 1

UpdateHapticsMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected