MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / doppler

Function doppler

extlibs/soloud/src/core/soloud_core_3d.cpp:143–154  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

141#endif
142
143 float doppler(vec3 aDeltaPos, vec3 aSrcVel, vec3 aDstVel, float aFactor, float aSoundSpeed)
144 {
145 float deltamag = aDeltaPos.mag();
146 if (deltamag == 0)
147 return 1.0f;
148 float vls = aDeltaPos.dot(aDstVel) / deltamag;
149 float vss = aDeltaPos.dot(aSrcVel) / deltamag;
150 float maxspeed = aSoundSpeed / aFactor;
151 vss = MIN(vss, maxspeed);
152 vls = MIN(vls, maxspeed);
153 return (aSoundSpeed - aFactor * vls) / (aSoundSpeed - aFactor * vss);
154 }
155
156 float attenuateInvDistance(float aDistance, float aMinDistance, float aMaxDistance, float aRolloffFactor)
157 {

Callers 1

update3dVoicesMethod · 0.85

Calls 2

magMethod · 0.80
dotMethod · 0.80

Tested by

no test coverage detected