Camera position and the sound effect

singbol

03-08-2009 10:17:02

Hi, I've got this problem, when I tried to create a sound object that is camera position related, it just didn't work, I haven't solved it yet~~~
...
Camera *pTrackCamera = OgitorsRoot::getSingleton().GetViewport()->GetCameraEditor()->GetCamera();
pTrackCamera->getParentSceneNode()->attachObject(SoundManager::getSingletonPtr()->getListener());
...
pSound = soundMgr.createSound(m_strSoundName, val);
pSound->play();
pSound->setRelativeToListener(false);
m_Handle->attachObject(pSound);

I have tried to set the rolloff factor、max distance and reference distance,but they didn't work yet~~~
help~~3 q!
I'm waiting for ~~~

singbol

04-08-2009 08:38:03

I've Solved this problem,
it's just because that the camera's parent scenenode's position is always (0, 0, 0)
sorry~~