You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-21 14:57:09 +00:00
Use constants from math_funcs rather than unstandardized C++ constants.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#include "audio_effect_phaser.h"
|
||||
#include "servers/audio_server.h"
|
||||
#include "math_funcs.h"
|
||||
|
||||
void AudioEffectPhaserInstance::process(const AudioFrame *p_src_frames,AudioFrame *p_dst_frames,int p_frame_count) {
|
||||
|
||||
@@ -8,14 +9,14 @@ void AudioEffectPhaserInstance::process(const AudioFrame *p_src_frames,AudioFram
|
||||
float dmin = base->range_min / (sampling_rate/2.0);
|
||||
float dmax = base->range_max / (sampling_rate/2.0);
|
||||
|
||||
float increment = 2.f * M_PI * (base->rate / sampling_rate);
|
||||
float increment = 2.f * Math_PI * (base->rate / sampling_rate);
|
||||
|
||||
for(int i=0;i<p_frame_count;i++) {
|
||||
|
||||
phase += increment;
|
||||
|
||||
while ( phase >= M_PI * 2.f ) {
|
||||
phase -= M_PI * 2.f;
|
||||
while ( phase >= Math_PI * 2.f ) {
|
||||
phase -= Math_PI * 2.f;
|
||||
}
|
||||
|
||||
float d = dmin + (dmax-dmin) * ((sin( phase ) + 1.f)/2.f);
|
||||
|
||||
Reference in New Issue
Block a user