| 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 | { |
no test coverage detected