syedhs
11-04-2007 20:56:51
Hi,
I am trying to create a doppler effect: a camera will just wait at the roadside for vehicle.. and the vehicle pass.. and well you know it
The problem is there is no doppler effect - the sound stays the same. Just to make sure I am not missing anything, here is the code flow:-
Setup
1. Create sound
2. setRelativeDistance(true); // may not be applicable here..
3. setRenderingDistance; // may not applicable too
4. and attach it to SceneNode of the vehicle.
5. Create camera SceneNode
6. attach camera to it
7. attach the SoundManager::getSingleton().getListener() to this node too.
In loop
1. setVelocity to the sound.
I think the setup is quite straight forward; I may miss some step but I doubt it. The culprit could be the setVelocity. I may not provide the correct value. Currently I am using Ageia PhysX and I use the linear velocity of the actor (rigid body of the car) as the velocity. Linear velocity has x,y,z and I think should be okay.
Okay what else did I miss?
Edit: Okay I do vary the sound pitch in every frame. Should be okay isn't it?
I am trying to create a doppler effect: a camera will just wait at the roadside for vehicle.. and the vehicle pass.. and well you know it

Setup
1. Create sound
2. setRelativeDistance(true); // may not be applicable here..
3. setRenderingDistance; // may not applicable too
4. and attach it to SceneNode of the vehicle.
5. Create camera SceneNode
6. attach camera to it
7. attach the SoundManager::getSingleton().getListener() to this node too.
In loop
1. setVelocity to the sound.
I think the setup is quite straight forward; I may miss some step but I doubt it. The culprit could be the setVelocity. I may not provide the correct value. Currently I am using Ageia PhysX and I use the linear velocity of the actor (rigid body of the car) as the velocity. Linear velocity has x,y,z and I think should be okay.
Okay what else did I miss?
Edit: Okay I do vary the sound pitch in every frame. Should be okay isn't it?