Esempio n. 1
0
    void Camera::update(float duration, bool paused)
    {
        if (mAnimation->allowSwitchViewMode())
        {
            // Now process the view changes we queued earlier
            if (mVanityToggleQueued)
            {
                toggleVanityMode(!mVanity.enabled);
                mVanityToggleQueued = false;
            }
            if (mViewModeToggleQueued)
            {

                togglePreviewMode(false);
                toggleViewMode();
                mViewModeToggleQueued = false;
            }
        }

        updateListener();
        if (paused)
            return;

        // only show the crosshair in game mode and in first person mode.
        MWBase::WindowManager *wm = MWBase::Environment::get().getWindowManager();
        wm->showCrosshair(!wm->isGuiMode() && (mFirstPersonView && !mVanity.enabled && !mPreviewMode));

        if(mVanity.enabled)
        {
            Ogre::Vector3 rot(0.f, 0.f, 0.f);
            rot.z = Ogre::Degree(3.f * duration).valueRadians();
            rotateCamera(rot, true);
        }
    }
void CPSMoverPage::setZPosition(double value)
{
	NLMISC::CVector &pos = _EditedLocated->getPos()[_EditedLocatedIndex];
	if (fabs(pos.z - _ui.zDoubleSpinBox->value()) > epsilon)
	{
		pos.z = value;
		updateListener();
		_Node->setModified(true);
	}
}
void SoundManager::update(Camera* p_gameCamera)
{
	m_masterVoice->SetVolume(m_masterVolume,0);
	updateListener(p_gameCamera);

	X3DAudioCalculate(m_X3DAudioInstance, &m_listener, &m_music->getEmitter(),
		X3DAUDIO_CALCULATE_MATRIX, &m_music->getDSPSettings());

	IXAudio2SourceVoice* voice = m_music->getSource();
	m_left = m_matrixCoefficients[0];
	m_right = m_matrixCoefficients[1];
	voice->SetOutputMatrix( m_masterVoice, 1, m_destChannels, m_matrixCoefficients);

	if(!m_music->isPlaying())
		m_music->play();
}
Esempio n. 4
0
void Sound::render()
{
    if (!initialized)
    {
        return;
    }

    World *world = &World::getInstance();

    for (vector<WorldObject *>::iterator i = world->wobjects.begin();
         i != world->wobjects.end(); i++)
    {
        if (!(*i)->sobject) continue;
        (*i)->sobject->update(&(**i));
    }

    updateListener();
}
Esempio n. 5
0
    void Player::update(float duration)
    {
        updateListener();

        // only show the crosshair in game mode and in first person mode.
        MWBase::Environment::get().getWindowManager ()->showCrosshair
                (!MWBase::Environment::get().getWindowManager ()->isGuiMode () && (mFirstPersonView && !mVanity.enabled && !mPreviewMode));

        /// \fixme We shouldn't hide the whole model, just certain components of the character (head, chest, feet, etc)
        mPlayerNode->setVisible(mVanity.enabled || mPreviewMode || !mFirstPersonView);
        if (mFirstPersonView && !mVanity.enabled) {
            return;
        }
        if (mVanity.enabled) {
            Ogre::Vector3 rot(0.f, 0.f, 0.f);
            rot.z = Ogre::Degree(3.f * duration).valueRadians();
            rotateCamera(rot, true);
        }
    }
void SoundManager::update()
{
	updateListener();
	updateSounds();
}