MCPcopy Create free account
hub / github.com/ValveSoftware/steam-audio / GetRandomDirection

Function GetRandomDirection

core/src/test/BinauralEffect.test.cpp:21–27  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19#include <phonon.h>
20
21IPLVector3 GetRandomDirection()
22{
23 float theta = static_cast<float>(rand()) / static_cast<float>(RAND_MAX) * 2 * 3.14159265f;
24 float z = static_cast<float>(rand()) / static_cast<float>(RAND_MAX);
25 float oneminusz2 = sqrtf(1 - z * z);
26 return { oneminusz2 * cosf(theta), oneminusz2 * sinf(theta), z };
27}
28
29bool IsFinite(IPLAudioBuffer& buffer)
30{

Callers 1

ValidateBinauralEffectFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected