include/GizegoEngine.h
//Call this every time the listener(player) moves and feed this function it's position.
Call this every time the listener(player) moves and feed this function it's position.
Call this every time the listener ( player ) moves and feed this function it ' s position .
void Update(vec2 pos)
		{
			if (pos.x > m_x)
				m_source->SetPanning(-0.9);
			else if (pos.x < m_y)
				m_source->SetPanning(0.9);
			else
				m_source->SetPanning(0);
			double distance = MeasureDistance(pos.x, pos.y);
			if (distance < m_range)
			{
				if (pos.x != m_x && pos.y != m_y)
					m_source->SetVolume((m_range / distance) * 10);
				else
					m_source->SetVolume(100);
			}
			else
			{
				m_source->SetVolume(0);
			}
		}
void Update ( vec2 pos ) { if ( pos . x > m_x ) m_source -> SetPanning ( -0.9 ) ; else if ( pos . x < m_y ) m_source -> SetPanning ( 0.9 ) ; else m_source -> SetPanning ( 0 ) ; double distance = MeasureDistance ( pos . x , pos . y ) ; if ( distance < m_range ) { if ( pos . x != m_x && pos . y != m_y ) m_source -> SetVolume ( ( m_range / distance ) * 10 ) ; else m_source -> SetVolume ( 100 ) ; } else { m_source -> SetVolume ( 0 ) ; } }
Call this every time the listener(player) moves and feed this function it's position.
Call this every time the listener ( player ) moves and feed this function it ' s position .